Skip to content

Commit

Permalink
Remove left-over code and textures for ultra dense ME conduits (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
szuend authored Dec 29, 2024
1 parent 5769ebe commit 346bbf4
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 53 deletions.
4 changes: 0 additions & 4 deletions src/main/java/crazypants/enderio/conduit/ConduitRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,6 @@ private static void addAeRecipes() {

res.stackSize = 1;
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
if (Config.enableMEUltraDenseConduits) {
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
}
}
}
2 changes: 0 additions & 2 deletions src/main/java/crazypants/enderio/conduit/me/IMEConduit.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ public interface IMEConduit extends IConduit {

boolean isDense();

boolean isDenseUltra();

int getChannelsInUse();
}
39 changes: 6 additions & 33 deletions src/main/java/crazypants/enderio/conduit/me/MEConduit.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.enderio.core.common.util.BlockCoord;

import appeng.api.AEApi;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridConnection;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
Expand Down Expand Up @@ -51,15 +50,13 @@ public ConduitRenderer getRenderer() {
public static IIcon[] longTextures;

private boolean isDense;
private boolean isDenseUltra;
private int playerID = -1;

public MEConduit() {
this(0);
}

public MEConduit(int itemDamage) {
isDenseUltra = itemDamage == 2;
isDense = itemDamage == 1;
}

Expand All @@ -68,16 +65,14 @@ public static void initIcons() {

@Override
public void registerIcons(IIconRegister register) {
coreTextures = new IIcon[3];
longTextures = new IIcon[3];
coreTextures = new IIcon[2];
longTextures = new IIcon[2];

coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");

longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
}

@Override
Expand All @@ -87,10 +82,7 @@ public int getTextureType() {
});
}

public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
if (isDenseUltra) {
return 2;
}
public static int getDamageForState(boolean isDense) {
if (isDense) {
return 1;
}
Expand All @@ -104,7 +96,7 @@ public Class<? extends IConduit> getBaseConduitType() {

@Override
public ItemStack createItem() {
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
}

@Override
Expand All @@ -122,7 +114,6 @@ public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
public void writeToNBT(NBTTagCompound nbtRoot) {
super.writeToNBT(nbtRoot);
nbtRoot.setBoolean("isDense", isDense);
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
nbtRoot.setInteger("playerID", playerID);
}

Expand All @@ -135,9 +126,6 @@ public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
} else {
playerID = -1;
}
if (nbtRoot.hasKey("isDenseUltra")) {
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
}
}

public void setPlayerID(int playerID) {
Expand Down Expand Up @@ -208,22 +196,12 @@ public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreDisabled)

@Method(modid = "appliedenergistics2")
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
if (isDenseUltra()) {
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
} else if (isDense()) {
return true;
} else {
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
}
}
return false;
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
}

@Override
public IIcon getTextureForState(CollidableComponent component) {
int state = getDamageForState(isDense, isDenseUltra);
int state = getDamageForState(isDense);
if (component.dir == ForgeDirection.UNKNOWN) {
return coreTextures[state];
} else {
Expand Down Expand Up @@ -400,9 +378,4 @@ public EnumSet<ForgeDirection> getConnections() {
public boolean isDense() {
return isDense;
}

@Override
public boolean isDenseUltra() {
return isDenseUltra;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public ItemStack getMachineRepresentation() {

@Override
public EnumSet<GridFlags> getFlags() {
if (conduit.isDenseUltra()) {
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
}
if (conduit.isDense()) {
return EnumSet.of(GridFlags.DENSE_CAPACITY);
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/crazypants/enderio/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ public String lc() {

public static boolean isGasConduitEnabled = true;
public static boolean enableMEConduits = true;
public static boolean enableMEUltraDenseConduits = false;
public static boolean enableOCConduits = true;
public static boolean enableOCConduitsAnimatedTexture = true;

Expand Down Expand Up @@ -2415,11 +2414,6 @@ public static void processConfig(Configuration config) {
sectionItems.name,
enableMEConduits,
"Allows ME conduits. Only has an effect with AE2 installed.");
enableMEUltraDenseConduits = config.getBoolean(
"enableMEUltraDenseConduits",
sectionItems.name,
enableMEUltraDenseConduits,
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
enableOCConduits = config.getBoolean(
"enableOCConduits",
sectionItems.name,
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/crazypants/enderio/waila/WailaCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,13 @@ private void getWailaBodyConduitBundle(ItemStack itemStack, List<String> current
} else if (itemStack.getItem() == EnderIO.itemMEConduit) {
NBTTagCompound nbtRoot = accessor.getNBTData();
if (nbtRoot.hasKey("isDense")) {
boolean isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
boolean isDense = nbtRoot.getBoolean("isDense");
int channelsInUse = nbtRoot.getInteger("channelsInUse");
currenttip.add(
MessageFormat.format(
EnderIO.lang.localize("itemMEConduit.channelsUsed"),
channelsInUse,
isDenseUltra ? 128 : (isDense ? 32 : 8)));
isDense ? 32 : 8));
}
}
}
Expand Down Expand Up @@ -387,7 +386,6 @@ public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCom
if (mec != null) {
tag.setInteger("channelsInUse", mec.getChannelsInUse());
tag.setBoolean("isDense", mec.isDense());
tag.setBoolean("isDenseUltra", mec.isDenseUltra());
}
} else if (te instanceof IInternalPoweredTile) {
IInternalPoweredTile ipte = (IInternalPoweredTile) te;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/assets/enderio/lang/de_DE.lang
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ enderio.itemGasConduit.tooltip.detailed.line1=Transportiert Mekanism-kompatible

enderio.itemMEConduit.name=ME-Leitung
enderio.itemMEConduitDense.name=Dichte ME-Leitung
enderio.itemMEConduitDenseUltra.name=Extrem Dichte ME-Leitungen
enderio.itemMEConduit.channelsUsed={0,number} von {1,number} Kanälen

enderio.itemOCConduit.name=Netzwerkleitung (OC)
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/assets/enderio/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ enderio.itemGasConduit.tooltip.detailed.line1=Transfers Mekanism-compatible gase

enderio.itemMEConduit.name=ME Conduit
enderio.itemMEConduitDense.name=Dense ME Conduit
enderio.itemMEConduitDenseUltra.name=Ultra Dense ME Conduit
enderio.itemMEConduit.channelsUsed={0,number} of {1,number} Channels

enderio.itemOCConduit.name=Network Conduit (OC)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 346bbf4

Please sign in to comment.