From 1ccdc83c1f83c7627dac52ef0046b77d85713515 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 2 Sep 2020 21:25:02 +0200 Subject: [PATCH] Fixed some mobs causing client crashes when spawning with the altar of birthing Closes #140 --- build.gradle | 2 +- .../blocks/tiles/TileEntityAnimalSpawner.java | 5 +++-- .../compat/jei/AnimalSpawnerCategory.java | 3 ++- .../recipes/AnimalSpawnerRecipe.java | 18 ++++++------------ 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 34ccd613..d4a2ecac 100644 --- a/build.gradle +++ b/build.gradle @@ -110,7 +110,7 @@ dependencies { compileOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.15.2-2.0-beta2:api") compile fg.deobf("com.blamejared.crafttweaker:CraftTweaker-1.15.1:6.0.0.4") - compile fg.deobf("quarris.enchantability:Enchantability:8.4.23") + compile fg.deobf("quarris.enchantability:Enchantability:8.1.17") } // Example for how to get properties into the manifest for reading by the runtime.. diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java index a53b8122..21f4142f 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java @@ -57,7 +57,7 @@ public class TileEntityAnimalSpawner extends TileEntityImpl implements ITickable this.time += 10; if (this.time >= this.currentRecipe.time) { - Entity entity = this.currentRecipe.makeEntity(this.world, this.spawnX, this.pos.getY() + 1, this.spawnZ); + Entity entity = this.currentRecipe.makeEntity(this.world, new BlockPos(this.spawnX, this.pos.getY() + 1, this.spawnZ)); this.world.addEntity(entity); this.currentRecipe = null; @@ -121,7 +121,8 @@ public class TileEntityAnimalSpawner extends TileEntityImpl implements ITickable this.world.rand.nextFloat() + 0.5F); if (this.entityClient == null) { - this.entityClient = this.currentRecipe.makeEntity(this.world, this.spawnX, this.pos.getY() + 1, this.spawnZ); + this.entityClient = this.currentRecipe.makeEntity(this.world, BlockPos.ZERO); + this.entityClient.setPosition(this.spawnX, this.pos.getY() + 1, this.spawnZ); } AxisAlignedBB bounds = this.entityClient.getBoundingBox(); for (int i = this.world.rand.nextInt(5) + 5; i >= 0; i--) diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java index f0a79401..d98a17bd 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java @@ -25,6 +25,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.SpawnEggItem; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import java.util.Arrays; import java.util.HashMap; @@ -126,7 +127,7 @@ public class AnimalSpawnerCategory implements IRecipeCategory