Skip to content

Commit

Permalink
[ci skip] Move begin and end world tick event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Oct 31, 2024
1 parent 4ac423e commit 8b18d88
Showing 1 changed file with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1880,27 +1880,6 @@ public void onPreWorldTick(TickEvent.WorldTickEvent e) {
}
}

private void doConcreteTracking() {
for (Iterator<EntityFallingBlock> iterator = fallingConcreteBlocks.iterator(); iterator.hasNext(); ) {
EntityFallingBlock block = iterator.next();
if (!block.isDead) {
int i = MathHelper.floor_double(block.posX);
int j = MathHelper.floor_double(block.posY);
int k = MathHelper.floor_double(block.posZ);

for (int jOff = 0; jOff <= (block.motionY < -1.0 ? 1 : 0); jOff++) { // If it's moving downward faster than a threshold speed: 1 in this case
if (block.worldObj.getBlock(i, j - jOff, k).getMaterial() == Material.water) {
block.worldObj.setBlock(i, j - jOff, k, ModBlocks.CONCRETE.get(), block.field_145814_a, 3); // metadata
block.setDead();
iterator.remove();
}
}
} else {
iterator.remove();
}
}
}

@SubscribeEvent
@SuppressWarnings("unchecked")
public void onPostWorldTick(TickEvent.WorldTickEvent e) {
Expand All @@ -1925,6 +1904,27 @@ public void onPostWorldTick(TickEvent.WorldTickEvent e) {
}
}

private void doConcreteTracking() {
for (Iterator<EntityFallingBlock> iterator = fallingConcreteBlocks.iterator(); iterator.hasNext(); ) {
EntityFallingBlock block = iterator.next();
if (!block.isDead) {
int i = MathHelper.floor_double(block.posX);
int j = MathHelper.floor_double(block.posY);
int k = MathHelper.floor_double(block.posZ);

for (int jOff = 0; jOff <= (block.motionY < -1.0 ? 1 : 0); jOff++) { // If it's moving downward faster than a threshold speed: 1 in this case
if (block.worldObj.getBlock(i, j - jOff, k).getMaterial() == Material.water) {
block.worldObj.setBlock(i, j - jOff, k, ModBlocks.CONCRETE.get(), block.field_145814_a, 3); // metadata
block.setDead();
iterator.remove();
}
}
} else {
iterator.remove();
}
}
}

private final ItemStackSet noBurnItems = new ItemStackSet();
private final ItemStackMap<Integer> burnTimeRemappings = new ItemStackMap<>();

Expand Down

0 comments on commit 8b18d88

Please sign in to comment.