Show only Export Bus on Crafting Card instead of Import/Exprot Bus.

This commit is contained in:
AlgorithmX2
2014-07-12 20:02:40 -05:00
parent 4748db9e74
commit 859ee9eaae
5 changed files with 36 additions and 10 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
if ( j.getKey().getItem() instanceof IItemGroup ) if ( j.getKey().getItem() instanceof IItemGroup )
{ {
IItemGroup ig = (IItemGroup) j.getKey().getItem(); IItemGroup ig = (IItemGroup) j.getKey().getItem();
String str = ig.getUnlocalizedGroupName( j.getKey() ); String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() );
if ( str != null ) if ( str != null )
name = Platform.gui_localize( str ) + (limit > 1 ? " (" + limit + ")" : ""); name = Platform.gui_localize( str ) + (limit > 1 ? " (" + limit + ")" : "");
} }
+29 -6
View File
@@ -7,6 +7,7 @@ import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -226,15 +227,37 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
} }
@Override @Override
public String getUnlocalizedGroupName(ItemStack is) public String getUnlocalizedGroupName(Set<ItemStack> others, ItemStack is)
{ {
switch (getTypeByStack( is )) boolean importBus = false, exportBus = false, group = false;
PartType u = getTypeByStack( is );
for (ItemStack stack : others)
{ {
case ImportBus: if ( stack.getItem() == this )
case ExportBus: {
return GuiText.IOBuses.getUnlocalized(); PartType pt = getTypeByStack( stack );
default: switch (pt)
{
case ImportBus:
importBus = true;
if ( u == pt )
group = true;
break;
case ExportBus:
exportBus = true;
if ( u == pt )
group = true;
break;
default:
}
}
} }
if ( group && importBus && exportBus )
return GuiText.IOBuses.getUnlocalized();
return null; return null;
} }
+2 -1
View File
@@ -2,6 +2,7 @@ package appeng.items.storage;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
@@ -167,7 +168,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
} }
@Override @Override
public String getUnlocalizedGroupName(ItemStack is) public String getUnlocalizedGroupName(Set<ItemStack> others, ItemStack is)
{ {
return GuiText.StorageCells.getUnlocalized(); return GuiText.StorageCells.getUnlocalized();
} }
+2 -1
View File
@@ -4,6 +4,7 @@ import java.util.Collections;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Set;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockDispenser;
@@ -316,7 +317,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
} }
@Override @Override
public String getUnlocalizedGroupName(ItemStack is) public String getUnlocalizedGroupName(Set<ItemStack> others, ItemStack is)
{ {
return GuiText.StorageCells.getUnlocalized(); return GuiText.StorageCells.getUnlocalized();
} }
+2 -1
View File
@@ -2,6 +2,7 @@ package appeng.items.tools.powered;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@@ -133,7 +134,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
} }
@Override @Override
public String getUnlocalizedGroupName(ItemStack is) public String getUnlocalizedGroupName(Set<ItemStack> others, ItemStack is)
{ {
return GuiText.StorageCells.getUnlocalized(); return GuiText.StorageCells.getUnlocalized();
} }