Skip to content

Commit

Permalink
Merge pull request #810 from MysticMods/dev/1.12.2
Browse files Browse the repository at this point in the history
Dev/1.12.2
  • Loading branch information
ByThePowerOfScience authored Jan 11, 2024
2 parents 3c6969e + b76a892 commit 60dea25
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 60dea25

Please sign in to comment.