Code cleanup (null checks & BeamFrequency)
This commit is contained in:
parent
5bcb64edcf
commit
e8452e0dbf
6 changed files with 7 additions and 14 deletions
|
@ -55,9 +55,8 @@ public class ItemBlockAbstractBase extends ItemBlock implements IItemBase {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(final ItemStack itemStack) {
|
||||
public String getTranslationKey(@Nonnull final ItemStack itemStack) {
|
||||
if ( hasUniqueName
|
||||
|| itemStack == null
|
||||
|| !(block instanceof BlockAbstractContainer)
|
||||
|| !((BlockAbstractContainer) block).hasSubBlocks ) {
|
||||
return getTranslationKey();
|
||||
|
|
|
@ -15,10 +15,7 @@ public class ItemBlockDecorative extends ItemBlockAbstractBase {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(final ItemStack itemStack) {
|
||||
if (itemStack == null) {
|
||||
return getTranslationKey();
|
||||
}
|
||||
public String getTranslationKey(@Nonnull final ItemStack itemStack) {
|
||||
return getTranslationKey() + EnumDecorativeType.byMetadata(itemStack.getItemDamage()).getName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,10 +30,7 @@ public class ItemBlockForceFieldProjector extends ItemBlockAbstractBase {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(final ItemStack itemStack) {
|
||||
if (itemStack == null) {
|
||||
return getTranslationKey();
|
||||
}
|
||||
public String getTranslationKey(@Nonnull final ItemStack itemStack) {
|
||||
return getTranslationKey() + (itemStack.getItemDamage() == 1 ? ".double" : ".single");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ public class ItemBlockHull extends ItemBlockAbstractBase {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(final ItemStack itemStack) {
|
||||
if (itemStack == null || block instanceof BlockHullStairs) {
|
||||
public String getTranslationKey(@Nonnull final ItemStack itemStack) {
|
||||
if (block instanceof BlockHullStairs) {
|
||||
return getTranslationKey();
|
||||
}
|
||||
return getTranslationKey() + EnumDyeColor.byMetadata( itemStack.getItemDamage() ).getTranslationKey();
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ItemBlockHullSlab extends ItemBlockHull {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(final ItemStack itemstack) {
|
||||
public String getTranslationKey(@Nonnull final ItemStack itemstack) {
|
||||
return getTranslationKey();
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyCoreOrCon
|
|||
}
|
||||
|
||||
// frequency status
|
||||
isConnected = beamFrequency > 0 && beamFrequency <= IBeamFrequency.BEAM_FREQUENCY_MAX;
|
||||
isConnected = IBeamFrequency.isValid(beamFrequency);
|
||||
|
||||
// always cool down
|
||||
if (tickCooldown > 0) {
|
||||
|
|
Loading…
Reference in a new issue