Internal change to fix Named Inventories. This change will not affect the reobfed version (much).

This commit is contained in:
Gunther De Wachter
2017-07-03 05:54:25 +02:00
parent e96339dd2b
commit 780ce89ac3
7 changed files with 25 additions and 20 deletions
+9 -4
View File
@@ -55,7 +55,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor
@Override
public String getName()
{
return this.getCustomName();
return this.getCustomInventoryName();
}
@TileEvent( TileEventType.WORLD_NBT_READ )
@@ -124,9 +124,14 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor
* Returns if the inventory is named
*/
@Override
public boolean hasCustomName()
public boolean hasCustomInventoryName()
{
return this.getInternalInventory().hasCustomName();
return super.hasCustomInventoryName();
}
@Override
public boolean hasCustomName() {
return this.hasCustomInventoryName();
}
@Override
@@ -218,7 +223,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventor
{
if( this.hasCustomName() )
{
return new TextComponentString( this.getCustomName() );
return new TextComponentString( this.getCustomInventoryName() );
}
return new TextComponentTranslation( this.getBlockType().getUnlocalizedName() );
}
+5 -5
View File
@@ -570,10 +570,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
{
final NBTTagCompound output = new NBTTagCompound();
if( this.hasCustomName() )
if( this.hasCustomInventoryName() )
{
final NBTTagCompound dsp = new NBTTagCompound();
dsp.setString( "Name", this.getCustomName() );
dsp.setString( "Name", this.getCustomInventoryName() );
output.setTag( "display", dsp );
}
@@ -605,13 +605,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
}
@Override
public String getCustomName()
public String getCustomInventoryName()
{
return this.hasCustomName() ? this.customName : this.getClass().getSimpleName();
return this.hasCustomInventoryName() ? this.customName : this.getClass().getSimpleName();
}
@Override
public boolean hasCustomName()
public boolean hasCustomInventoryName()
{
return this.customName != null && this.customName.length() > 0;
}