mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-27 15:33:05 +00:00
refactor: port microblock placement to Java
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user