Helix tree blocks & cubozoa rotations (WIP)

This commit is contained in:
paulevsGitch 2020-12-09 23:06:55 +03:00
parent 03b2f912b6
commit 27668f27a1
8 changed files with 14 additions and 0 deletions

View file

@ -8,7 +8,9 @@ import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
import ru.betterend.BetterEnd;
import ru.betterend.entity.EntityCubozoa;
import ru.betterend.entity.model.ModelEntityCubozoa;
@ -54,6 +56,15 @@ public class RendererEntityCubozoa extends MobEntityRenderer<EntityCubozoa, Mode
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(j));
}*/
@Override
protected void setupTransforms(EntityCubozoa squidEntity, MatrixStack matrixStack, float f, float g, float h) {
Vec3d velocity = squidEntity.getVelocity();
Vec3d flat = new Vec3d(velocity.getX(), 0, velocity.getZ());
float angle = (float) Math.acos(velocity.dotProduct(flat) / (velocity.length() * flat.length()));
matrixStack.multiply(Vector3f.POSITIVE_X.getRadialQuaternion(angle));
//matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(squidEntity.yaw));
}
static {
TEXTURE[0] = BetterEnd.makeID("textures/entity/cubozoa/cubozoa.png");
TEXTURE[1] = BetterEnd.makeID("textures/entity/cubozoa/cubozoa_sulphur.png");

View file

@ -151,6 +151,9 @@ public class EndBlocks {
public static final Block TENANEA_OUTER_LEAVES = registerBlock("tenanea_outer_leaves", new BlockFur(TENANEA_SAPLING, 32));
public static final WoodenMaterial TENANEA = new WoodenMaterial("tenanea", MaterialColor.BROWN, MaterialColor.PINK);
public static final Block HELIX_TREE_LEAVES = registerBlock("helix_tree_leaves", new BlockLeaves(TENANEA_SAPLING, MaterialColor.ORANGE));
public static final WoodenMaterial HELIX_TREE = new WoodenMaterial("helix_tree", MaterialColor.GRAY, MaterialColor.ORANGE);
// Small Plants //
public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new BlockUmbrellaMoss());
public static final Block UMBRELLA_MOSS_TALL = registerBlock("umbrella_moss_tall", new BlockUmbrellaMossTall());

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB