2021-05-11 20:39:13 +02:00
|
|
|
package com.simibubi.create.foundation;
|
|
|
|
|
|
|
|
import com.simibubi.create.AllBlocks;
|
|
|
|
import com.simibubi.create.content.contraptions.relays.belt.BeltBlock;
|
|
|
|
import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.WorldRenderer;
|
|
|
|
import net.minecraft.client.world.ClientWorld;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
|
|
|
|
public class BreakProgressHook {
|
|
|
|
|
|
|
|
public static void whenBreaking(ClientWorld world, WorldRenderer renderer, int playerEntityId, BlockPos pos, int progress) {
|
|
|
|
if (AllBlocks.BELT.has(world.getBlockState(pos))) {
|
2021-07-15 11:32:03 +02:00
|
|
|
BeltTileEntity belt = (BeltTileEntity) world.getBlockEntity(pos);
|
2021-05-11 20:39:13 +02:00
|
|
|
|
|
|
|
for (BlockPos beltPos : BeltBlock.getBeltChain(world, belt.getController())) {
|
2021-07-15 11:32:03 +02:00
|
|
|
renderer.destroyBlockProgress(beltPos.hashCode(), beltPos, progress);
|
2021-05-11 20:39:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|