diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/model/FrostologerEntityModel.java b/src/client/java/com/github/thedeathlycow/frostiful/client/model/FrostologerEntityModel.java index cdbbbee7..f4171ab6 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/model/FrostologerEntityModel.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/model/FrostologerEntityModel.java @@ -1,6 +1,6 @@ package com.github.thedeathlycow.frostiful.client.model; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.*; diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/render/entity/FrostologerEntityRenderer.java b/src/client/java/com/github/thedeathlycow/frostiful/client/render/entity/FrostologerEntityRenderer.java index 1ff40db3..2caac14e 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/render/entity/FrostologerEntityRenderer.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/render/entity/FrostologerEntityRenderer.java @@ -6,7 +6,7 @@ import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerCloakFeatureRenderer; import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerEyesFeatureRenderer; import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerFrostFeatureRenderer; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.entity.EntityRendererFactory; diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostLayers.java b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostLayers.java index a6da3481..66cd3e36 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostLayers.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostLayers.java @@ -1,7 +1,7 @@ package com.github.thedeathlycow.frostiful.client.render.feature; import com.github.thedeathlycow.frostiful.Frostiful; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.util.Identifier; @@ -13,8 +13,8 @@ public enum FrostLayers { NONE(0.0f, null), - LOW(-0.5f, Frostiful.id("textures/entity/illager/frostologer/low_frost.png")), - MEDIUM(-0.75f, Frostiful.id("textures/entity/illager/frostologer/medium_frost.png")), + LOW(-0.25f, Frostiful.id("textures/entity/illager/frostologer/low_frost.png")), + MEDIUM(-0.5f, Frostiful.id("textures/entity/illager/frostologer/medium_frost.png")), HIGH(FrostologerEntity.MAX_POWER_SCALE_START, Frostiful.id("textures/entity/illager/frostologer/high_frost.png")); public static final FrostLayers[] LAYERS_WITHOUT_NONE = Stream.of(FrostLayers.values()) diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerCloakFeatureRenderer.java b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerCloakFeatureRenderer.java index 32156012..4cab74ff 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerCloakFeatureRenderer.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerCloakFeatureRenderer.java @@ -1,7 +1,7 @@ package com.github.thedeathlycow.frostiful.client.render.feature; import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import com.github.thedeathlycow.frostiful.item.cloak.AbstractFrostologyCloakItem; import com.github.thedeathlycow.frostiful.registry.FItems; import net.fabricmc.api.EnvType; diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerEyesFeatureRenderer.java b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerEyesFeatureRenderer.java index 34f499fc..a9d6bdb9 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerEyesFeatureRenderer.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerEyesFeatureRenderer.java @@ -1,7 +1,7 @@ package com.github.thedeathlycow.frostiful.client.render.feature; import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.OverlayTexture; diff --git a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerFrostFeatureRenderer.java b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerFrostFeatureRenderer.java index beeb1550..c5bb2f97 100644 --- a/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerFrostFeatureRenderer.java +++ b/src/client/java/com/github/thedeathlycow/frostiful/client/render/feature/FrostologerFrostFeatureRenderer.java @@ -1,7 +1,7 @@ package com.github.thedeathlycow.frostiful.client.render.feature; import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.VertexConsumerProvider; diff --git a/src/main/java/com/github/thedeathlycow/frostiful/Frostiful.java b/src/main/java/com/github/thedeathlycow/frostiful/Frostiful.java index 1af8702c..656daf86 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/Frostiful.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/Frostiful.java @@ -2,6 +2,7 @@ import com.github.thedeathlycow.frostiful.compat.FrostifulIntegrations; import com.github.thedeathlycow.frostiful.config.FrostifulConfig; +import com.github.thedeathlycow.frostiful.entity.RootedEntity; import com.github.thedeathlycow.frostiful.entity.loot.StrayLootTableModifier; import com.github.thedeathlycow.frostiful.item.FrostedBanner; import com.github.thedeathlycow.frostiful.item.cloak.AbstractFrostologyCloakItem; @@ -19,6 +20,8 @@ import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.fabricmc.fabric.api.entity.event.v1.ServerEntityCombatEvents; +import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents; import net.fabricmc.fabric.api.loot.v3.LootTableEvents; import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; import net.fabricmc.fabric.api.util.TriState; @@ -75,6 +78,8 @@ public void onInitialize() { FFeatures.initialize(); FPlacedFeatures.initialize(); + ServerLivingEntityEvents.AFTER_DAMAGE.register(RootedEntity::afterDamage); + this.registerThermooEventListeners(); PayloadTypeRegistry.playS2C().register( PointWindSpawnPacket.PACKET_ID, diff --git a/src/main/java/com/github/thedeathlycow/frostiful/config/group/CombatConfigGroup.java b/src/main/java/com/github/thedeathlycow/frostiful/config/group/CombatConfigGroup.java index a3f2305e..a7319203 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/config/group/CombatConfigGroup.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/config/group/CombatConfigGroup.java @@ -22,22 +22,18 @@ public class CombatConfigGroup implements ConfigData { int frostologerHeatDrainPerTick = 30; + int frostologerCoolingFromFrostWandHit = 6300 / 6; + int packedSnowballFreezeAmount = 500; float packedSnowballDamage = 2.0f; float packedSnowballVulnerableTypesDamage = 5.0f; - int frostologerPassiveFreezingPerTick = 2; - - float frostologerMaxPassiveFreezing = 0.5f; - int biterFrostBiteMaxAmplifier = 2; float chillagerFireDamageMultiplier = 1.5f; - int frostologerIntolerableHeat = 9; - @ConfigEntry.Gui.RequiresRestart float furUpgradeTemplateGenerateChance = 0.5f; @@ -76,6 +72,10 @@ public int getFrostologerHeatDrainPerTick() { return 2 * frostologerHeatDrainPerTick; } + public int getFrostologerCoolingFromFrostWandHit() { + return frostologerCoolingFromFrostWandHit; + } + public int getPackedSnowballFreezeAmount() { return packedSnowballFreezeAmount; } @@ -88,14 +88,6 @@ public float getPackedSnowballVulnerableTypesDamage() { return packedSnowballVulnerableTypesDamage; } - public int getFrostologerPassiveFreezingPerTick() { - return frostologerPassiveFreezingPerTick; - } - - public float getFrostologerMaxPassiveFreezing() { - return frostologerMaxPassiveFreezing; - } - public int getBiterFrostBiteMaxAmplifier() { return Math.max(0, this.biterFrostBiteMaxAmplifier); } @@ -104,10 +96,6 @@ public float getChillagerFireDamageMultiplier() { return chillagerFireDamageMultiplier; } - public int getFrostologerIntolerableHeat() { - return frostologerIntolerableHeat; - } - public float getFurUpgradeTemplateGenerateChance() { return MathHelper.clamp(furUpgradeTemplateGenerateChance, 0f, 1f); } diff --git a/src/main/java/com/github/thedeathlycow/frostiful/entity/ChillagerEntity.java b/src/main/java/com/github/thedeathlycow/frostiful/entity/ChillagerEntity.java index fe01f54c..f39a3376 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/entity/ChillagerEntity.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/entity/ChillagerEntity.java @@ -2,6 +2,7 @@ import com.github.thedeathlycow.frostiful.Frostiful; import com.github.thedeathlycow.frostiful.config.FrostifulConfig; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import com.github.thedeathlycow.frostiful.registry.FEntityTypes; import com.github.thedeathlycow.frostiful.registry.FItems; import com.github.thedeathlycow.frostiful.registry.FSoundEvents; diff --git a/src/main/java/com/github/thedeathlycow/frostiful/entity/RootedEntity.java b/src/main/java/com/github/thedeathlycow/frostiful/entity/RootedEntity.java index 00408108..30715083 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/entity/RootedEntity.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/entity/RootedEntity.java @@ -2,13 +2,17 @@ import com.github.thedeathlycow.frostiful.Frostiful; import com.github.thedeathlycow.frostiful.config.FrostifulConfig; +import com.github.thedeathlycow.frostiful.entity.damage.FDamageTypes; +import com.github.thedeathlycow.frostiful.registry.tag.FDamageTypeTags; import net.minecraft.block.Blocks; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.MovementType; +import net.minecraft.entity.damage.DamageSource; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.DamageTypeTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; @@ -54,6 +58,18 @@ static Vec3d getMovementWhenRooted(MovementType type, Vec3d movement, Entity ent }; } + static void afterDamage(LivingEntity entity, DamageSource source, float baseDamageTaken, float damageTaken, boolean blocked) { + boolean breakRoot = !blocked + && damageTaken > 0f + && !source.isIn(FDamageTypeTags.DOES_NOT_BREAK_ROOT) + && entity instanceof RootedEntity rooted + && rooted.frostiful$isRooted(); + + if (breakRoot) { + RootedEntity.breakRootOnEntity(entity); + } + } + static void breakRootOnEntity(LivingEntity victim) { RootedEntity rootedEntity = (RootedEntity) victim; World world = victim.getWorld(); @@ -82,6 +98,4 @@ static void spawnShatterParticlesAndSound(LivingEntity victim, ServerWorld serve 1.0f, 0.75f ); } - - } diff --git a/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandAttackGoal.java b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandAttackGoal.java new file mode 100644 index 00000000..e48b7779 --- /dev/null +++ b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandAttackGoal.java @@ -0,0 +1,19 @@ +package com.github.thedeathlycow.frostiful.entity.frostologer; + +import net.minecraft.entity.ai.goal.AttackGoal; + +class FrostWandAttackGoal extends AttackGoal { + private final FrostologerEntity frostologerEntity; + + public FrostWandAttackGoal(FrostologerEntity frostologerEntity) { + super(frostologerEntity); + this.frostologerEntity = frostologerEntity; + } + + @Override + public boolean canStart() { + return frostologerEntity.isTargetRooted() + && super.canStart(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandCastGoal.java b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandCastGoal.java new file mode 100644 index 00000000..256d5d71 --- /dev/null +++ b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostWandCastGoal.java @@ -0,0 +1,57 @@ +package com.github.thedeathlycow.frostiful.entity.frostologer; + +import com.github.thedeathlycow.frostiful.Frostiful; +import com.github.thedeathlycow.frostiful.registry.FItems; +import com.github.thedeathlycow.frostiful.registry.FSoundEvents; +import net.minecraft.entity.ai.goal.ProjectileAttackGoal; +import net.minecraft.util.Hand; + +class FrostWandCastGoal extends ProjectileAttackGoal { + + private final FrostologerEntity frostologerEntity; + + public FrostWandCastGoal(FrostologerEntity frostologer, double mobSpeed, int intervalTicks, float maxShootRange) { + super(frostologer, mobSpeed, intervalTicks, maxShootRange); + this.frostologerEntity = frostologer; + } + + @Override + public boolean canStart() { + return super.canStart() + && frostologerEntity.hasTarget() + && !frostologerEntity.isTargetRooted() + && frostologerEntity.getMainHandStack().isOf(FItems.FROST_WAND); + } + + @Override + public void start() { + super.start(); + frostologerEntity.setAttacking(true); + frostologerEntity.setCurrentHand(Hand.MAIN_HAND); + this.startUsingFrostWand(); + } + + @Override + public void stop() { + super.stop(); + frostologerEntity.setAttacking(false); + frostologerEntity.clearActiveItem(); + this.stopUsingFrostWand(); + if (frostologerEntity.isTargetRooted()) { + int cooling = -Frostiful.getConfig().combatConfig.getFrostologerCoolingFromFrostWandHit(); + frostologerEntity.thermoo$addTemperature(cooling); + } + } + + private void startUsingFrostWand() { + frostologerEntity.playSound( + FSoundEvents.ITEM_FROST_WAND_PREPARE_CAST, + 1.0f, 1.0f + ); + frostologerEntity.getDataTracker().set(FrostologerEntity.IS_USING_FROST_WAND, true); + } + + private void stopUsingFrostWand() { + frostologerEntity.getDataTracker().set(FrostologerEntity.IS_USING_FROST_WAND, false); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/thedeathlycow/frostiful/entity/FrostologerEntity.java b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostologerEntity.java similarity index 70% rename from src/main/java/com/github/thedeathlycow/frostiful/entity/FrostologerEntity.java rename to src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostologerEntity.java index 0fd08d14..dece2f4e 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/entity/FrostologerEntity.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/entity/frostologer/FrostologerEntity.java @@ -1,18 +1,19 @@ -package com.github.thedeathlycow.frostiful.entity; +package com.github.thedeathlycow.frostiful.entity.frostologer; import com.github.thedeathlycow.frostiful.Frostiful; import com.github.thedeathlycow.frostiful.block.FrozenTorchBlock; -import com.github.thedeathlycow.frostiful.config.FrostifulConfig; -import com.github.thedeathlycow.frostiful.config.group.CombatConfigGroup; +import com.github.thedeathlycow.frostiful.entity.BiterEntity; +import com.github.thedeathlycow.frostiful.entity.RootedEntity; +import com.github.thedeathlycow.frostiful.entity.ThrownIcicleEntity; import com.github.thedeathlycow.frostiful.item.FrostWandItem; import com.github.thedeathlycow.frostiful.item.enchantment.HeatDrainEnchantmentEffect; +import com.github.thedeathlycow.frostiful.registry.FEnchantmentProviders; import com.github.thedeathlycow.frostiful.registry.FEntityTypes; import com.github.thedeathlycow.frostiful.registry.FItems; import com.github.thedeathlycow.frostiful.registry.FSoundEvents; import com.github.thedeathlycow.frostiful.registry.tag.FBlockTags; import com.github.thedeathlycow.frostiful.registry.tag.FDamageTypeTags; import com.github.thedeathlycow.thermoo.api.ThermooAttributes; -import com.github.thedeathlycow.thermoo.api.temperature.EnvironmentController; import com.github.thedeathlycow.thermoo.api.temperature.EnvironmentManager; import com.github.thedeathlycow.thermoo.api.temperature.HeatingModes; import net.fabricmc.api.EnvType; @@ -21,9 +22,10 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.provider.EnchantmentProviders; import net.minecraft.entity.*; import net.minecraft.entity.ai.RangedAttackMob; -import net.minecraft.entity.ai.TargetPredicate; import net.minecraft.entity.ai.goal.*; import net.minecraft.entity.attribute.DefaultAttributeContainer; import net.minecraft.entity.attribute.EntityAttributes; @@ -46,12 +48,10 @@ import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.tag.DamageTypeTags; import net.minecraft.registry.tag.EntityTypeTags; -import net.minecraft.registry.tag.FluidTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; -import net.minecraft.state.property.Properties; import net.minecraft.util.Hand; import net.minecraft.util.math.*; import net.minecraft.util.math.intprovider.IntProvider; @@ -74,13 +74,13 @@ */ public class FrostologerEntity extends SpellcastingIllagerEntity implements RangedAttackMob { - private static final TrackedData IS_USING_FROST_WAND = DataTracker.registerData( + static final TrackedData IS_USING_FROST_WAND = DataTracker.registerData( FrostologerEntity.class, TrackedDataHandlerRegistry.BOOLEAN ); - public static final float MAX_POWER_SCALE_START = -0.95f; + public static final float MAX_POWER_SCALE_START = -0.75f; private static final int NUM_POWER_PARTICLES = 2; - private static final float START_PLACING_SNOW_TEMP = -0.8f; + private static final float START_PLACING_SNOW_TEMP = -0.75f; public float prevStrideDistance; @@ -105,18 +105,8 @@ public static DefaultAttributeContainer.Builder createFrostologerAttributes() { .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.5) .add(EntityAttributes.GENERIC_FOLLOW_RANGE, 32.0) .add(EntityAttributes.GENERIC_MAX_HEALTH, 150.0) - .add(ThermooAttributes.MIN_TEMPERATURE, 5.0); - } - - public boolean isInHeatedArea() { - World world = this.getWorld(); - EnvironmentController controller = EnvironmentManager.INSTANCE.getController(); - - CombatConfigGroup config = Frostiful.getConfig().combatConfig; - int intolerableHeat = config.getFrostologerIntolerableHeat(); - - return world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING) - && controller.getHeatAtLocation(world, this.getBlockPos()) > intolerableHeat; + .add(ThermooAttributes.MIN_TEMPERATURE, 5.0) + .add(ThermooAttributes.MAX_TEMPERATURE, 0.0); } public boolean isAtMaxPower() { @@ -147,11 +137,7 @@ public void destroyHeatSource(ServerWorld world, BlockState state, BlockPos bloc if (state.isIn(FBlockTags.FROSTOLOGER_CANNOT_FREEZE)) { frozenState = state; } else if (blockPos.equals(this.getBlockPos())) { - if (fluidState.isIn(FluidTags.WATER)) { - frozenState = Blocks.WATER.getDefaultState(); - } else { - frozenState = Blocks.AIR.getDefaultState(); - } + frozenState = Blocks.AIR.getDefaultState(); } else if (state.isIn(FBlockTags.HOT_FLOOR)) { frozenState = Blocks.COBBLESTONE.getDefaultState(); } else if (state.isFullCube(world, blockPos)) { @@ -161,8 +147,6 @@ public void destroyHeatSource(ServerWorld world, BlockState state, BlockPos bloc } else if (heatedBlock instanceof AbstractTorchBlock) { BlockState torch = FrozenTorchBlock.freezeTorch(state); frozenState = torch != null ? torch : Blocks.AIR.getDefaultState(); - } else if (state.contains(Properties.WATERLOGGED) && Boolean.TRUE.equals(state.get(Properties.WATERLOGGED))) { - frozenState = Blocks.ICE.getDefaultState(); } else { frozenState = Blocks.AIR.getDefaultState(); } @@ -213,9 +197,8 @@ protected void initGoals() { this.goalSelector.add(2, new FleeEntityGoal<>(this, IronGolemEntity.class, 8.0F, 1.2, 1.5)); - this.goalSelector.add(4, new FrostWandAttackGoal()); - this.goalSelector.add(4, new SummonMinionsGoal()); - this.goalSelector.add(4, new IcicleAttackGoal(UniformIntProvider.create(20, 30))); + this.goalSelector.add(3, new IcicleAttackGoal(UniformIntProvider.create(20, 30), UniformIntProvider.create(15, 25))); + this.goalSelector.add(4, new FrostWandAttackGoal(this)); this.goalSelector.add(6, new DestroyHeatSourcesGoal(15)); @@ -253,15 +236,29 @@ public EntityData initialize( @Nullable EntityData entityData ) { this.initEquipment(world.getRandom(), difficulty); + this.updateEnchantments(world, random, difficulty); return super.initialize(world, difficulty, spawnReason, entityData); } @Override - protected void initEquipment(Random random, LocalDifficulty difficulty) { + protected void enchantMainHandItem(ServerWorldAccess world, Random random, LocalDifficulty localDifficulty) { + ItemStack stack = this.getEquippedStack(EquipmentSlot.MAINHAND); + if (!stack.isEmpty()) { + EnchantmentHelper.applyEnchantmentProvider( + stack, + world.getRegistryManager(), + FEnchantmentProviders.FROSTOLOGER_SPAWN_FROST_WAND, + localDifficulty, + random + ); + this.equipStack(EquipmentSlot.MAINHAND, stack); + } + } + + @Override + public void initEquipment(Random random, LocalDifficulty difficulty) { this.setStackInHand(Hand.MAIN_HAND, new ItemStack(FItems.FROST_WAND)); this.equipStack(EquipmentSlot.CHEST, new ItemStack(FItems.FROSTOLOGY_CLOAK)); - // TODO: figure out enchanting equipment - // this.enchantMainHandItem(this.getWorld(), random, difficulty.getClampedLocalDifficulty()); // equipment drops handled with loot table this.setEquipmentDropChance(EquipmentSlot.MAINHAND, 0.0f); @@ -283,14 +280,6 @@ public void tick() { if (this.getWorld().isClient && this.isAtMaxPower()) { this.spawnPowerParticles(); } - - FrostifulConfig config = Frostiful.getConfig(); - if (this.isTargetPlayer() && this.thermoo$getTemperatureScale() > -config.combatConfig.getFrostologerMaxPassiveFreezing()) { - this.thermoo$addTemperature( - -config.combatConfig.getFrostologerPassiveFreezingPerTick(), - HeatingModes.PASSIVE - ); - } } @Override @@ -335,7 +324,6 @@ public void tickMovement() { stepPositionsPool[0] = frostologerPos; stepPositionsPool[1] = frostologerPos.down(); for (BlockPos blockPos : stepPositionsPool) { - BlockState blockState = world.getBlockState(blockPos); if (EnvironmentManager.INSTANCE.getController().isHeatSource(blockState)) { this.destroyHeatSource(serverWorld, blockState, blockPos); @@ -519,62 +507,6 @@ public void writeCustomDataToNbt(NbtCompound nbt) { nbt.putBoolean("IsUsingFrostWand", this.dataTracker.get(IS_USING_FROST_WAND)); } - protected class FrostWandAttackGoal extends AttackGoal { - public FrostWandAttackGoal() { - super(FrostologerEntity.this); - } - - @Override - public boolean canStart() { - return FrostologerEntity.this.isTargetRooted() - && super.canStart(); - } - - } - - protected class FrostWandCastGoal extends ProjectileAttackGoal { - - public FrostWandCastGoal(RangedAttackMob mob, double mobSpeed, int intervalTicks, float maxShootRange) { - super(mob, mobSpeed, intervalTicks, maxShootRange); - } - - @Override - public boolean canStart() { - return super.canStart() - && FrostologerEntity.this.hasTarget() - && !FrostologerEntity.this.isTargetRooted() - && FrostologerEntity.this.getMainHandStack().isOf(FItems.FROST_WAND); - } - - @Override - public void start() { - super.start(); - FrostologerEntity.this.setAttacking(true); - FrostologerEntity.this.setCurrentHand(Hand.MAIN_HAND); - this.startUsingFrostWand(); - } - - @Override - public void stop() { - super.stop(); - FrostologerEntity.this.setAttacking(false); - FrostologerEntity.this.clearActiveItem(); - this.stopUsingFrostWand(); - } - - private void startUsingFrostWand() { - FrostologerEntity.this.playSound( - FSoundEvents.ITEM_FROST_WAND_PREPARE_CAST, - 1.0f, 1.0f - ); - FrostologerEntity.this.dataTracker.set(IS_USING_FROST_WAND, true); - } - - private void stopUsingFrostWand() { - FrostologerEntity.this.dataTracker.set(IS_USING_FROST_WAND, false); - } - } - protected class DestroyHeatSourcesGoal extends SpellcastingIllagerEntity.CastSpellGoal { private final int range; @@ -596,49 +528,31 @@ public void start() { @Override public boolean canStart() { - // no super call as that requires a target to be selected - if (FrostologerEntity.this.isSpellcasting()) { - return false; - } else if (FrostologerEntity.this.age < this.startTime) { - return false; - } else if (!FrostologerEntity.this.hasTarget()) { - return false; - } else { - return FrostologerEntity.this.isOnFire() - || FrostologerEntity.this.isInHeatedArea(); - } - } - - @Override - public boolean shouldContinue() { - return this.spellCooldown > 0; + FrostologerEntity frostologer = FrostologerEntity.this; + return super.canStart() && frostologer.thermoo$getTemperature() <= frostologer.thermoo$getMinTemperature(); } @Override public void tick() { + FrostologerEntity frostologer = FrostologerEntity.this; - Box box = FrostologerEntity.this.getBoundingBox().expand(this.range); + Box box = frostologer.getBoundingBox().expand(this.range); - @Nullable - ServerWorld serverWorld = null; - World world = FrostologerEntity.this.getWorld(); - if (!world.isClient) { - serverWorld = (ServerWorld) world; + if (frostologer.isOnFire()) { + frostologer.extinguish(); + frostologer.playExtinguishSound(); } - if (FrostologerEntity.this.isOnFire()) { - FrostologerEntity.this.extinguish(); - FrostologerEntity.this.playExtinguishSound(); - } + World world = frostologer.getWorld(); int heatDrain = Frostiful.getConfig().combatConfig.getFrostologerHeatDrainPerTick(); - for (LivingEntity victim : world.getEntitiesByClass(LivingEntity.class, box, entity -> true)) { + frostologer.thermoo$addTemperature(heatDrain); + + for (LivingEntity victim : world.getEntitiesByClass(LivingEntity.class, box, entity -> entity != frostologer)) { victim.thermoo$addTemperature(-heatDrain, HeatingModes.ACTIVE); - if (serverWorld != null) { - HeatDrainEnchantmentEffect.addHeatDrainParticles( - serverWorld, victim, FrostologerEntity.this, 5, 0.08 - ); + if (world instanceof ServerWorld serverWorld) { + HeatDrainEnchantmentEffect.addHeatDrainParticles(serverWorld, victim, frostologer, 5, 0.08); } } @@ -647,7 +561,6 @@ public void tick() { @Override protected void castSpell() { - World world = getWorld(); if (!world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) { return; @@ -655,6 +568,7 @@ protected void castSpell() { BlockPos origin = FrostologerEntity.this.getBlockPos(); Vec3i distance = new Vec3i(this.range, this.range, this.range); + for (BlockPos pos : BlockPos.iterate(origin.subtract(distance), origin.add(distance))) { BlockState state = world.getBlockState(pos); if (EnvironmentManager.INSTANCE.getController().isHeatSource(state) && world instanceof ServerWorld serverWorld) { @@ -693,109 +607,17 @@ protected Spell getSpell() { } - protected class SummonMinionsGoal extends SpellcastingIllagerEntity.CastSpellGoal { - private static final TargetPredicate IS_MINION = TargetPredicate.createNonAttackable() - .setBaseMaxDistance(16.0) - .ignoreVisibility() - .ignoreDistanceScalingFactor(); - - // I could make this configurable, but it's for the sake of stopping biter spam and not really a significant mechanic - private static final int SUMMON_BITER_COOL_DOWN = 5 * 20; - - private int nextStartTime = -1; - - @Override - public void start() { - super.start(); - if (FrostologerEntity.this.isOnFire()) { - FrostologerEntity.this.extinguish(); - FrostologerEntity.this.playExtinguishSound(); - } - } - - @Override - public boolean canStart() { - if (FrostologerEntity.this.age <= nextStartTime) { - return false; - } else if (FrostologerEntity.this.random.nextInt(2) == 0) { - return false; - } else if (!super.canStart()) { - return false; - } else if (!FrostologerEntity.this.isTargetRooted()) { - return false; - } else { - int numNearbyMinions = getWorld().getTargets( - BiterEntity.class, - IS_MINION, - FrostologerEntity.this, - FrostologerEntity.this.getBoundingBox().expand(16.0) - ).size(); - - return FrostologerEntity.this.random.nextInt(8) + 1 > numNearbyMinions; - } - } - - @Override - protected void castSpell() { - ServerWorld serverWorld = (ServerWorld) getWorld(); - nextStartTime = FrostologerEntity.this.age + SUMMON_BITER_COOL_DOWN; - - for (int i = 0; i < 3; ++i) { - BlockPos blockPos = FrostologerEntity.this.getBlockPos(); - - // use vex entity as placeholder for custom minions - BiterEntity minionEntity = FEntityTypes.BITER.create(serverWorld); - - if (minionEntity == null) { - return; - } - - minionEntity.refreshPositionAndAngles(blockPos, 0.0F, 0.0F); - - minionEntity.initialize( - serverWorld, - serverWorld.getLocalDifficulty(blockPos), - SpawnReason.MOB_SUMMONED, - null - ); - minionEntity.setOwner(FrostologerEntity.this); - - serverWorld.spawnEntityAndPassengers(minionEntity); - } - } - - @Override - protected int getSpellTicks() { - return 20; - } - - @Override - protected int startTimeDelay() { - return 20; - } - - @Nullable - @Override - protected SoundEvent getSoundPrepare() { - return SoundEvents.ENTITY_EVOKER_PREPARE_SUMMON; - } - - @Override - protected Spell getSpell() { - return Spell.SUMMON_VEX; - } - } - protected class IcicleAttackGoal extends SpellcastingIllagerEntity.CastSpellGoal { private final IntProvider numIciclesProvider; - private static final int ICICLE_ATTACK_COOL_DOWN = 20; + private final IntProvider cooldownProvider; private int nextStartTime = -1; - public IcicleAttackGoal(IntProvider numIciclesProvider) { + public IcicleAttackGoal(IntProvider numIciclesProvider, IntProvider cooldownProvider) { this.numIciclesProvider = numIciclesProvider; + this.cooldownProvider = cooldownProvider; } @Override @@ -811,8 +633,6 @@ public void start() { public boolean canStart() { if (FrostologerEntity.this.age <= nextStartTime) { return false; - } else if (FrostologerEntity.this.random.nextInt(2) == 0) { - return false; } else if (!super.canStart()) { return false; } else { @@ -825,7 +645,7 @@ protected void castSpell() { ServerWorld serverWorld = (ServerWorld) getWorld(); int numIcicles = this.numIciclesProvider.get(random); - nextStartTime = FrostologerEntity.this.age + ICICLE_ATTACK_COOL_DOWN; + nextStartTime = FrostologerEntity.this.age + cooldownProvider.get(random) * 20; for (int i = 0; i < numIcicles; ++i) { BlockPos blockPos = FrostologerEntity.this.getBlockPos() .add( diff --git a/src/main/java/com/github/thedeathlycow/frostiful/mixins/entity/root/RootedEntityImplMixin.java b/src/main/java/com/github/thedeathlycow/frostiful/mixins/entity/root/RootedEntityImplMixin.java index 1d8b796f..06281e35 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/mixins/entity/root/RootedEntityImplMixin.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/mixins/entity/root/RootedEntityImplMixin.java @@ -9,6 +9,7 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.tag.DamageTypeTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.profiler.Profiler; import net.minecraft.world.World; @@ -61,17 +62,6 @@ public RootedEntityImplMixin(EntityType type, World world) { return instance.thermoo$canFreeze(); } - @Inject( - method = "damage", - at = @At("RETURN") - ) - private void shatterIceOnDamaged(DamageSource source, float amount, CallbackInfoReturnable cir) { - if (!cir.getReturnValue() || source.isOf(FDamageTypes.BROKEN_ICE) || !this.frostiful$isRooted()) { - return; - } - RootedEntity.breakRootOnEntity((LivingEntity) (Object) this); - } - @Inject( method = "tickMovement", at = @At( diff --git a/src/main/java/com/github/thedeathlycow/frostiful/registry/FEnchantmentProviders.java b/src/main/java/com/github/thedeathlycow/frostiful/registry/FEnchantmentProviders.java new file mode 100644 index 00000000..9af61168 --- /dev/null +++ b/src/main/java/com/github/thedeathlycow/frostiful/registry/FEnchantmentProviders.java @@ -0,0 +1,19 @@ +package com.github.thedeathlycow.frostiful.registry; + +import com.github.thedeathlycow.frostiful.Frostiful; +import net.minecraft.enchantment.provider.EnchantmentProvider; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; + +public final class FEnchantmentProviders { + + public static final RegistryKey FROSTOLOGER_SPAWN_FROST_WAND = key("frostologer_spawn_frost_wand"); + + private static RegistryKey key(String id) { + return RegistryKey.of(RegistryKeys.ENCHANTMENT_PROVIDER, Frostiful.id(id)); + } + + private FEnchantmentProviders() { + + } +} \ No newline at end of file diff --git a/src/main/java/com/github/thedeathlycow/frostiful/registry/FEntityTypes.java b/src/main/java/com/github/thedeathlycow/frostiful/registry/FEntityTypes.java index cef42281..b950ed36 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/registry/FEntityTypes.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/registry/FEntityTypes.java @@ -2,6 +2,7 @@ import com.github.thedeathlycow.frostiful.Frostiful; import com.github.thedeathlycow.frostiful.entity.*; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import net.fabricmc.fabric.api.entity.event.v1.ServerEntityCombatEvents; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/github/thedeathlycow/frostiful/registry/tag/FDamageTypeTags.java b/src/main/java/com/github/thedeathlycow/frostiful/registry/tag/FDamageTypeTags.java index 6fae99e9..7977cb14 100644 --- a/src/main/java/com/github/thedeathlycow/frostiful/registry/tag/FDamageTypeTags.java +++ b/src/main/java/com/github/thedeathlycow/frostiful/registry/tag/FDamageTypeTags.java @@ -5,13 +5,16 @@ import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; -public class FDamageTypeTags { +public final class FDamageTypeTags { public static final TagKey IS_ICICLE = register("is_icicle"); + public static final TagKey DOES_NOT_BREAK_ROOT = register("does_not_break_root"); private static TagKey register(String id) { return TagKey.of(RegistryKeys.DAMAGE_TYPE, Frostiful.id(id)); } + private FDamageTypeTags() { + } } diff --git a/src/main/resources/assets/frostiful/lang/en_us.json b/src/main/resources/assets/frostiful/lang/en_us.json index 565acff0..e63cffbe 100644 --- a/src/main/resources/assets/frostiful/lang/en_us.json +++ b/src/main/resources/assets/frostiful/lang/en_us.json @@ -228,14 +228,12 @@ "text.autoconfig.frostiful.option.combatConfig.frostWandCooldown": "Frost Wand cool down (ticks)", "text.autoconfig.frostiful.option.combatConfig.frostWandRootTime": "Frost Wand root time (ticks)", "text.autoconfig.frostiful.option.combatConfig.frostologerHeatDrainPerTick": "Frostologer heat drain per tick", + "text.autoconfig.frostiful.option.combatConfig.frostologerCoolingFromFrostWandHit": "Frostologer Cooling from Frost Wand hit", "text.autoconfig.frostiful.option.combatConfig.packedSnowballFreezeAmount": "Packed snowball freeze amount", "text.autoconfig.frostiful.option.combatConfig.packedSnowballDamage": "Packed snowball damage", "text.autoconfig.frostiful.option.combatConfig.packedSnowballVulnerableTypesDamage": "Packed snowball vulnerable types damage", - "text.autoconfig.frostiful.option.combatConfig.frostologerPassiveFreezingPerTick": "Frostologer passive freezing per tick", - "text.autoconfig.frostiful.option.combatConfig.frostologerMaxPassiveFreezing": "Frostologer max passive freezing percent (0-1)", "text.autoconfig.frostiful.option.combatConfig.biterFrostBiteMaxAmplifier": "Max Frost Bite Max Amplifier (inclusive)", "text.autoconfig.frostiful.option.combatConfig.chillagerFireDamageMultiplier": "Chillager fire damage multiplier", - "text.autoconfig.frostiful.option.combatConfig.frostologerIntolerableHeat": "Frostologer intolerable heat", "text.autoconfig.frostiful.option.combatConfig.furUpgradeTemplateGenerateChance": "Fur upgrade generate chance (0-1)", "text.autoconfig.frostiful.option.combatConfig.skateUpgradeTemplateGenerateChance": "Ice Skate upgrade generate chance (0-1)", "text.autoconfig.frostiful.option.combatConfig.veryProtectiveFrostResistanceMultiplier": "Very protective Frost Resistance multiplier", diff --git a/src/main/resources/data/frostiful/enchantment_provider/frostologer_spawn_frost_wand.json b/src/main/resources/data/frostiful/enchantment_provider/frostologer_spawn_frost_wand.json new file mode 100644 index 00000000..7b65684f --- /dev/null +++ b/src/main/resources/data/frostiful/enchantment_provider/frostologer_spawn_frost_wand.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:by_cost_with_difficulty", + "enchantments": [ + "frostiful:enervation", + "frostiful:frozen_touch_curse", + "frostiful:ice_breaker" + ], + "max_cost_span": 20, + "min_cost": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/ominous/reward_boss.json b/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/ominous/reward_boss.json index 4b99934b..233b6231 100644 --- a/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/ominous/reward_boss.json +++ b/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/ominous/reward_boss.json @@ -2,24 +2,15 @@ "type": "minecraft:chest", "pools": [ { + "rolls": 1, "bonus_rolls": 0, "entries": [ { "type": "minecraft:loot_table", - "value": "frostiful:chests/frostologer_castle/ominous/reward_rare", + "value": "frostiful:chests/frostologer_castle/ominous/reward", "weight": 2 - }, - { - "type": "minecraft:loot_table", - "value": "frostiful:chests/frostologer_castle/ominous/reward_common", - "weight": 1 } - ], - "rolls": { - "type": "minecraft:uniform", - "max": 3, - "min": 1 - } + ] }, { "bonus_rolls": 0, diff --git a/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/regular/reward_boss.json b/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/regular/reward_boss.json index 7469875d..7d7c815d 100644 --- a/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/regular/reward_boss.json +++ b/src/main/resources/data/frostiful/loot_table/chests/frostologer_castle/regular/reward_boss.json @@ -2,24 +2,15 @@ "type": "minecraft:chest", "pools": [ { + "rolls": 1, "bonus_rolls": 0, "entries": [ { "type": "minecraft:loot_table", - "value": "frostiful:chests/frostologer_castle/regular/reward_rare", + "value": "frostiful:chests/frostologer_castle/regular/reward", "weight": 2 - }, - { - "type": "minecraft:loot_table", - "value": "frostiful:chests/frostologer_castle/regular/reward_common", - "weight": 1 } - ], - "rolls": { - "type": "minecraft:uniform", - "max": 3, - "min": 1 - } + ] }, { "bonus_rolls": 0, diff --git a/src/main/resources/data/frostiful/tags/damage_type/does_not_break_root.json b/src/main/resources/data/frostiful/tags/damage_type/does_not_break_root.json new file mode 100644 index 00000000..890b1ef0 --- /dev/null +++ b/src/main/resources/data/frostiful/tags/damage_type/does_not_break_root.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:freeze", + "frostiful:broken_ice" + ] +} \ No newline at end of file diff --git a/src/testmod/java/com/github/thedeathlycow/frostiful/test/frostologer/FrostologerDestroyHeatSourcesTests.java b/src/testmod/java/com/github/thedeathlycow/frostiful/test/frostologer/FrostologerDestroyHeatSourcesTests.java index 8194c983..54350157 100644 --- a/src/testmod/java/com/github/thedeathlycow/frostiful/test/frostologer/FrostologerDestroyHeatSourcesTests.java +++ b/src/testmod/java/com/github/thedeathlycow/frostiful/test/frostologer/FrostologerDestroyHeatSourcesTests.java @@ -1,6 +1,6 @@ package com.github.thedeathlycow.frostiful.test.frostologer; -import com.github.thedeathlycow.frostiful.entity.FrostologerEntity; +import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity; import com.github.thedeathlycow.frostiful.registry.FBlocks; import com.github.thedeathlycow.frostiful.registry.FEntityTypes; import net.minecraft.block.*; @@ -74,11 +74,6 @@ public void shroomlight_becomes_ice(TestContext context) { runDestroyHeatSourceTest(context, Blocks.SHROOMLIGHT.getDefaultState(), Blocks.ICE); } - @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void sea_lantern_becomes_ice(TestContext context) { - runDestroyHeatSourceTest(context, Blocks.SEA_LANTERN.getDefaultState(), Blocks.ICE); - } - @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") public void redstone_lamp_becomes_ice(TestContext context) { runDestroyHeatSourceTest( @@ -89,6 +84,11 @@ public void redstone_lamp_becomes_ice(TestContext context) { ); } + @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") + public void sea_lantern_becomes_ice(TestContext context) { + runDestroyHeatSourceTest(context, Blocks.SEA_LANTERN.getDefaultState(), Blocks.ICE); + } + @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") public void furnace_becomes_ice(TestContext context) { runDestroyHeatSourceTest( @@ -152,82 +152,92 @@ public void beacon_is_unaffected_by_frostologer(TestContext context) { runDestroyHeatSourceTest(context, Blocks.BEACON.getDefaultState(), Blocks.BEACON); } + @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") + public void vault_is_unaffected_by_frostologer(TestContext context) { + runDestroyHeatSourceTest(context, Blocks.VAULT.getDefaultState(), Blocks.VAULT); + } + + @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") + public void trial_spawner_is_unaffected_by_frostologer(TestContext context) { + runDestroyHeatSourceTest(context, Blocks.TRIAL_SPAWNER.getDefaultState(), Blocks.TRIAL_SPAWNER); + } + //endregion //region water logged tests @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_sea_pickle_becomes_ice(TestContext context) { + public void waterlogged_sea_pickle_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.SEA_PICKLE.getDefaultState() .with(SeaPickleBlock.WATERLOGGED, true) .with(SeaPickleBlock.PICKLES, 4), - Blocks.ICE + Blocks.AIR ); } @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_ender_chest_becomes_ice(TestContext context) { + public void waterlogged_ender_chest_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.ENDER_CHEST.getDefaultState() .with(EnderChestBlock.WATERLOGGED, true), - Blocks.ICE + Blocks.AIR ); } @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_lantern_becomes_ice(TestContext context) { + public void waterlogged_lantern_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.LANTERN.getDefaultState() .with(EnderChestBlock.WATERLOGGED, true), - Blocks.ICE + Blocks.AIR ); } @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_amethyst_cluster_becomes_ice(TestContext context) { + public void waterlogged_amethyst_cluster_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.AMETHYST_CLUSTER.getDefaultState() .with(AmethystClusterBlock.WATERLOGGED, true), - Blocks.ICE + Blocks.AIR ); } // yes this is technically a possible block state @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_lit_candle_becomes_ice(TestContext context) { + public void waterlogged_lit_candle_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.CANDLE.getDefaultState() .with(CandleBlock.WATERLOGGED, true) .with(CandleBlock.LIT, true), - Blocks.ICE + Blocks.AIR ); } // yes this is technically a possible block state @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_lit_campfire_becomes_ice(TestContext context) { + public void waterlogged_lit_campfire_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, Blocks.CAMPFIRE.getDefaultState() .with(CampfireBlock.WATERLOGGED, true) .with(CampfireBlock.LIT, true), - Blocks.ICE + Blocks.AIR ); } @GameTest(templateName = "frostiful-test:frostologer_heat_source_test_template") - public void waterlogged_hot_sun_lichen_becomes_ice(TestContext context) { + public void waterlogged_hot_sun_lichen_becomes_air(TestContext context) { runDestroyHeatSourceTest( context, FBlocks.HOT_SUN_LICHEN.getDefaultState() .with(AmethystClusterBlock.WATERLOGGED, true), - Blocks.ICE + Blocks.AIR ); }