refactor: port microblock placement to Java

This commit is contained in:
Algent committed 2026-09-01 10:06:34 +02:00
1 parent e286de3401
commit c20b6bf9d9
11 files changed
+426 -193

No files matched your search

@@ -0,0 +1,29 @@
package codechicken.microblock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import codechicken.lib.vec.BlockCoord;
public class ExpandingPlacement extends ExecutablePlacement {
private final Microblock opart;
public ExpandingPlacement(BlockCoord pos, Microblock part, Microblock opart) {
super(pos, part);
this.opart = opart;
}
@Override
public void place(World world, EntityPlayer player, ItemStack item) {
opart.shape_$eq(part().shape());
opart.tile().notifyPartChange(opart);
opart.sendShapeUpdate();
}
@Override
public void consume(World world, EntityPlayer player, ItemStack item) {
item.stackSize -= 1;
}
}