mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
Fix being able to add facade to a conduit with microblocks on it
This commit is contained in:
1 parent
b1008cb250
commit
91bdb2a0b8
2 files changed
+19
-11
No files matched your search
@@ -695,6 +695,10 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
}
|
||||
|
||||
public boolean handleFacadeClick(World world, int x, int y, int z, EntityPlayer player, int side, IConduitBundle bundle, ItemStack stack) {
|
||||
if (MicroblocksUtil.supportMicroblocks() && hasMicroblocks(bundle)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add facade
|
||||
if(player.isSneaking()) {
|
||||
return false;
|
||||
@@ -1125,4 +1129,8 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
private ArrayList<ItemStack> IM__getDrops(List<ItemStack> cur, World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IMultipartSystem.instance.hook_getDrops(cur, world, x, y, z, metadata, fortune);
|
||||
}
|
||||
|
||||
private boolean hasMicroblocks(IConduitBundle bundle) {
|
||||
return !bundle.getCoverSystem().getAllParts().isEmpty();
|
||||
}
|
||||
}
|
||||
@@ -121,18 +121,18 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
int placeY = y + dir.offsetY;
|
||||
int placeZ = z + dir.offsetZ;
|
||||
|
||||
if(player.canPlayerEdit(placeX, placeY, placeZ, side, itemStack) && PainterUtil.getSourceBlock(itemStack) != null) {
|
||||
if (player.canPlayerEdit(placeX, placeY, placeZ, side, itemStack) && PainterUtil.getSourceBlock(itemStack) != null) {
|
||||
if (world.isAirBlock(placeX, placeY, placeZ)) {
|
||||
world.setBlock(placeX, placeY, placeZ, EnderIO.blockConduitBundle);
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(placeX, placeY, placeZ);
|
||||
Block facadeID = PainterUtil.getSourceBlock(itemStack);
|
||||
int facadeMeta = PainterUtil.getSourceBlockMetadata(itemStack);
|
||||
facadeMeta = PainterUtil.adjustFacadeMetadata(facadeID, facadeMeta, side);
|
||||
bundle.setFacadeId(facadeID);
|
||||
bundle.setFacadeMetadata(facadeMeta);
|
||||
bundle.setFacadeType(FacadeType.values()[itemStack.getItemDamage()]);
|
||||
ConduitUtil.playStepSound(facadeID.stepSound, world, x, y, z);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
world.setBlock(placeX, placeY, placeZ, EnderIO.blockConduitBundle);
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(placeX, placeY, placeZ);
|
||||
Block facadeID = PainterUtil.getSourceBlock(itemStack);
|
||||
int facadeMeta = PainterUtil.getSourceBlockMetadata(itemStack);
|
||||
facadeMeta = PainterUtil.adjustFacadeMetadata(facadeID, facadeMeta, side);
|
||||
bundle.setFacadeId(facadeID);
|
||||
bundle.setFacadeMetadata(facadeMeta);
|
||||
bundle.setFacadeType(FacadeType.values()[itemStack.getItemDamage()]);
|
||||
ConduitUtil.playStepSound(facadeID.stepSound, world, x, y, z);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
itemStack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user