Added variable size
Added variable and dynamic hitbox Added dynamic growth times Added name tag skin handling Added Frozen Bone item Added Permafrost block and frozen bone drop, with spawn rules Changed Stone Fossil and Deepslate Fossil to have random texture
This commit is contained in:
@@ -207,6 +207,8 @@ public class ModBlocks {
|
||||
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
|
||||
public static final RegistrySupplier<Block> DEEPSLATE_ICE_SHARD_ORE = registerBlock("deepslate_ice_shard_ore",
|
||||
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
|
||||
public static final RegistrySupplier<Block> PERMAFROST = registerBlock("permafrost",
|
||||
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
|
||||
|
||||
public static final RegistrySupplier<Block> REINFORCED_STONE = registerBlock("reinforced_stone",
|
||||
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
|
||||
|
||||
@@ -20,6 +20,7 @@ public class ModBlockLootTableProvider {
|
||||
void dropSelf(Block block);
|
||||
void add(Block block, LootTable.Builder builder);
|
||||
LootTable.Builder createMultipleOreDrops(Block block, Item item, float minDrops, float maxDrops);
|
||||
LootTable.Builder createRandomOreDrops(Block block, Item silkTouchDrop, Item firstDrop, Item secondDrop, float minRolls, float maxRolls, double firstDropChance);
|
||||
LootTable.Builder createPotFlowerItemTable(Block block);
|
||||
}
|
||||
|
||||
@@ -53,6 +54,8 @@ public class ModBlockLootTableProvider {
|
||||
helper.createMultipleOreDrops(ModBlocks.AMBER_ORE.get(), ModItems.MOSQUITO_IN_AMBER.get(),1, 1));
|
||||
helper.add(ModBlocks.DEEPSLATE_ICE_SHARD_ORE.get(),
|
||||
helper.createMultipleOreDrops(ModBlocks.DEEPSLATE_ICE_SHARD_ORE.get(), ModItems.FROZEN_LEECH.get(),1, 1));
|
||||
helper.add(ModBlocks.PERMAFROST.get(),
|
||||
helper.createMultipleOreDrops(ModBlocks.PERMAFROST.get(), ModItems.FROZEN_BONE.get(),1, 1));
|
||||
|
||||
helper.dropSelf(ModBlocks.REINFORCED_STONE.get());
|
||||
helper.dropSelf(ModBlocks.REINFORCED_STONE_BRICKS.get());
|
||||
|
||||
@@ -12,6 +12,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModBlockStateProvider {
|
||||
|
||||
public interface BlockStateHelper {
|
||||
@@ -25,6 +27,8 @@ public class ModBlockStateProvider {
|
||||
void pottedPlantBlock(Block block, ResourceLocation plantTexture);
|
||||
|
||||
void blockWithItem(Block block);
|
||||
void blockWithItem(Block block, ResourceLocation sideTexture, ResourceLocation bottomTexture, ResourceLocation topTexture);
|
||||
void randomTextureBlockWithItem(Block block, List<ResourceLocation> textures);
|
||||
void horizontalFacingWithItem(Block block);
|
||||
void horizontalFacingLitWithItem(Block block);
|
||||
void horizontalFacingLitNoBlockstateWithItem(Block block);
|
||||
@@ -68,10 +72,22 @@ public class ModBlockStateProvider {
|
||||
helper.blockWithItem(ModBlocks.SMOOTH_GYPSUM_STONE.get());
|
||||
helper.blockWithItem(ModBlocks.CHISELED_GYPSUM_STONE.get());
|
||||
|
||||
helper.blockWithItem(ModBlocks.STONE_FOSSIL.get());
|
||||
helper.blockWithItem(ModBlocks.DEEPSLATE_FOSSIL.get());
|
||||
helper.randomTextureBlockWithItem(ModBlocks.STONE_FOSSIL.get(), List.of(
|
||||
Constants.rl("block/stone_fossil_egg"),
|
||||
Constants.rl("block/stone_fossil_rib"),
|
||||
Constants.rl("block/stone_fossil_skull")
|
||||
));
|
||||
helper.randomTextureBlockWithItem(ModBlocks.DEEPSLATE_FOSSIL.get(), List.of(
|
||||
Constants.rl("block/deepslate_fossil_egg"),
|
||||
Constants.rl("block/deepslate_fossil_rib"),
|
||||
Constants.rl("block/deepslate_fossil_skull")
|
||||
));
|
||||
helper.blockWithItem(ModBlocks.AMBER_ORE.get());
|
||||
helper.blockWithItem(ModBlocks.DEEPSLATE_ICE_SHARD_ORE.get());
|
||||
helper.blockWithItem(ModBlocks.PERMAFROST.get(),
|
||||
Constants.rl("block/permafrost_side"),
|
||||
Constants.rl("block/permafrost_bottom"),
|
||||
Constants.rl("block/permafrost_top"));
|
||||
|
||||
helper.blockWithItem(ModBlocks.REINFORCED_STONE.get());
|
||||
helper.blockWithItem(ModBlocks.REINFORCED_STONE_BRICKS.get());
|
||||
|
||||
@@ -148,7 +148,9 @@ public class ModBlockTagProvider {
|
||||
ModBlocks.INCUBATED_CHILESAURUS_EGG.get()
|
||||
);
|
||||
|
||||
helper.tag(BlockTags.MINEABLE_WITH_SHOVEL);
|
||||
helper.tag(BlockTags.MINEABLE_WITH_SHOVEL,
|
||||
ModBlocks.PERMAFROST.get()
|
||||
);
|
||||
|
||||
helper.tag(BlockTags.NEEDS_STONE_TOOL,
|
||||
ModBlocks.STONE_FOSSIL.get(),
|
||||
|
||||
@@ -109,6 +109,7 @@ public class ModItemModelProvider {
|
||||
helper.basicItemModel(ModItems.CRUSHED_FOSSIL.get());
|
||||
helper.basicItemModel(ModItems.MOSQUITO_IN_AMBER.get());
|
||||
helper.basicItemModel(ModItems.FROZEN_LEECH.get());
|
||||
helper.basicItemModel(ModItems.FROZEN_BONE.get());
|
||||
helper.basicItemModel(ModItems.CABLE.get());
|
||||
helper.basicItemModel(ModItems.SCREEN.get());
|
||||
helper.basicItemModel(ModItems.PROCESSOR.get());
|
||||
|
||||
@@ -42,18 +42,22 @@ public class ModWorldgenProvider implements DataProvider {
|
||||
))
|
||||
.toArray(CompletableFuture[]::new);
|
||||
|
||||
return CompletableFuture.allOf(
|
||||
CompletableFuture<?> allGenerators = CompletableFuture.allOf(
|
||||
java.util.stream.Stream.concat(
|
||||
java.util.Arrays.stream(oreFutures),
|
||||
java.util.Arrays.stream(spawnFutures)
|
||||
).toArray(CompletableFuture[]::new)
|
||||
);
|
||||
|
||||
return CompletableFuture.allOf(allGenerators, saveIsSnowyFallbackTag(cachedOutput));
|
||||
|
||||
}
|
||||
|
||||
private CompletableFuture<?> saveForgeAddFeatureBiomeModifier(CachedOutput cachedOutput, ModWorldgenDefinitions.OreDefinition ore) {
|
||||
JsonObject root = new JsonObject();
|
||||
root.addProperty("type", "forge:add_features");
|
||||
root.addProperty("biomes", "#minecraft:is_overworld");
|
||||
// Dynamically grab the biome tag
|
||||
root.addProperty("biomes", "#" + ore.biomeTag().location().toString());
|
||||
root.addProperty("features", Constants.rl(ore.name() + "_placed").toString());
|
||||
root.addProperty("step", "underground_ores");
|
||||
|
||||
@@ -66,7 +70,8 @@ public class ModWorldgenProvider implements DataProvider {
|
||||
private CompletableFuture<?> saveNeoForgeAddFeatureBiomeModifier(CachedOutput cachedOutput, ModWorldgenDefinitions.OreDefinition ore) {
|
||||
JsonObject root = new JsonObject();
|
||||
root.addProperty("type", "neoforge:add_features");
|
||||
root.addProperty("biomes", "#minecraft:is_overworld");
|
||||
// Dynamically grab the biome tag
|
||||
root.addProperty("biomes", "#" + ore.biomeTag().location().toString());
|
||||
root.addProperty("features", Constants.rl(ore.name() + "_placed").toString());
|
||||
root.addProperty("step", "underground_ores");
|
||||
|
||||
@@ -192,6 +197,42 @@ public class ModWorldgenProvider implements DataProvider {
|
||||
return DataProvider.saveStable(cachedOutput, root, path);
|
||||
}
|
||||
|
||||
private CompletableFuture<?> saveIsSnowyFallbackTag(CachedOutput cachedOutput) {
|
||||
JsonObject root = new JsonObject();
|
||||
root.addProperty("replace", false);
|
||||
|
||||
JsonArray values = new JsonArray();
|
||||
|
||||
// Optional Forge Tag
|
||||
JsonObject forgeTag = new JsonObject();
|
||||
forgeTag.addProperty("id", "#forge:is_snowy");
|
||||
forgeTag.addProperty("required", false);
|
||||
values.add(forgeTag);
|
||||
|
||||
// Optional Fabric Tag
|
||||
JsonObject fabricTag = new JsonObject();
|
||||
fabricTag.addProperty("id", "#c:snowy");
|
||||
fabricTag.addProperty("required", false);
|
||||
values.add(fabricTag);
|
||||
|
||||
// Vanilla Fallbacks
|
||||
values.add("minecraft:snowy_plains");
|
||||
values.add("minecraft:ice_spikes");
|
||||
values.add("minecraft:snowy_taiga");
|
||||
values.add("minecraft:snowy_beach");
|
||||
values.add("minecraft:grove");
|
||||
values.add("minecraft:snowy_slopes");
|
||||
values.add("minecraft:jagged_peaks");
|
||||
values.add("minecraft:frozen_peaks");
|
||||
|
||||
root.add("values", values);
|
||||
|
||||
Path path = output.getOutputFolder()
|
||||
.resolve("data/" + Constants.MOD_ID + "/tags/worldgen/biome/is_snowy.json");
|
||||
|
||||
return DataProvider.saveStable(cachedOutput, root, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Jurassic Revived Worldgen";
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class AlbertosaurusRenderer extends GeoEntityRenderer<AlbertosaurusEntity> {
|
||||
private final float animalScale = 1.7F;
|
||||
public AlbertosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new AlbertosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, AlbertosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public class AllosaurusModel extends GeoModel<AllosaurusEntity> {
|
||||
map.put(AllosaurusVariant.FEMALE, Constants.rl("textures/entity/allosaurus_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation AL_LOCATION =
|
||||
Constants.rl("textures/entity/allosaurus_al.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +39,10 @@ public class AllosaurusModel extends GeoModel<AllosaurusEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(AllosaurusEntity animatable) {
|
||||
if (animatable.hasCustomName() && "al".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return AL_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class AllosaurusRenderer extends GeoEntityRenderer<AllosaurusEntity> {
|
||||
private final float animalScale = 1.9F;
|
||||
public AllosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new AllosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, AllosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class AlvarezsaurusRenderer extends GeoEntityRenderer<AlvarezsaurusEntity> {
|
||||
private final float animalScale = 0.8F;
|
||||
public AlvarezsaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new AlvarezsaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, AlvarezsaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public class AnkylosaurusModel extends GeoModel<AnkylosaurusEntity> {
|
||||
map.put(AnkylosaurusVariant.FEMALE, Constants.rl("textures/entity/ankylosaurus_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation BUMPY_LOCATION =
|
||||
Constants.rl("textures/entity/ankylosaurus_bumpy.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +39,10 @@ public class AnkylosaurusModel extends GeoModel<AnkylosaurusEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(AnkylosaurusEntity animatable) {
|
||||
if (animatable.hasCustomName() && "bumpy".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return BUMPY_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class AnkylosaurusRenderer extends GeoEntityRenderer<AnkylosaurusEntity> {
|
||||
private final float animalScale = 2.4F;
|
||||
public AnkylosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new AnkylosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, AnkylosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ApatosaurusRenderer extends GeoEntityRenderer<ApatosaurusEntity> {
|
||||
private final float animalScale = 1.9F;
|
||||
public ApatosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ApatosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ApatosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ArambourgianiaRenderer extends GeoEntityRenderer<ArambourgianiaEntity> {
|
||||
private final float animalScale = 1.9F;
|
||||
public ArambourgianiaRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ArambourgianiaModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ArambourgianiaEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class BaryonyxRenderer extends GeoEntityRenderer<BaryonyxEntity> {
|
||||
private final float animalScale = 1.3F;
|
||||
public BaryonyxRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new BaryonyxModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, BaryonyxEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class BrachiosaurusRenderer extends GeoEntityRenderer<BrachiosaurusEntity> {
|
||||
private final float animalScale = 2.0F;
|
||||
public BrachiosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new BrachiosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, BrachiosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CarcharodontosaurusRenderer extends GeoEntityRenderer<CarcharodontosaurusEntity> {
|
||||
private final float animalScale = 2.0F;
|
||||
public CarcharodontosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CarcharodontosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CarcharodontosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CarnotaurusRenderer extends GeoEntityRenderer<CarnotaurusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public CarnotaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CarnotaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CarnotaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CearadactylusRenderer extends GeoEntityRenderer<CearadactylusEntity> {
|
||||
private final float animalScale = 0.9F;
|
||||
public CearadactylusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CearadactylusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CearadactylusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CeratosaurusRenderer extends GeoEntityRenderer<CeratosaurusEntity> {
|
||||
private final float animalScale = 2.1F;
|
||||
public CeratosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CeratosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CeratosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ChasmosaurusRenderer extends GeoEntityRenderer<ChasmosaurusEntity> {
|
||||
private final float animalScale = 1.3F;
|
||||
public ChasmosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ChasmosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ChasmosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ChickenosaurusRenderer extends GeoEntityRenderer<ChickenosaurusEntity> {
|
||||
private final float animalScale = 0.9F;
|
||||
public ChickenosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ChickenosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ChickenosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ChilesaurusRenderer extends GeoEntityRenderer<ChilesaurusEntity> {
|
||||
private final float animalScale = 0.6F;
|
||||
public ChilesaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ChilesaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ChilesaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CoelophysisRenderer extends GeoEntityRenderer<CoelophysisEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public CoelophysisRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CoelophysisModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CoelophysisEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CoelurusRenderer extends GeoEntityRenderer<CoelurusEntity> {
|
||||
private final float animalScale = 0.5F;
|
||||
public CoelurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CoelurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CoelurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CompsognathusRenderer extends GeoEntityRenderer<CompsognathusEntity> {
|
||||
private final float animalScale = 0.4F;
|
||||
public CompsognathusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CompsognathusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CompsognathusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ConcavenatorRenderer extends GeoEntityRenderer<ConcavenatorEntity> {
|
||||
private final float animalScale = 0.9F;
|
||||
public ConcavenatorRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ConcavenatorModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ConcavenatorEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class CorythosaurusRenderer extends GeoEntityRenderer<CorythosaurusEntity> {
|
||||
private final float animalScale = 1.7F;
|
||||
public CorythosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new CorythosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, CorythosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DeinonychusRenderer extends GeoEntityRenderer<DeinonychusEntity> {
|
||||
private final float animalScale = 0.9F;
|
||||
public DeinonychusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DeinonychusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DeinonychusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public class DilophosaurusModel extends GeoModel<DilophosaurusEntity> {
|
||||
map.put(DilophosaurusVariant.FEMALE, Constants.rl("textures/entity/dilophosaurus_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation INFERNO_LOCATION =
|
||||
Constants.rl("textures/entity/dilophosaurus_inferno.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +39,10 @@ public class DilophosaurusModel extends GeoModel<DilophosaurusEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(DilophosaurusEntity animatable) {
|
||||
if (animatable.hasCustomName() && "inferno".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return INFERNO_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DilophosaurusRenderer extends GeoEntityRenderer<DilophosaurusEntity> {
|
||||
private final float animalScale = 1.2F;
|
||||
public DilophosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DilophosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DilophosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DimorphodonRenderer extends GeoEntityRenderer<DimorphodonEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public DimorphodonRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DimorphodonModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DimorphodonEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DiplodocusRenderer extends GeoEntityRenderer<DiplodocusEntity> {
|
||||
private final float animalScale = 2.8F;
|
||||
public DiplodocusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DiplodocusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DiplodocusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DistortusRexRenderer extends GeoEntityRenderer<DistortusRexEntity> {
|
||||
private final float animalScale = 3.4F;
|
||||
public DistortusRexRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DistortusRexModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DistortusRexEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class DryosaurusRenderer extends GeoEntityRenderer<DryosaurusEntity> {
|
||||
private final float animalScale = 0.45F;
|
||||
public DryosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new DryosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, DryosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class EdmontosaurusRenderer extends GeoEntityRenderer<EdmontosaurusEntity> {
|
||||
private final float animalScale = 1.8F;
|
||||
public EdmontosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new EdmontosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, EdmontosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class FDuckRenderer extends GeoEntityRenderer<FDuckEntity> {
|
||||
private final float animalScale = 1.4F;
|
||||
public FDuckRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new FDuckModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, FDuckEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class GallimimusRenderer extends GeoEntityRenderer<GallimimusEntity> {
|
||||
private final float animalScale = 1.0F;
|
||||
public GallimimusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new GallimimusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, GallimimusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class GeosternbergiaRenderer extends GeoEntityRenderer<GeosternbergiaEntity> {
|
||||
private final float animalScale = 1.4F;
|
||||
public GeosternbergiaRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new GeosternbergiaModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, GeosternbergiaEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class GiganotosaurusRenderer extends GeoEntityRenderer<GiganotosaurusEntity> {
|
||||
private final float animalScale = 2.2F;
|
||||
public GiganotosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new GiganotosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, GiganotosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class GuanlongRenderer extends GeoEntityRenderer<GuanlongEntity> {
|
||||
private final float animalScale = 0.6F;
|
||||
public GuanlongRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new GuanlongModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, GuanlongEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class GuidracoRenderer extends GeoEntityRenderer<GuidracoEntity> {
|
||||
private final float animalScale = 0.8F;
|
||||
public GuidracoRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new GuidracoModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, GuidracoEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class HadrosaurusRenderer extends GeoEntityRenderer<HadrosaurusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public HadrosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new HadrosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, HadrosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class HerrerasaurusRenderer extends GeoEntityRenderer<HerrerasaurusEntity> {
|
||||
private final float animalScale = 1.3F;
|
||||
public HerrerasaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new HerrerasaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, HerrerasaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class HypsilophodonRenderer extends GeoEntityRenderer<HypsilophodonEntity> {
|
||||
private final float animalScale = 0.5F;
|
||||
public HypsilophodonRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new HypsilophodonModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, HypsilophodonEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class IndominusRexRenderer extends GeoEntityRenderer<IndominusRexEntity> {
|
||||
private final float animalScale = 3.0F;
|
||||
public IndominusRexRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new IndominusRexModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, IndominusRexEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class IndoraptorRenderer extends GeoEntityRenderer<IndoraptorEntity> {
|
||||
private final float animalScale = 1.8F;
|
||||
public IndoraptorRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new IndoraptorModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, IndoraptorEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class InostranceviaRenderer extends GeoEntityRenderer<InostranceviaEntity> {
|
||||
private final float animalScale = 1.1F;
|
||||
public InostranceviaRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new InostranceviaModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, InostranceviaEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class LambeosaurusRenderer extends GeoEntityRenderer<LambeosaurusEntity> {
|
||||
private final float animalScale = 1.8F;
|
||||
public LambeosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new LambeosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, LambeosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public class LudodactylusModel extends GeoModel<LudodactylusEntity> {
|
||||
map.put(LudodactylusVariant.FEMALE, Constants.rl("textures/entity/ludodactylus_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation PINWIN_LOCATION =
|
||||
Constants.rl("textures/entity/ludodactylus_pinwin.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +39,10 @@ public class LudodactylusModel extends GeoModel<LudodactylusEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(LudodactylusEntity animatable) {
|
||||
if (animatable.hasCustomName() && "pinwin".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return PINWIN_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class LudodactylusRenderer extends GeoEntityRenderer<LudodactylusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public LudodactylusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new LudodactylusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, LudodactylusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class MajungasaurusRenderer extends GeoEntityRenderer<MajungasaurusEntity> {
|
||||
private final float animalScale = 1.4F;
|
||||
public MajungasaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new MajungasaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, MajungasaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class MamenchisaurusRenderer extends GeoEntityRenderer<MamenchisaurusEntity> {
|
||||
private final float animalScale = 1.7F;
|
||||
public MamenchisaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new MamenchisaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, MamenchisaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class MetriacanthosaurusRenderer extends GeoEntityRenderer<MetriacanthosaurusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public MetriacanthosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new MetriacanthosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, MetriacanthosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class MoganopterusRenderer extends GeoEntityRenderer<MoganopterusEntity> {
|
||||
private final float animalScale = 0.8F;
|
||||
public MoganopterusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new MoganopterusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, MoganopterusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class MussasaurusRenderer extends GeoEntityRenderer<MussasaurusEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public MussasaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new MussasaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, MussasaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class NyctosaurusRenderer extends GeoEntityRenderer<NyctosaurusEntity> {
|
||||
private final float animalScale = 0.3F;
|
||||
public NyctosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new NyctosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, NyctosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class OrnitholestesRenderer extends GeoEntityRenderer<OrnitholestesEntity> {
|
||||
private final float animalScale = 0.6F;
|
||||
public OrnitholestesRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new OrnitholestesModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, OrnitholestesEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class OrnithomimusRenderer extends GeoEntityRenderer<OrnithomimusEntity> {
|
||||
private final float animalScale = 0.8F;
|
||||
public OrnithomimusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new OrnithomimusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, OrnithomimusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class OuranosaurusRenderer extends GeoEntityRenderer<OuranosaurusEntity> {
|
||||
private final float animalScale = 1.2F;
|
||||
public OuranosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new OuranosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, OuranosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class OviraptorRenderer extends GeoEntityRenderer<OviraptorEntity> {
|
||||
private final float animalScale = 0.55F;
|
||||
public OviraptorRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new OviraptorModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, OviraptorEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class PachycephalosaurusRenderer extends GeoEntityRenderer<PachycephalosaurusEntity> {
|
||||
private final float animalScale = 0.8F;
|
||||
public PachycephalosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new PachycephalosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, PachycephalosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ParasaurolophusRenderer extends GeoEntityRenderer<ParasaurolophusEntity> {
|
||||
private final float animalScale = 1.7F;
|
||||
public ParasaurolophusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ParasaurolophusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ParasaurolophusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ProceratosaurusRenderer extends GeoEntityRenderer<ProceratosaurusEntity> {
|
||||
private final float animalScale = 0.6F;
|
||||
public ProceratosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ProceratosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ProceratosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ProcompsognathusRenderer extends GeoEntityRenderer<ProcompsognathusEntity> {
|
||||
private final float animalScale = 0.2F;
|
||||
public ProcompsognathusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ProcompsognathusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ProcompsognathusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ProtoceratopsRenderer extends GeoEntityRenderer<ProtoceratopsEntity> {
|
||||
private final float animalScale = 1.2F;
|
||||
public ProtoceratopsRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ProtoceratopsModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ProtoceratopsEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class PteranodonRenderer extends GeoEntityRenderer<PteranodonEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public PteranodonRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new PteranodonModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, PteranodonEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class PterodaustroRenderer extends GeoEntityRenderer<PterodaustroEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public PterodaustroRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new PterodaustroModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, PterodaustroEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class QuetzalcoatlusRenderer extends GeoEntityRenderer<QuetzalcoatlusEntity> {
|
||||
private final float animalScale = 2.0F;
|
||||
public QuetzalcoatlusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new QuetzalcoatlusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, QuetzalcoatlusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class RajasaurusRenderer extends GeoEntityRenderer<RajasaurusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public RajasaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new RajasaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, RajasaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class RugopsRenderer extends GeoEntityRenderer<RugopsEntity> {
|
||||
private final float animalScale = 0.9F;
|
||||
public RugopsRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new RugopsModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, RugopsEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class SegisaurusRenderer extends GeoEntityRenderer<SegisaurusEntity> {
|
||||
private final float animalScale = 0.62F;
|
||||
public SegisaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new SegisaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, SegisaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ShantungosaurusRenderer extends GeoEntityRenderer<ShantungosaurusEntity> {
|
||||
private final float animalScale = 1.8F;
|
||||
public ShantungosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ShantungosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ShantungosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class SpinosaurusRenderer extends GeoEntityRenderer<SpinosaurusEntity> {
|
||||
private final float animalScale = 2.2F;
|
||||
public SpinosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new SpinosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, SpinosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class StegosaurusRenderer extends GeoEntityRenderer<StegosaurusEntity> {
|
||||
private final float animalScale = 1.8F;
|
||||
public StegosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new StegosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, StegosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class StyracosaurusRenderer extends GeoEntityRenderer<StyracosaurusEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public StyracosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new StyracosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, StyracosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class SuchomimusRenderer extends GeoEntityRenderer<SuchomimusEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public SuchomimusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new SuchomimusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, SuchomimusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TapejaraRenderer extends GeoEntityRenderer<TapejaraEntity> {
|
||||
private final float animalScale = 0.6F;
|
||||
public TapejaraRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TapejaraModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TapejaraEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TherizinosaurusRenderer extends GeoEntityRenderer<TherizinosaurusEntity> {
|
||||
private final float animalScale = 1.9F;
|
||||
public TherizinosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TherizinosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TherizinosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ThescelosaurusRenderer extends GeoEntityRenderer<ThescelosaurusEntity> {
|
||||
private final float animalScale = 0.7F;
|
||||
public ThescelosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ThescelosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ThescelosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TitanosaurusRenderer extends GeoEntityRenderer<TitanosaurusEntity> {
|
||||
private final float animalScale = 2.3F;
|
||||
public TitanosaurusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TitanosaurusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TitanosaurusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TriceratopsRenderer extends GeoEntityRenderer<TriceratopsEntity> {
|
||||
private final float animalScale = 1.5F;
|
||||
public TriceratopsRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TriceratopsModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TriceratopsEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TroodonRenderer extends GeoEntityRenderer<TroodonEntity> {
|
||||
private final float animalScale = 0.3F;
|
||||
public TroodonRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TroodonModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TroodonEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TropeognathusRenderer extends GeoEntityRenderer<TropeognathusEntity> {
|
||||
private final float animalScale = 1.4F;
|
||||
public TropeognathusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TropeognathusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TropeognathusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TupuxuaraRenderer extends GeoEntityRenderer<TupuxuaraEntity> {
|
||||
private final float animalScale = 1.0F;
|
||||
public TupuxuaraRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TupuxuaraModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TupuxuaraEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,12 @@ public class TyrannosaurusRexModel extends GeoModel<TyrannosaurusRexEntity> {
|
||||
map.put(TyrannosaurusRexVariant.FEMALE, Constants.rl("textures/entity/tyrannosaurus_rex_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation DRGRAY_LOCATION =
|
||||
Constants.rl("textures/entity/tyrannosaurus_rex_drgray.png");
|
||||
|
||||
private static final ResourceLocation EMBER_LOCATION =
|
||||
Constants.rl("textures/entity/tyrannosaurus_rex_ember.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +42,14 @@ public class TyrannosaurusRexModel extends GeoModel<TyrannosaurusRexEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(TyrannosaurusRexEntity animatable) {
|
||||
if (animatable.hasCustomName() && "drgray".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return DRGRAY_LOCATION;
|
||||
}
|
||||
|
||||
if (animatable.hasCustomName() && "ember".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return EMBER_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class TyrannosaurusRexRenderer extends GeoEntityRenderer<TyrannosaurusRexEntity> {
|
||||
private final float animalScale = 2.5F;
|
||||
public TyrannosaurusRexRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new TyrannosaurusRexModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, TyrannosaurusRexEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class UtahraptorRenderer extends GeoEntityRenderer<UtahraptorEntity> {
|
||||
private final float animalScale = 1.0F;
|
||||
public UtahraptorRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new UtahraptorModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, UtahraptorEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,18 @@ public class VelociraptorModel extends GeoModel<VelociraptorEntity> {
|
||||
map.put(VelociraptorVariant.FEMALE, Constants.rl("textures/entity/velociraptor_female.png"));
|
||||
});
|
||||
|
||||
private static final ResourceLocation BLUE_LOCATION =
|
||||
Constants.rl("textures/entity/velociraptor_blue.png");
|
||||
|
||||
private static final ResourceLocation CHARLIE_LOCATION =
|
||||
Constants.rl("textures/entity/velociraptor_charlie.png");
|
||||
|
||||
private static final ResourceLocation DELTA_LOCATION =
|
||||
Constants.rl("textures/entity/velociraptor_delta.png");
|
||||
|
||||
private static final ResourceLocation ECHO_LOCATION =
|
||||
Constants.rl("textures/entity/velociraptor_echo.png");
|
||||
|
||||
// Model-local "currently applied" offsets; cleared before each entity render
|
||||
private float[] appliedYaw = null;
|
||||
private float[] appliedRoll = null;
|
||||
@@ -36,6 +48,19 @@ public class VelociraptorModel extends GeoModel<VelociraptorEntity> {
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureResource(VelociraptorEntity animatable) {
|
||||
if (animatable.hasCustomName() && "blue".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return BLUE_LOCATION;
|
||||
}
|
||||
if (animatable.hasCustomName() && "charlie".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return CHARLIE_LOCATION;
|
||||
}
|
||||
if (animatable.hasCustomName() && "delta".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return DELTA_LOCATION;
|
||||
}
|
||||
if (animatable.hasCustomName() && "echo".equalsIgnoreCase(animatable.getName().getString())) {
|
||||
return ECHO_LOCATION;
|
||||
}
|
||||
|
||||
return LOCATION_BY_VARIANT.get(animatable.getVariant());
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class VelociraptorRenderer extends GeoEntityRenderer<VelociraptorEntity> {
|
||||
private final float animalScale = 1.0F;
|
||||
public VelociraptorRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new VelociraptorModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, VelociraptorEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -9,18 +9,13 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||
|
||||
|
||||
public class ZhenyuanopterusRenderer extends GeoEntityRenderer<ZhenyuanopterusEntity> {
|
||||
private final float animalScale = 1.1F;
|
||||
public ZhenyuanopterusRenderer(EntityRendererProvider.Context renderManager) {
|
||||
super(renderManager, new ZhenyuanopterusModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scaleModelForRender(float widthScale, float heightScale, PoseStack poseStack, ZhenyuanopterusEntity animatable, BakedGeoModel model, boolean isReRender, float partialTick, int packedLight, int packedOverlay) {
|
||||
poseStack.scale(animalScale, animalScale, animalScale);
|
||||
if(animatable.isBaby()) {
|
||||
float growthProgress = Mth.clamp((24000.0F + animatable.getSyncedAge()) / 24000.0F, 0.0F, 1.0F);
|
||||
float scale = Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
float scale = animatable.getTotalModelScale();
|
||||
poseStack.scale(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ import software.bernie.geckolib.animation.*;
|
||||
public class AchillobatorEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 240;
|
||||
private static final float MIN_ANIMAL_SCALE = 0.92F;
|
||||
private static final float MAX_ANIMAL_SCALE = 1.08F;
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 28800;
|
||||
private static final float MIN_ANIMAL_SCALE = 0.8F;
|
||||
private static final float MAX_ANIMAL_SCALE = 1.2F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
|
||||
+65
-4
@@ -47,10 +47,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 67200;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.5F;
|
||||
private static final float MAX_ANIMAL_SCALE = 1.9F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(AlbertosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(AlbertosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(AlbertosaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -103,6 +111,10 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 55D)
|
||||
@@ -121,6 +133,7 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof AlbertosaurusEntity baby) {
|
||||
AlbertosaurusVariant randomVariant = Util.getRandom(AlbertosaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -179,6 +192,8 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -244,6 +259,7 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -251,6 +267,7 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
@@ -258,6 +275,48 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -280,12 +339,16 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -293,15 +356,13 @@ public class AlbertosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
AlbertosaurusVariant variant = Util.getRandom(AlbertosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
AlbertosaurusVariant variant = Util.getRandom(AlbertosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
AlbertosaurusVariant variant = Util.getRandom(AlbertosaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,10 +50,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 52800;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.7F;
|
||||
private static final float MAX_ANIMAL_SCALE = 2.1F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(AllosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(AllosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(AllosaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -106,6 +114,10 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 65D)
|
||||
@@ -124,6 +136,7 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof AllosaurusEntity baby) {
|
||||
AllosaurusVariant randomVariant = Util.getRandom(AllosaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -182,6 +195,8 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -247,6 +262,7 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -254,12 +270,55 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -282,12 +341,16 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -295,15 +358,13 @@ public class AllosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
AllosaurusVariant variant = Util.getRandom(AllosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
AllosaurusVariant variant = Util.getRandom(AllosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
AllosaurusVariant variant = Util.getRandom(AllosaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
+65
-4
@@ -54,10 +54,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 19200;
|
||||
private static final float MIN_ANIMAL_SCALE = 0.6F;
|
||||
private static final float MAX_ANIMAL_SCALE = 1.0F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(AlvarezsaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(AlvarezsaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(AlvarezsaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -111,6 +119,10 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 5D)
|
||||
@@ -130,6 +142,7 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof AlvarezsaurusEntity baby) {
|
||||
AlvarezsaurusVariant randomVariant = Util.getRandom(AlvarezsaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -186,6 +199,8 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -251,6 +266,7 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -258,12 +274,55 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -286,12 +345,16 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -299,15 +362,13 @@ public class AlvarezsaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
AlvarezsaurusVariant variant = Util.getRandom(AlvarezsaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
AlvarezsaurusVariant variant = Util.getRandom(AlvarezsaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
AlvarezsaurusVariant variant = Util.getRandom(AlvarezsaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,10 +53,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 86400;
|
||||
private static final float MIN_ANIMAL_SCALE = 2.2F;
|
||||
private static final float MAX_ANIMAL_SCALE = 2.6F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(AnkylosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(AnkylosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(AnkylosaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -110,6 +118,10 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 75D)
|
||||
@@ -129,6 +141,7 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof AnkylosaurusEntity baby) {
|
||||
AnkylosaurusVariant randomVariant = Util.getRandom(AnkylosaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -185,6 +198,8 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -250,6 +265,7 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -257,12 +273,55 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -285,12 +344,16 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -298,15 +361,13 @@ public class AnkylosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
AnkylosaurusVariant variant = Util.getRandom(AnkylosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
AnkylosaurusVariant variant = Util.getRandom(AnkylosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
AnkylosaurusVariant variant = Util.getRandom(AnkylosaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,10 +55,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 110400;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.7F;
|
||||
private static final float MAX_ANIMAL_SCALE = 2.1F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(ApatosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(ApatosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(ApatosaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -112,6 +120,10 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 150D)
|
||||
@@ -131,6 +143,7 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof ApatosaurusEntity baby) {
|
||||
ApatosaurusVariant randomVariant = Util.getRandom(ApatosaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -189,6 +202,8 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -254,6 +269,7 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -261,12 +277,55 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -289,12 +348,16 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -302,15 +365,13 @@ public class ApatosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
ApatosaurusVariant variant = Util.getRandom(ApatosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
ApatosaurusVariant variant = Util.getRandom(ApatosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
ApatosaurusVariant variant = Util.getRandom(ApatosaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
+65
-4
@@ -63,10 +63,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, FlyingAnimal {
|
||||
private final AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 43200;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.7F;
|
||||
private static final float MAX_ANIMAL_SCALE = 2.1F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(ArambourgianiaEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(ArambourgianiaEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(ArambourgianiaEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -121,6 +129,10 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 100D)
|
||||
@@ -164,6 +176,7 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
if (child instanceof ArambourgianiaEntity baby) {
|
||||
ArambourgianiaVariant randomVariant = Util.getRandom(ArambourgianiaVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -225,6 +238,8 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -290,6 +305,7 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -297,6 +313,7 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
@@ -304,6 +321,48 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public ArambourgianiaVariant getVariant() {
|
||||
return ArambourgianiaVariant.byId(this.getTypeVariant() & 255);
|
||||
}
|
||||
@@ -327,27 +386,29 @@ public class ArambourgianiaEntity extends DinoEntityBase implements GeoEntity, F
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
ArambourgianiaVariant variant = Util.getRandom(ArambourgianiaVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
ArambourgianiaVariant variant = Util.getRandom(ArambourgianiaVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
ArambourgianiaVariant variant = Util.getRandom(ArambourgianiaVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,10 +54,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 52800;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.1F;
|
||||
private static final float MAX_ANIMAL_SCALE = 1.5F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(BaryonyxEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(BaryonyxEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(BaryonyxEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -111,6 +119,10 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 55D)
|
||||
@@ -130,6 +142,7 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof BaryonyxEntity baby) {
|
||||
BaryonyxVariant randomVariant = Util.getRandom(BaryonyxVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -188,6 +201,8 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -253,6 +268,7 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -260,12 +276,55 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -288,12 +347,16 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -301,15 +364,13 @@ public class BaryonyxEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
BaryonyxVariant variant = Util.getRandom(BaryonyxVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
BaryonyxVariant variant = Util.getRandom(BaryonyxVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
BaryonyxVariant variant = Util.getRandom(BaryonyxVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
+65
-4
@@ -55,10 +55,18 @@ import software.bernie.geckolib.animation.*;
|
||||
public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
|
||||
|
||||
public static final int BABY_TO_ADULT_AGE_TICKS = 134400;
|
||||
private static final float MIN_ANIMAL_SCALE = 1.8F;
|
||||
private static final float MAX_ANIMAL_SCALE = 2.2F;
|
||||
|
||||
private float lastDimensionsScale = 1.0F;
|
||||
|
||||
private static final EntityDataAccessor<Integer> VARIANT =
|
||||
SynchedEntityData.defineId(BrachiosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Integer> DATA_SYNCED_AGE =
|
||||
SynchedEntityData.defineId(BrachiosaurusEntity.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Float> DATA_ANIMAL_SCALE =
|
||||
SynchedEntityData.defineId(BrachiosaurusEntity.class, EntityDataSerializers.FLOAT);
|
||||
|
||||
// Procedural tail sway state (client-side use for rendering)
|
||||
private float tailSwayOffset; // Smoothed offset in range roughly [-1, 1]
|
||||
@@ -112,6 +120,10 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
return new DinoAIConfig(0.3D, 1.1D, 1.5D, 100, 100, 0.05f, 0.1f, 20);
|
||||
}
|
||||
|
||||
public void setBaby(boolean baby) {
|
||||
this.setAge(baby ? -BABY_TO_ADULT_AGE_TICKS : 0);
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Animal.createLivingAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 200D)
|
||||
@@ -131,6 +143,7 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
if (child instanceof BrachiosaurusEntity baby) {
|
||||
BrachiosaurusVariant randomVariant = Util.getRandom(BrachiosaurusVariant.values(), this.random);
|
||||
baby.setVariant(randomVariant);
|
||||
baby.setBaby(true);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
@@ -189,6 +202,8 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
}
|
||||
}
|
||||
|
||||
updateDynamicDimensions();
|
||||
|
||||
if (!level().isClientSide) {
|
||||
if (mouthAnimCooldown > 0) {
|
||||
mouthAnimCooldown--;
|
||||
@@ -254,6 +269,7 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData();
|
||||
this.entityData.define(VARIANT, 0);
|
||||
this.entityData.define(DATA_SYNCED_AGE, 0);
|
||||
this.entityData.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
@@ -261,12 +277,55 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
super.defineSynchedData(pBuilder);
|
||||
pBuilder.define(VARIANT, 0);
|
||||
pBuilder.define(DATA_SYNCED_AGE, 0);
|
||||
pBuilder.define(DATA_ANIMAL_SCALE, 1.0F);
|
||||
}
|
||||
*//*?}*/
|
||||
|
||||
public int getSyncedAge() {
|
||||
return this.entityData.get(DATA_SYNCED_AGE);
|
||||
}
|
||||
|
||||
public float getAnimalScale() {
|
||||
return this.entityData.get(DATA_ANIMAL_SCALE);
|
||||
}
|
||||
|
||||
private void setAnimalScale(float animalScale) {
|
||||
this.entityData.set(DATA_ANIMAL_SCALE, animalScale);
|
||||
}
|
||||
|
||||
public float getGrowthScale() {
|
||||
if (!this.isBaby()) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
int age = this.level().isClientSide ? this.getSyncedAge() : this.getAge();
|
||||
float growthProgress = Mth.clamp((BABY_TO_ADULT_AGE_TICKS + age) / (float) BABY_TO_ADULT_AGE_TICKS, 0.0F, 1.0F);
|
||||
return Mth.lerp(growthProgress, 0.2F, 1.0F);
|
||||
}
|
||||
|
||||
public float getTotalModelScale() {
|
||||
return this.getAnimalScale() * this.getGrowthScale();
|
||||
}
|
||||
|
||||
private void updateDynamicDimensions() {
|
||||
float dimensionsScale = this.getTotalModelScale();
|
||||
if (Math.abs(dimensionsScale - this.lastDimensionsScale) > 0.01F) {
|
||||
this.lastDimensionsScale = dimensionsScale;
|
||||
this.refreshDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
protected EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.getType().getDimensions().scale(this.getTotalModelScale());
|
||||
}
|
||||
*//*?}*/
|
||||
public int getTypeVariant() {
|
||||
return this.entityData.get(VARIANT);
|
||||
}
|
||||
@@ -289,12 +348,16 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public void addAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.addAdditionalSaveData(pCompound);
|
||||
pCompound.putInt("Variant", this.getTypeVariant());
|
||||
pCompound.putFloat("AnimalScale", this.getAnimalScale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag pCompound) {
|
||||
super.readAdditionalSaveData(pCompound);
|
||||
this.entityData.set(VARIANT, pCompound.getInt("Variant"));
|
||||
if (pCompound.contains("AnimalScale")) {
|
||||
this.setAnimalScale(pCompound.getFloat("AnimalScale"));
|
||||
}
|
||||
}
|
||||
|
||||
/*? if <=1.20.1 {*/
|
||||
@@ -302,15 +365,13 @@ public class BrachiosaurusEntity extends DinoEntityBase implements GeoEntity {
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
|
||||
BrachiosaurusVariant variant = Util.getRandom(BrachiosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE));
|
||||
return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
|
||||
}
|
||||
/*?} else {*/
|
||||
/*@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, @Nullable SpawnGroupData spawnGroupData) {
|
||||
BrachiosaurusVariant variant = Util.getRandom(BrachiosaurusVariant.values(), this.random);
|
||||
this.setVariant(variant);
|
||||
return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);
|
||||
}
|
||||
BrachiosaurusVariant variant = Util.getRandom(BrachiosaurusVariant.values(), this.random); this.setVariant(variant); this.setAnimalScale(Mth.nextFloat(this.random, MIN_ANIMAL_SCALE, MAX_ANIMAL_SCALE)); return super.finalizeSpawn(level, difficulty, spawnType, spawnGroupData);}
|
||||
*//*?}*/
|
||||
|
||||
@Override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user