Skip to content

Commit

Permalink
0.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
IAFEnvoy committed Jan 1, 2025
1 parent a95e37e commit eac42c3
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ public class EntityFireDragon extends EntityDragonBase {
public static final Identifier MALE_LOOT = Identifier.of(IceAndFire.MOD_ID, "entities/dragon/fire_dragon_male");
public static final Identifier SKELETON_LOOT = Identifier.of(IceAndFire.MOD_ID, "entities/dragon/fire_dragon_skeleton");

public EntityFireDragon(World worldIn) {
this(IafEntities.FIRE_DRAGON.get(), worldIn);
}

public EntityFireDragon(EntityType<?> t, World worldIn) {
public EntityFireDragon(EntityType<? extends EntityFireDragon> t, World worldIn) {
super(t, worldIn, DragonType.FIRE, 1, 1 + IafCommonConfig.INSTANCE.dragon.attackDamage.getValue(), IafCommonConfig.INSTANCE.dragon.maxHealth.getValue() * 0.04, IafCommonConfig.INSTANCE.dragon.maxHealth.getValue(), 0.15F, 0.4F);
this.setPathfindingPenalty(PathNodeType.DAMAGE_FIRE, 0.0F);
this.setPathfindingPenalty(PathNodeType.LAVA, 8.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ public class EntityIceDragon extends EntityDragonBase {
public static final Identifier MALE_LOOT = Identifier.of(IceAndFire.MOD_ID, "entities/dragon/ice_dragon_male");
public static final Identifier SKELETON_LOOT = Identifier.of(IceAndFire.MOD_ID, "entities/dragon/ice_dragon_skeleton");

public EntityIceDragon(World worldIn) {
this(IafEntities.ICE_DRAGON.get(), worldIn);
}

public EntityIceDragon(EntityType<?> t, World worldIn) {
public EntityIceDragon(EntityType<? extends EntityIceDragon> t, World worldIn) {
super(t, worldIn, DragonType.ICE, 1, 1 + IafCommonConfig.INSTANCE.dragon.attackDamage.getValue(), IafCommonConfig.INSTANCE.dragon.maxHealth.getValue() * 0.04, IafCommonConfig.INSTANCE.dragon.maxHealth.getValue(), 0.15F, 0.4F);
ANIMATION_SPEAK = Animation.create(20);
ANIMATION_BITE = Animation.create(35);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ public class EntityLightningDragon extends EntityDragonBase {
private static final TrackedData<Float> LIGHTNING_TARGET_Y = DataTracker.registerData(EntityLightningDragon.class, TrackedDataHandlerRegistry.FLOAT);
private static final TrackedData<Float> LIGHTNING_TARGET_Z = DataTracker.registerData(EntityLightningDragon.class, TrackedDataHandlerRegistry.FLOAT);

public EntityLightningDragon(World worldIn) {
this(IafEntities.LIGHTNING_DRAGON.get(), worldIn);
}

public EntityLightningDragon(EntityType<?> t, World worldIn) {
public EntityLightningDragon(EntityType<? extends EntityLightningDragon> t, World worldIn) {
super(t, worldIn, DragonType.LIGHTNING, 1, 1 + IafCommonConfig.INSTANCE.dragon.attackDamage.getValue(), IafCommonConfig.INSTANCE.dragon.maxHealth.getValue() * 0.04, IafCommonConfig.INSTANCE.dragon.maxHealth.getValue(), 0.15F, 0.4F);
this.setPathfindingPenalty(PathNodeType.DANGER_FIRE, 0.0F);
this.setPathfindingPenalty(PathNodeType.LAVA, 8.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import net.minecraft.world.World;

public class EntityMobSkull extends AnimalEntity implements IBlacklistedFromStatues, IDeadMob {

private static final TrackedData<Float> SKULL_DIRECTION = DataTracker.registerData(EntityMobSkull.class, TrackedDataHandlerRegistry.FLOAT);
private static final TrackedData<Integer> SKULL_ENUM = DataTracker.registerData(EntityMobSkull.class, TrackedDataHandlerRegistry.INTEGER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static void tickEgg(World level, BlockPos pos, BlockState state, BlockEnt
entityEggInIce.age++;
if (entityEggInIce.age >= IafCommonConfig.INSTANCE.dragon.eggBornTime.getValue() && entityEggInIce.type != null && !entityEggInIce.spawned)
if (!level.isClient) {
EntityIceDragon dragon = new EntityIceDragon(level);
EntityIceDragon dragon = IafEntities.ICE_DRAGON.get().create(level);
assert dragon != null;
dragon.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5);
dragon.setVariant(entityEggInIce.type.name());
dragon.setGender(ThreadLocalRandom.current().nextBoolean());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.iafenvoy.iceandfire.render.model.animator.FireDragonTabulaModelAnimator;
import com.iafenvoy.iceandfire.render.model.animator.IceDragonTabulaModelAnimator;
import com.iafenvoy.iceandfire.render.model.animator.LightningTabulaDragonAnimator;
import com.iafenvoy.iceandfire.render.model.animator.SeaSerpentTabulaModelAnimator;
import com.iafenvoy.uranus.client.model.util.TabulaModelHandlerHelper;
import com.iafenvoy.uranus.client.render.DynamicItemRenderer;
import com.iafenvoy.uranus.client.render.armor.IArmorRendererBase;
Expand All @@ -39,14 +38,14 @@ public final class IafRenderers {
public static final Identifier SEA_SERPENT = Identifier.of(IceAndFire.MOD_ID, "seaserpent/seaserpent_base");

public static void registerEntityRenderers() {
EntityRendererRegistry.register(IafEntities.FIRE_DRAGON, x -> new RenderDragonBase(x, TabulaModelHandlerHelper.getModel(FIRE_DRAGON, new MemorizeSupplier<>(FireDragonTabulaModelAnimator::new)), 0));
EntityRendererRegistry.register(IafEntities.ICE_DRAGON, manager -> new RenderDragonBase(manager, TabulaModelHandlerHelper.getModel(ICE_DRAGON, new MemorizeSupplier<>(IceDragonTabulaModelAnimator::new)), 1));
EntityRendererRegistry.register(IafEntities.FIRE_DRAGON, x -> new RenderDragonBase(x, TabulaModelHandlerHelper.getModel(FIRE_DRAGON, new MemorizeSupplier<>(FireDragonTabulaModelAnimator::new))));
EntityRendererRegistry.register(IafEntities.ICE_DRAGON, manager -> new RenderDragonBase(manager, TabulaModelHandlerHelper.getModel(ICE_DRAGON, new MemorizeSupplier<>(IceDragonTabulaModelAnimator::new))));
EntityRendererRegistry.register(IafEntities.LIGHTNING_DRAGON, manager -> new RenderLightningDragon(manager, TabulaModelHandlerHelper.getModel(LIGHTNING_DRAGON, new MemorizeSupplier<>(LightningTabulaDragonAnimator::new)), 2));
EntityRendererRegistry.register(IafEntities.DRAGON_EGG, RenderDragonEgg::new);
EntityRendererRegistry.register(IafEntities.DRAGON_ARROW, RenderDragonArrow::new);
EntityRendererRegistry.register(IafEntities.DRAGON_SKULL, RenderDragonSkull::new);
EntityRendererRegistry.register(IafEntities.FIRE_DRAGON_CHARGE, manager -> new RenderDragonFireCharge(manager, true));
EntityRendererRegistry.register(IafEntities.ICE_DRAGON_CHARGE, manager -> new RenderDragonFireCharge(manager, false));
EntityRendererRegistry.register(IafEntities.FIRE_DRAGON_CHARGE, manager -> new RenderDragonCharge(manager, true));
EntityRendererRegistry.register(IafEntities.ICE_DRAGON_CHARGE, manager -> new RenderDragonCharge(manager, false));
EntityRendererRegistry.register(IafEntities.LIGHTNING_DRAGON_CHARGE, RenderDragonLightningCharge::new);
EntityRendererRegistry.register(IafEntities.HIPPOGRYPH_EGG, FlyingItemEntityRenderer::new);
EntityRendererRegistry.register(IafEntities.HIPPOGRYPH, RenderHippogryph::new);
Expand All @@ -73,13 +72,13 @@ public static void registerEntityRenderers() {
EntityRendererRegistry.register(IafEntities.MYRMEX_SWARMER, manager -> new RenderMyrmexBase<>(manager, new ModelMyrmexRoyal(), 0.25F));
EntityRendererRegistry.register(IafEntities.AMPHITHERE, RenderAmphithere::new);
EntityRendererRegistry.register(IafEntities.AMPHITHERE_ARROW, RenderAmphithereArrow::new);
EntityRendererRegistry.register(IafEntities.SEA_SERPENT, manager -> new RenderSeaSerpent(manager, TabulaModelHandlerHelper.getModel(SEA_SERPENT, SeaSerpentTabulaModelAnimator::new)));
EntityRendererRegistry.register(IafEntities.SEA_SERPENT, RenderSeaSerpent::new);
EntityRendererRegistry.register(IafEntities.SEA_SERPENT_BUBBLES, RenderNothing::new);
EntityRendererRegistry.register(IafEntities.SEA_SERPENT_ARROW, RenderSeaSerpentArrow::new);
EntityRendererRegistry.register(IafEntities.CHAIN_TIE, RenderChainTie::new);
EntityRendererRegistry.register(IafEntities.PIXIE_CHARGE, RenderNothing::new);
EntityRendererRegistry.register(IafEntities.TIDE_TRIDENT, RenderTideTrident::new);
EntityRendererRegistry.register(IafEntities.MOB_SKULL, manager -> new RenderMobSkull(manager, TabulaModelHandlerHelper.getModel(SEA_SERPENT, SeaSerpentTabulaModelAnimator::new)));
EntityRendererRegistry.register(IafEntities.MOB_SKULL, RenderMobSkull::new);
EntityRendererRegistry.register(IafEntities.DREAD_SCUTTLER, RenderDreadScuttler::new);
EntityRendererRegistry.register(IafEntities.DREAD_GHOUL, RenderDreadGhoul::new);
EntityRendererRegistry.register(IafEntities.DREAD_BEAST, RenderDreadBeast::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import net.minecraft.util.math.RotationAxis;

public class RenderDragonBase extends MobEntityRenderer<EntityDragonBase, TabulaModel<EntityDragonBase>> {
public RenderDragonBase(EntityRendererFactory.Context context, TabulaModel<EntityDragonBase> model, int dragonType) {
public RenderDragonBase(EntityRendererFactory.Context context, TabulaModel<EntityDragonBase> model) {
super(context, model, 0.15F);
this.addFeature(new LayerDragonMaleOverlay(this));
this.addFeature(new LayerDragonEyes(this));
this.addFeature(new LayerDragonRider(this, false));
this.addFeature(new LayerDragonBanner(this));
this.addFeature(new LayerDragonArmor(this, dragonType));
this.addFeature(new LayerDragonArmor(this));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.RotationAxis;

public class RenderDragonFireCharge extends EntityRenderer<AbstractFireballEntity> {
public class RenderDragonCharge extends EntityRenderer<AbstractFireballEntity> {
public final boolean isFire;

public RenderDragonFireCharge(EntityRendererFactory.Context context, boolean isFire) {
public RenderDragonCharge(EntityRendererFactory.Context context, boolean isFire) {
super(context);
this.isFire = isFire;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RenderLightningDragon extends RenderDragonBase {
private final LightningRender lightningRender = new LightningRender();

public RenderLightningDragon(EntityRendererFactory.Context context, TabulaModel modelSupplier, int dragonType) {
super(context, modelSupplier, dragonType);
super(context, modelSupplier);
}

private static float getBoundedScale(float scale) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import com.iafenvoy.iceandfire.IceAndFire;
import com.iafenvoy.iceandfire.data.IafSkullType;
import com.iafenvoy.iceandfire.entity.EntityMobSkull;
import com.iafenvoy.iceandfire.entity.EntitySeaSerpent;
import com.iafenvoy.iceandfire.registry.IafRenderers;
import com.iafenvoy.iceandfire.render.model.*;
import com.iafenvoy.iceandfire.render.model.animator.SeaSerpentTabulaModelAnimator;
import com.iafenvoy.uranus.client.model.TabulaModel;
import com.iafenvoy.uranus.client.model.basic.BasicModelPart;
import com.iafenvoy.uranus.client.model.util.TabulaModelHandlerHelper;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
Expand All @@ -29,17 +33,17 @@ public class RenderMobSkull extends EntityRenderer<EntityMobSkull> {
private final ModelTroll trollModel;
private final ModelAmphithere amphithereModel;
private final ModelHydraHead hydraModel;
private final TabulaModel<EntityMobSkull> seaSerpentModel;
private final TabulaModel<EntitySeaSerpent> seaSerpentModel;

public RenderMobSkull(EntityRendererFactory.Context context, TabulaModel<EntityMobSkull> seaSerpentModel) {
public RenderMobSkull(EntityRendererFactory.Context context) {
super(context);
this.hippogryphModel = new ModelHippogryph();
this.cyclopsModel = new ModelCyclops();
this.cockatriceModel = new ModelCockatrice();
this.stymphalianBirdModel = new ModelStymphalianBird();
this.trollModel = new ModelTroll();
this.amphithereModel = new ModelAmphithere();
this.seaSerpentModel = seaSerpentModel;
this.seaSerpentModel = TabulaModelHandlerHelper.getModel(IafRenderers.SEA_SERPENT, SeaSerpentTabulaModelAnimator::new);
this.hydraModel = new ModelHydraHead(0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

import com.iafenvoy.iceandfire.data.SeaSerpent;
import com.iafenvoy.iceandfire.entity.EntitySeaSerpent;
import com.iafenvoy.iceandfire.registry.IafRenderers;
import com.iafenvoy.iceandfire.render.entity.layer.LayerSeaSerpentAncient;
import com.iafenvoy.iceandfire.render.model.animator.SeaSerpentTabulaModelAnimator;
import com.iafenvoy.uranus.client.model.AdvancedEntityModel;
import com.iafenvoy.uranus.client.model.util.TabulaModelHandlerHelper;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;

public class RenderSeaSerpent extends MobEntityRenderer<EntitySeaSerpent, AdvancedEntityModel<EntitySeaSerpent>> {
public RenderSeaSerpent(EntityRendererFactory.Context context, AdvancedEntityModel<EntitySeaSerpent> model) {
super(context, model, 1.6F);
public RenderSeaSerpent(EntityRendererFactory.Context context) {
super(context, TabulaModelHandlerHelper.getModel(IafRenderers.SEA_SERPENT, SeaSerpentTabulaModelAnimator::new), 1.6F);
this.features.add(new LayerSeaSerpentAncient(this));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class LayerDragonArmor extends FeatureRenderer<EntityDragonBase, TabulaModel<EntityDragonBase>> {
private static final List<EquipmentSlot> ARMOR_SLOTS = List.of(EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET);

public LayerDragonArmor(MobEntityRenderer<EntityDragonBase, TabulaModel<EntityDragonBase>> renderIn, int type) {
public LayerDragonArmor(MobEntityRenderer<EntityDragonBase, TabulaModel<EntityDragonBase>> renderIn) {
super(renderIn);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public class GorgonTempleStructure extends IafJigsawStructure {
public static final Codec<GorgonTempleStructure> CODEC = RecordCodecBuilder.<GorgonTempleStructure>mapCodec(instance ->
instance.group(configCodecBuilder(instance),
StructurePool.REGISTRY_CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool),
Identifier.CODEC.optionalFieldOf("start_jigsaw_name", null).forGetter(structure -> structure.startJigsawName),
Identifier.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName),
Codec.intRange(0, 30).fieldOf("size").forGetter(structure -> structure.size),
HeightProvider.CODEC.fieldOf("start_height").forGetter(structure -> structure.startHeight),
Heightmap.Type.CODEC.optionalFieldOf("project_start_to_heightmap", null).forGetter(structure -> structure.projectStartToHeightmap),
Heightmap.Type.CODEC.optionalFieldOf("project_start_to_heightmap").forGetter(structure -> structure.projectStartToHeightmap),
Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter)
).apply(instance, GorgonTempleStructure::new)).codec();

public GorgonTempleStructure(Config config, RegistryEntry<StructurePool> startPool, Identifier startJigsawName, int size, HeightProvider startHeight, Heightmap.Type projectStartToHeightmap, int maxDistanceFromCenter) {
public GorgonTempleStructure(Config config, RegistryEntry<StructurePool> startPool, Optional<Identifier> startJigsawName, int size, HeightProvider startHeight, Optional<Heightmap.Type> projectStartToHeightmap, int maxDistanceFromCenter) {
super(config, startPool, startJigsawName, size, startHeight, projectStartToHeightmap, maxDistanceFromCenter);
}

Expand All @@ -41,11 +41,11 @@ protected Optional<StructurePosition> getStructurePosition(Context pContext) {
return StructurePoolBasedGenerator.generate(
pContext, // Used for JigsawPlacement to get all the proper behaviors done.
this.startPool, // The starting pool to use to create the structure layout from
Optional.ofNullable(this.startJigsawName), // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this.
this.startJigsawName, // Can be used to only spawn from one Jigsaw block. But we don't need to worry about this.
this.size, // How deep a branch of pieces can go away from center piece. (5 means branches cannot be longer than 5 pieces from center piece)
blockpos, // Where to spawn the structure.
false, // "useExpansionHack" This is for legacy villages to generate properly. You should keep this false always.
Optional.ofNullable(this.projectStartToHeightmap), // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too)
this.projectStartToHeightmap, // Adds the terrain height's y value to the passed in blockpos's y value. (This uses WORLD_SURFACE_WG heightmap which stops at top water too)
// Here, blockpos's y value is 60 which means the structure spawn 60 blocks above terrain height.
// Set this to false for structure to be place only at the passed in blockpos's Y value instead.
// Definitely keep this false when placing structures in the nether as otherwise, heightmap placing will put the structure on the Bedrock roof.
Expand Down
Loading

0 comments on commit eac42c3

Please sign in to comment.