mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-16 07:24:32 +01:00
23 lines
823 B
Java
23 lines
823 B
Java
|
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))) {
|
||
|
BeltTileEntity belt = (BeltTileEntity) world.getTileEntity(pos);
|
||
|
|
||
|
for (BlockPos beltPos : BeltBlock.getBeltChain(world, belt.getController())) {
|
||
|
renderer.sendBlockBreakProgress(beltPos.hashCode(), beltPos, progress);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|