From d568edd247ae95439f31757a1f312c31d4cd88c9 Mon Sep 17 00:00:00 2001 From: ByThePowerOfScience Date: Thu, 11 Jan 2024 17:10:11 -0500 Subject: [PATCH 1/2] Removed undocumented elemental soil transformation requirements. Air soil no longer needs to see the sky, earth soil no longer needs to have a roof. --- .../item/itemblock/ItemBlockElementalSoil.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java b/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java index 417f4e9ce..a34f6e0b7 100644 --- a/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java +++ b/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java @@ -108,16 +108,8 @@ public boolean onEntityItemUpdate(EntityItem entityItem) { } //Terran Soil Crafting + // Requirements: Needs to be under a certain height if (entityItem.posY <= ElementalSoilConfig.EarthSoilMaxY && entityItem.ticksExisted >= ElementalSoilConfig.EarthSoilDelay) { - BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(entityItem.getPosition()); - boolean found_roof = false; - for (int i = pos.getY(); i < Math.min(ElementalSoilConfig.EarthSoilMaxY + 20, world.getChunk(pos).getHeight(pos)); i++) { - pos.setY(i); - if (world.isAirBlock(pos)) continue; - found_roof = true; - } - if (!found_roof) return super.onEntityItemUpdate(entityItem); - world.spawnEntity(new EntityItem(world, entityItem.posX, entityItem.posY, entityItem.posZ, new ItemStack(ModBlocks.elemental_soil_earth, count))); PacketHandler.sendToAllTracking(new ElementalSoilTransformFX(entityItem.posX, entityItem.posY, entityItem.posZ, 3), entityItem); @@ -126,11 +118,8 @@ public boolean onEntityItemUpdate(EntityItem entityItem) { } //Aeros Soil Crafting + // Requirements: Needs to be over a certain height if (entityItem.posY >= ElementalSoilConfig.AirSoilMinY && entityItem.ticksExisted >= ElementalSoilConfig.AirSoilDelay) { - BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(entityItem.getPosition()); - int height = world.getChunk(pos).getHeight(pos); - if (pos.getY() < height) return super.onEntityItemUpdate(entityItem); - world.spawnEntity(new EntityItem(world, entityItem.posX, entityItem.posY, entityItem.posZ, new ItemStack(ModBlocks.elemental_soil_air, count))); PacketHandler.sendToAllTracking(new ElementalSoilTransformFX(entityItem.posX, entityItem.posY, entityItem.posZ, 2), entityItem); From ddb72195dc9d030e844e7c1a2d6538c40b56426d Mon Sep 17 00:00:00 2001 From: ByThePowerOfScience Date: Thu, 11 Jan 2024 17:10:11 -0500 Subject: [PATCH 2/2] Removed undocumented elemental soil transformation requirements. Air soil no longer needs to see the sky, earth soil no longer needs to have a roof. Fixes #795. --- .../item/itemblock/ItemBlockElementalSoil.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java b/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java index 417f4e9ce..a34f6e0b7 100644 --- a/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java +++ b/src/main/java/epicsquid/roots/item/itemblock/ItemBlockElementalSoil.java @@ -108,16 +108,8 @@ public boolean onEntityItemUpdate(EntityItem entityItem) { } //Terran Soil Crafting + // Requirements: Needs to be under a certain height if (entityItem.posY <= ElementalSoilConfig.EarthSoilMaxY && entityItem.ticksExisted >= ElementalSoilConfig.EarthSoilDelay) { - BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(entityItem.getPosition()); - boolean found_roof = false; - for (int i = pos.getY(); i < Math.min(ElementalSoilConfig.EarthSoilMaxY + 20, world.getChunk(pos).getHeight(pos)); i++) { - pos.setY(i); - if (world.isAirBlock(pos)) continue; - found_roof = true; - } - if (!found_roof) return super.onEntityItemUpdate(entityItem); - world.spawnEntity(new EntityItem(world, entityItem.posX, entityItem.posY, entityItem.posZ, new ItemStack(ModBlocks.elemental_soil_earth, count))); PacketHandler.sendToAllTracking(new ElementalSoilTransformFX(entityItem.posX, entityItem.posY, entityItem.posZ, 3), entityItem); @@ -126,11 +118,8 @@ public boolean onEntityItemUpdate(EntityItem entityItem) { } //Aeros Soil Crafting + // Requirements: Needs to be over a certain height if (entityItem.posY >= ElementalSoilConfig.AirSoilMinY && entityItem.ticksExisted >= ElementalSoilConfig.AirSoilDelay) { - BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(entityItem.getPosition()); - int height = world.getChunk(pos).getHeight(pos); - if (pos.getY() < height) return super.onEntityItemUpdate(entityItem); - world.spawnEntity(new EntityItem(world, entityItem.posX, entityItem.posY, entityItem.posZ, new ItemStack(ModBlocks.elemental_soil_air, count))); PacketHandler.sendToAllTracking(new ElementalSoilTransformFX(entityItem.posX, entityItem.posY, entityItem.posZ, 2), entityItem);