mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-25 20:22:23 +00:00
Do not allow put multi parts in cable with bus & do not allow put bus in multi part te (#977)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
1 parent
60e461a2d9
commit
386a08c891
3 files changed
+18
No files matched your search
@@ -18,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -35,6 +36,8 @@ import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.integration.modules.helpers.FMPPacketEvent;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.parts.PartBasicState;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
@@ -68,6 +71,14 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
|
||||
|
||||
final TMultiPart part = PartRegistry.getPartByBlock(blk, meta);
|
||||
if (part instanceof CableBusPart cbp) {
|
||||
if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileCableBus tcb) {
|
||||
for (ForgeDirection fd : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (tcb.getPart(fd) instanceof PartBasicState) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
cbp.convertFromTile(world.getTileEntity(pos.x, pos.y, pos.z));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.ICLApi;
|
||||
import appeng.me.GridConnection;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -140,6 +141,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Platform.isMultiPartLoaded && bp instanceof PartBasicState
|
||||
&& this.getTile() instanceof TileMultipart) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.getPart(side) == null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ public class Platform {
|
||||
private static final DecimalFormat df = new DecimalFormat("#.##");
|
||||
public static final boolean isAE2FCLoaded = Loader.isModLoaded("ae2fc");
|
||||
public static final boolean isEIOLoaded = Loader.isModLoaded("EnderIO");
|
||||
public static final boolean isMultiPartLoaded = Loader.isModLoaded("ForgeMultipart");
|
||||
public static final boolean isBaublesLoaded = Loader.isModLoaded("Baubles|Expanded");
|
||||
|
||||
static {
|
||||
|
||||
Reference in new issue
Block a user