Fixed walkie talkies stacking, they now glow when in on state
This commit is contained in:
parent
3dc2f49f76
commit
c0651a9377
4 changed files with 20 additions and 6 deletions
|
@ -35,10 +35,6 @@ public final class ItemRetriever
|
|||
* registered later in order to hook into other mods. In a rare circumstance you may
|
||||
* have to add "after:Mekanism" in the @Mod 'dependencies' annotation.
|
||||
*
|
||||
* Note that you will be able to retrieve items that Mekanism has retrieved
|
||||
* from other mods. In other words, if IC2 is installed, 'getItem("GoldDust")' will
|
||||
* return IndustrialCraft gold dust.
|
||||
*
|
||||
* @param identifier - a String to be searched in the 'Mekanism' class
|
||||
* @return an ItemStack of the declared identifier, otherwise null.
|
||||
*/
|
||||
|
|
|
@ -72,7 +72,17 @@ public class ItemRenderingHandler implements IItemRenderer
|
|||
}
|
||||
else if(item.getItem() instanceof ItemWalkieTalkie)
|
||||
{
|
||||
if(((ItemWalkieTalkie)item.getItem()).getOn(item))
|
||||
{
|
||||
MekanismRenderer.glowOn();
|
||||
}
|
||||
|
||||
MekanismRenderer.renderItem(item);
|
||||
|
||||
if(((ItemWalkieTalkie)item.getItem()).getOn(item))
|
||||
{
|
||||
MekanismRenderer.glowOff();
|
||||
}
|
||||
}
|
||||
else if(item.getItem() instanceof ItemBlockMachine && item.getItemDamage() == MachineType.ELECTRIC_CHEST.meta)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ public class ItemWalkieTalkie extends ItemMekanism
|
|||
public ItemWalkieTalkie(int id)
|
||||
{
|
||||
super(id);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -864,7 +864,7 @@ public final class MekanismUtils
|
|||
* Retrieves a private value from a defined class and field.
|
||||
* @param obj - the Object to retrieve the value from, null if static
|
||||
* @param c - Class to retrieve field value from
|
||||
* @param field - name of declared field
|
||||
* @param fields - possible names of field to iterate through
|
||||
* @return value as an Object, cast as necessary
|
||||
*/
|
||||
public static Object getPrivateValue(Object obj, Class c, String[] fields)
|
||||
|
@ -888,7 +888,7 @@ public final class MekanismUtils
|
|||
* @param obj - the Object to perform the operation on, null if static
|
||||
* @param value - value to set the field to
|
||||
* @param c - Class the operation will be performed on
|
||||
* @param field - name of declared field
|
||||
* @param fields - possible names of field to iterate through
|
||||
*/
|
||||
public static void setPrivateValue(Object obj, Object value, Class c, String[] fields)
|
||||
{
|
||||
|
@ -904,6 +904,13 @@ public final class MekanismUtils
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a private method from a class, sets it as accessible, and returns it.
|
||||
* @param c - Class the method is located in
|
||||
* @param methods - possible names of the method to iterate through
|
||||
* @param params - the Types inserted as parameters into the method
|
||||
* @return private method
|
||||
*/
|
||||
public static Method getPrivateMethod(Class c, String[] methods, Class... params)
|
||||
{
|
||||
for(String method : methods)
|
||||
|
|
Loading…
Add table
Reference in a new issue