From e718c9863bee5333cea5e45d7daa4163cb1c6aeb Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 27 Jul 2018 10:59:58 +0200 Subject: [PATCH] Code cleanup --- src/main/java/cr0s/warpdrive/WarpDrive.java | 9 +- .../warpdrive/block/BlockAbstractBase.java | 2 +- .../block/BlockAbstractContainer.java | 12 +- .../block/BlockAbstractOmnipanel.java | 4 +- .../block/BlockAbstractRotatingContainer.java | 2 +- .../warpdrive/block/BlockChunkLoader.java | 5 +- .../warpdrive/block/BlockLaserMedium.java | 4 +- .../warpdrive/block/BlockSecurityStation.java | 2 - .../block/TileEntityAbstractEnergy.java | 4 +- .../atomic/BlockAbstractAccelerator.java | 2 +- .../atomic/BlockAcceleratorControlPoint.java | 5 +- .../atomic/BlockAcceleratorController.java | 5 +- .../warpdrive/block/atomic/BlockChiller.java | 5 +- .../block/atomic/BlockParticlesCollider.java | 5 +- .../block/atomic/BlockParticlesInjector.java | 5 +- .../TileEntityAcceleratorControlPoint.java | 2 +- .../block/breathing/BlockAbstractAir.java | 12 +- .../breathing/BlockAirGeneratorTiered.java | 9 +- .../block/breathing/BlockAirShield.java | 6 +- .../block/breathing/BlockAirSource.java | 6 +- .../block/collection/BlockLaserTreeFarm.java | 4 +- .../block/collection/BlockMiningLaser.java | 4 +- .../block/decoration/BlockAbstractLamp.java | 18 +- .../block/decoration/BlockBedrockGlass.java | 16 +- .../block/decoration/BlockDecorative.java | 4 +- .../warpdrive/block/decoration/BlockGas.java | 24 +- .../block/decoration/BlockLamp_bubble.java | 6 +- .../block/decoration/BlockLamp_flat.java | 4 +- .../block/decoration/BlockLamp_long.java | 4 +- .../block/detection/BlockCloakingCoil.java | 15 +- .../block/detection/BlockCloakingCore.java | 4 +- .../warpdrive/block/detection/BlockRadar.java | 4 +- .../warpdrive/block/detection/BlockSiren.java | 3 +- .../block/detection/TileEntitySiren.java | 2 +- .../energy/BlockEnanReactorFrameGlass.java | 4 +- .../energy/BlockEnanReactorFramePlain.java | 4 +- .../forcefield/BlockAbstractForceField.java | 2 +- .../block/forcefield/BlockForceField.java | 12 +- .../forcefield/BlockForceFieldProjector.java | 20 +- .../forcefield/BlockForceFieldRelay.java | 8 +- .../TileEntityForceFieldProjector.java | 4 +- .../warpdrive/block/hull/BlockHullGlass.java | 6 +- .../block/hull/BlockHullOmnipanel.java | 6 +- .../warpdrive/block/hull/BlockHullPlain.java | 6 +- .../warpdrive/block/hull/BlockHullSlab.java | 18 +- .../warpdrive/block/hull/BlockHullStairs.java | 2 +- .../block/hull/ItemBlockHullSlab.java | 9 +- .../warpdrive/block/movement/BlockLift.java | 4 +- .../movement/BlockTransporterContainment.java | 3 +- .../movement/BlockTransporterScanner.java | 2 +- .../movement/TileEntityShipController.java | 4 - .../block/weapon/BlockLaserCamera.java | 2 +- .../compat/CompatCarpentersBlocks.java | 8 +- .../warpdrive/compat/CompatWarpDrive.java | 6 +- .../warpdrive/config/WarpDriveConfig.java | 448 +++++++++--------- .../config/structures/OrbInstance.java | 1 + .../java/cr0s/warpdrive/data/VectorI.java | 12 +- .../cr0s/warpdrive/event/ClientHandler.java | 1 + .../java/cr0s/warpdrive/item/ItemAirTank.java | 6 +- .../cr0s/warpdrive/item/ItemComponent.java | 6 +- .../warpdrive/item/ItemForceFieldShape.java | 6 +- .../cr0s/warpdrive/item/ItemTuningDriver.java | 6 +- .../cr0s/warpdrive/item/ItemTuningFork.java | 6 +- .../cr0s/warpdrive/item/ItemWarpArmor.java | 1 + .../decoration/lamp_bubble.mtl | 0 .../decoration/lamp_bubble.obj | 0 .../{item => block}/decoration/lamp_flat.mtl | 0 .../{item => block}/decoration/lamp_flat.obj | 0 .../{item => block}/decoration/lamp_long.mtl | 0 .../{item => block}/decoration/lamp_long.obj | 0 70 files changed, 436 insertions(+), 405 deletions(-) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_bubble.mtl (100%) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_bubble.obj (100%) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_flat.mtl (100%) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_flat.obj (100%) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_long.mtl (100%) rename src/main/resources/assets/warpdrive/models/{item => block}/decoration/lamp_long.obj (100%) diff --git a/src/main/java/cr0s/warpdrive/WarpDrive.java b/src/main/java/cr0s/warpdrive/WarpDrive.java index 70592316..22526fcf 100644 --- a/src/main/java/cr0s/warpdrive/WarpDrive.java +++ b/src/main/java/cr0s/warpdrive/WarpDrive.java @@ -782,11 +782,8 @@ public class WarpDrive { // Register a Block with the default ItemBlock class. public static BLOCK register(final BLOCK block) { - if (block instanceof IBlockBase) { - return register(block, ((IBlockBase) block).createItemBlock()); - } else { - return register(block, new ItemBlock(block)); - } + assert block instanceof IBlockBase; + return register(block, ((IBlockBase) block).createItemBlock()); } // Register a Block with a custom ItemBlock class. @@ -1035,4 +1032,4 @@ public class WarpDrive { event.getRegistry().register(villagerProfession); } } -} +} \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/block/BlockAbstractBase.java b/src/main/java/cr0s/warpdrive/block/BlockAbstractBase.java index 76e7e6d5..20e015b3 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockAbstractBase.java +++ b/src/main/java/cr0s/warpdrive/block/BlockAbstractBase.java @@ -78,7 +78,7 @@ public abstract class BlockAbstractBase extends Block implements IBlockBase { super.onBlockPlacedBy(world, blockPos, blockState, entityLiving, itemStack); final boolean isRotating = blockState.getProperties().containsKey(BlockProperties.FACING); if (isRotating) { - EnumFacing enumFacing = Commons.getFacingFromEntity(entityLiving); + final EnumFacing enumFacing = Commons.getFacingFromEntity(entityLiving); world.setBlockState(blockPos, blockState.withProperty(BlockProperties.FACING, enumFacing)); } } diff --git a/src/main/java/cr0s/warpdrive/block/BlockAbstractContainer.java b/src/main/java/cr0s/warpdrive/block/BlockAbstractContainer.java index d43be759..2ab41ac8 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockAbstractContainer.java +++ b/src/main/java/cr0s/warpdrive/block/BlockAbstractContainer.java @@ -62,8 +62,6 @@ public abstract class BlockAbstractContainer extends BlockContainer implements I setCreativeTab(WarpDrive.creativeTabMain); setRegistryName(registryName); WarpDrive.register(this); - - setDefaultState(blockState.getBaseState()); } @Nullable @@ -82,13 +80,13 @@ public abstract class BlockAbstractContainer extends BlockContainer implements I @SuppressWarnings("deprecation") @Nonnull @Override - public EnumBlockRenderType getRenderType(final IBlockState state) { + public EnumBlockRenderType getRenderType(final IBlockState blockState) { return EnumBlockRenderType.MODEL; } @Override - public void onBlockAdded(final World world, final BlockPos pos, final IBlockState state) { - super.onBlockAdded(world, pos, state); + public void onBlockAdded(final World world, final BlockPos pos, final IBlockState blockState) { + super.onBlockAdded(world, pos, blockState); final TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof IBlockUpdateDetector) { ((IBlockUpdateDetector) tileEntity).onBlockUpdateDetected(); @@ -143,8 +141,8 @@ public abstract class BlockAbstractContainer extends BlockContainer implements I @Nonnull @Override - public ItemStack getPickBlock(@Nonnull final IBlockState state, final RayTraceResult target, @Nonnull final World world, @Nonnull final BlockPos blockPos, final EntityPlayer entityPlayer) { - final ItemStack itemStack = super.getPickBlock(state, target, world, blockPos, entityPlayer); + public ItemStack getPickBlock(@Nonnull final IBlockState blockState, final RayTraceResult target, @Nonnull final World world, @Nonnull final BlockPos blockPos, final EntityPlayer entityPlayer) { + final ItemStack itemStack = super.getPickBlock(blockState, target, world, blockPos, entityPlayer); final TileEntity tileEntity = world.getTileEntity(blockPos); final NBTTagCompound tagCompound = new NBTTagCompound(); if (tileEntity instanceof TileEntityAbstractBase) { diff --git a/src/main/java/cr0s/warpdrive/block/BlockAbstractOmnipanel.java b/src/main/java/cr0s/warpdrive/block/BlockAbstractOmnipanel.java index 20fef940..243468d1 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockAbstractOmnipanel.java +++ b/src/main/java/cr0s/warpdrive/block/BlockAbstractOmnipanel.java @@ -72,7 +72,7 @@ public abstract class BlockAbstractOmnipanel extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public void addCollisionBoxToList(final IBlockState state, final @Nonnull World world, final @Nonnull BlockPos blockPos, + public void addCollisionBoxToList(final IBlockState blockState, final @Nonnull World world, final @Nonnull BlockPos blockPos, final @Nonnull AxisAlignedBB entityBox, final @Nonnull List collidingBoxes, final @Nullable Entity entity, boolean isActualState) { final MutableBlockPos mutableBlockPos = new MutableBlockPos(blockPos); @@ -202,7 +202,7 @@ public abstract class BlockAbstractOmnipanel extends BlockAbstractBase { @SuppressWarnings("deprecation") @Nonnull @Override - public AxisAlignedBB getBoundingBox(final IBlockState state, final IBlockAccess blockAccess, final BlockPos blockPos) { + public AxisAlignedBB getBoundingBox(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { final MutableBlockPos mutableBlockPos = new MutableBlockPos(blockPos); // get direct connections diff --git a/src/main/java/cr0s/warpdrive/block/BlockAbstractRotatingContainer.java b/src/main/java/cr0s/warpdrive/block/BlockAbstractRotatingContainer.java index 2f57852e..457cc692 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockAbstractRotatingContainer.java +++ b/src/main/java/cr0s/warpdrive/block/BlockAbstractRotatingContainer.java @@ -30,7 +30,7 @@ public abstract class BlockAbstractRotatingContainer extends BlockAbstractContai @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 7)); + .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 0x7)); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/BlockChunkLoader.java b/src/main/java/cr0s/warpdrive/block/BlockChunkLoader.java index c65a907f..d71d994f 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockChunkLoader.java +++ b/src/main/java/cr0s/warpdrive/block/BlockChunkLoader.java @@ -19,7 +19,8 @@ public class BlockChunkLoader extends BlockAbstractContainer { setTranslationKey("warpdrive.machines.chunk_loader." + enumTier.getName()); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -33,7 +34,7 @@ public class BlockChunkLoader extends BlockAbstractContainer { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/BlockLaserMedium.java b/src/main/java/cr0s/warpdrive/block/BlockLaserMedium.java index 00dbd434..2049d281 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockLaserMedium.java +++ b/src/main/java/cr0s/warpdrive/block/BlockLaserMedium.java @@ -20,7 +20,9 @@ public class BlockLaserMedium extends BlockAbstractContainer { setTranslationKey("warpdrive.machines.laser_medium." + enumTier.getName()); - setDefaultState(getDefaultState().withProperty(LEVEL, 0)); + setDefaultState(getDefaultState() + .withProperty(LEVEL, 0) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/BlockSecurityStation.java b/src/main/java/cr0s/warpdrive/block/BlockSecurityStation.java index 53008c55..506ef034 100644 --- a/src/main/java/cr0s/warpdrive/block/BlockSecurityStation.java +++ b/src/main/java/cr0s/warpdrive/block/BlockSecurityStation.java @@ -22,8 +22,6 @@ public class BlockSecurityStation extends BlockAbstractContainer { super(registryName, enumTier, Material.IRON); setTranslationKey("warpdrive.machines.security_station"); - - setDefaultState(getDefaultState()); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java index d7cc5701..fdf7f876 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java @@ -44,8 +44,8 @@ public abstract class TileEntityAbstractEnergy extends TileEntityAbstractMachine private long energyStored_internal = 0; public static final double EU_PER_INTERNAL = 1.0D; public static final double RF_PER_INTERNAL = 1800.0D / 437.5D; - public static final int IC2_sinkTier_max = Integer.MAX_VALUE; - public static final int IC2_sourceTier_max = 20; + // public static final int IC2_sinkTier_max = Integer.MAX_VALUE; + // public static final int IC2_sourceTier_max = 20; protected int IC2_sinkTier = 3; protected int IC2_sourceTier = 3; protected boolean isEnergyLostWhenBroken = true; diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockAbstractAccelerator.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockAbstractAccelerator.java index 250bcc60..90e7ef7c 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockAbstractAccelerator.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockAbstractAccelerator.java @@ -25,7 +25,7 @@ public abstract class BlockAbstractAccelerator extends BlockAbstractBase impleme } @Override - public boolean canCreatureSpawn(@Nonnull IBlockState blockState, @Nonnull IBlockAccess world, @Nonnull BlockPos blockPos, SpawnPlacementType type) { + public boolean canCreatureSpawn(@Nonnull IBlockState blockState, @Nonnull IBlockAccess blockAccess, @Nonnull BlockPos blockPos, SpawnPlacementType type) { return false; } } diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorControlPoint.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorControlPoint.java index e4b8ca4e..ca359423 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorControlPoint.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorControlPoint.java @@ -23,7 +23,8 @@ public class BlockAcceleratorControlPoint extends BlockAbstractAccelerator imple setTranslationKey("warpdrive.atomic.accelerator_control_point"); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -37,7 +38,7 @@ public class BlockAcceleratorControlPoint extends BlockAbstractAccelerator imple @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorController.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorController.java index 3bae0538..09495f41 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorController.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockAcceleratorController.java @@ -20,7 +20,8 @@ public class BlockAcceleratorController extends BlockAbstractContainer { setTranslationKey("warpdrive.atomic.accelerator_controller"); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -34,7 +35,7 @@ public class BlockAcceleratorController extends BlockAbstractContainer { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockChiller.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockChiller.java index 2d70cda8..5244d364 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockChiller.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockChiller.java @@ -35,7 +35,8 @@ public class BlockChiller extends BlockAbstractAccelerator { setTranslationKey("warpdrive.atomic.chiller." + enumTier.getName()); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -49,7 +50,7 @@ public class BlockChiller extends BlockAbstractAccelerator { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesCollider.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesCollider.java index a7d82fc3..43c2d0ed 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesCollider.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesCollider.java @@ -16,7 +16,8 @@ public class BlockParticlesCollider extends BlockAbstractAccelerator { setTranslationKey("warpdrive.atomic.particles_collider"); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -30,7 +31,7 @@ public class BlockParticlesCollider extends BlockAbstractAccelerator { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesInjector.java b/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesInjector.java index 33e1c560..0ad1a339 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesInjector.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/BlockParticlesInjector.java @@ -18,7 +18,8 @@ public class BlockParticlesInjector extends BlockAcceleratorControlPoint { setTranslationKey("warpdrive.atomic.particles_injector"); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -32,7 +33,7 @@ public class BlockParticlesInjector extends BlockAcceleratorControlPoint { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorControlPoint.java b/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorControlPoint.java index ba587f88..f1871cdf 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorControlPoint.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorControlPoint.java @@ -145,7 +145,7 @@ public class TileEntityAcceleratorControlPoint extends TileEntityAbstractMachine controlChannelRequested = Commons.toInt(arguments[0]); } catch (final Exception exception) { if (WarpDriveConfig.LOGGING_LUA) { - WarpDrive.logger.error(String.format("%s LUA error on enable(): Integer expected for 1st argument %s", + WarpDrive.logger.error(String.format("%s LUA error on controlChannel(): Integer expected for 1st argument %s", this, arguments[0])); } return new Object[] { controlChannel }; diff --git a/src/main/java/cr0s/warpdrive/block/breathing/BlockAbstractAir.java b/src/main/java/cr0s/warpdrive/block/breathing/BlockAbstractAir.java index 43ad6c60..6222e4e2 100644 --- a/src/main/java/cr0s/warpdrive/block/breathing/BlockAbstractAir.java +++ b/src/main/java/cr0s/warpdrive/block/breathing/BlockAbstractAir.java @@ -42,24 +42,24 @@ public abstract class BlockAbstractAir extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(IBlockState state) { + public boolean isFullBlock(IBlockState blockState) { return true; } @Override - public boolean isAir(final IBlockState state, final IBlockAccess blockAccess, final BlockPos pos) { + public boolean isAir(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos pos) { return true; } @@ -99,13 +99,13 @@ public abstract class BlockAbstractAir extends BlockAbstractBase { @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.DESTROY; } @Nonnull @Override - public Item getItemDropped(final IBlockState state, final Random rand, final int fortune) { + public Item getItemDropped(final IBlockState blockState, final Random rand, final int fortune) { return Items.AIR; } diff --git a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirGeneratorTiered.java b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirGeneratorTiered.java index 10833a7a..1aa3b0cd 100644 --- a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirGeneratorTiered.java +++ b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirGeneratorTiered.java @@ -31,8 +31,9 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer { setTranslationKey("warpdrive.breathing.air_generator." + enumTier.getName()); setDefaultState(getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.DOWN) - .withProperty(BlockProperties.ACTIVE, false)); + .withProperty(BlockProperties.FACING, EnumFacing.DOWN) + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull @@ -46,8 +47,8 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 7)) - .withProperty(BlockProperties.ACTIVE, (metadata & 8) != 0); + .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 0x7)) + .withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirShield.java b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirShield.java index f614755f..131564dc 100644 --- a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirShield.java +++ b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirShield.java @@ -63,19 +63,19 @@ public class BlockAirShield extends BlockAbstractOmnipanel { @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(final IBlockState state) { + public boolean isFullBlock(final IBlockState blockState) { return false; } diff --git a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirSource.java b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirSource.java index e8566c87..9bd890ea 100644 --- a/src/main/java/cr0s/warpdrive/block/breathing/BlockAirSource.java +++ b/src/main/java/cr0s/warpdrive/block/breathing/BlockAirSource.java @@ -14,7 +14,9 @@ public class BlockAirSource extends BlockAbstractAir { public BlockAirSource(final String registryName, final EnumTier enumTier) { super(registryName, enumTier); - setDefaultState(getDefaultState().withProperty(BlockProperties.FACING, EnumFacing.DOWN)); + setDefaultState(getDefaultState() + .withProperty(BlockProperties.FACING, EnumFacing.DOWN) + ); } @Nonnull @@ -28,7 +30,7 @@ public class BlockAirSource extends BlockAbstractAir { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 7)); + .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 0x7)); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/collection/BlockLaserTreeFarm.java b/src/main/java/cr0s/warpdrive/block/collection/BlockLaserTreeFarm.java index 9c077c66..69e207cc 100644 --- a/src/main/java/cr0s/warpdrive/block/collection/BlockLaserTreeFarm.java +++ b/src/main/java/cr0s/warpdrive/block/collection/BlockLaserTreeFarm.java @@ -23,7 +23,9 @@ public class BlockLaserTreeFarm extends BlockAbstractContainer { setTranslationKey("warpdrive.collection.laser_tree_farm"); - setDefaultState(getDefaultState().withProperty(MODE, EnumLaserTreeFarmMode.INACTIVE)); + setDefaultState(getDefaultState() + .withProperty(MODE, EnumLaserTreeFarmMode.INACTIVE) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/collection/BlockMiningLaser.java b/src/main/java/cr0s/warpdrive/block/collection/BlockMiningLaser.java index d896c9df..b9b23fda 100644 --- a/src/main/java/cr0s/warpdrive/block/collection/BlockMiningLaser.java +++ b/src/main/java/cr0s/warpdrive/block/collection/BlockMiningLaser.java @@ -23,7 +23,9 @@ public class BlockMiningLaser extends BlockAbstractContainer { setTranslationKey("warpdrive.collection.mining_laser"); - setDefaultState(getDefaultState().withProperty(MODE, EnumMiningLaserMode.INACTIVE)); + setDefaultState(getDefaultState() + .withProperty(MODE, EnumMiningLaserMode.INACTIVE) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockAbstractLamp.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockAbstractLamp.java index a41d8b6d..c20c838b 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockAbstractLamp.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockAbstractLamp.java @@ -33,7 +33,9 @@ public class BlockAbstractLamp extends BlockAbstractBase { setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[0] * 5 / 3); setSoundType(SoundType.METAL); setTranslationKey(unlocalizedName); - setDefaultState(blockState.getBaseState().withProperty(BlockProperties.FACING, EnumFacing.NORTH)); + setDefaultState(getDefaultState() + .withProperty(BlockProperties.FACING, EnumFacing.DOWN) + ); setLightLevel(14.0F / 15.0F); } @@ -51,7 +53,7 @@ public class BlockAbstractLamp extends BlockAbstractBase { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 7)); + .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 0x7)); } @Override @@ -74,13 +76,13 @@ public class BlockAbstractLamp extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullCube(final IBlockState state) { + public boolean isFullCube(final IBlockState blockState) { return false; } @@ -94,14 +96,14 @@ public class BlockAbstractLamp extends BlockAbstractBase { @Nonnull @SuppressWarnings("deprecation") @Override - public IBlockState withRotation(@Nonnull final IBlockState state, final Rotation rot) { - return state.withProperty(BlockProperties.FACING, rot.rotate(state.getValue(BlockProperties.FACING))); + public IBlockState withRotation(@Nonnull final IBlockState blockState, final Rotation rot) { + return blockState.withProperty(BlockProperties.FACING, rot.rotate(blockState.getValue(BlockProperties.FACING))); } @Nonnull @SuppressWarnings("deprecation") @Override - public IBlockState withMirror(@Nonnull final IBlockState state, final Mirror mirrorIn) { - return state.withRotation(mirrorIn.toRotation(state.getValue(BlockProperties.FACING))); + public IBlockState withMirror(@Nonnull final IBlockState blockState, final Mirror mirrorIn) { + return blockState.withRotation(mirrorIn.toRotation(blockState.getValue(BlockProperties.FACING))); } } \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java index 3135f7f6..2dbb189f 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java @@ -37,47 +37,47 @@ public class BlockBedrockGlass extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(IBlockState state) { + public boolean isFullBlock(final IBlockState blockState) { return true; } @Override - public boolean isAir(final IBlockState state, final IBlockAccess world, final BlockPos pos) { + public boolean isAir(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos pos) { return false; } @Override - public boolean isReplaceable(final IBlockAccess worldIn, @Nonnull final BlockPos blockPos) { + public boolean isReplaceable(final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos) { return false; } @Override - public boolean canPlaceBlockAt(final World worldIn, @Nonnull final BlockPos blockPos) { + public boolean canPlaceBlockAt(final World world, @Nonnull final BlockPos blockPos) { return true; } @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } @Nonnull @Override - public Item getItemDropped(final IBlockState state, final Random rand, final int fortune) { + public Item getItemDropped(final IBlockState blockState, final Random rand, final int fortune) { return Items.AIR; } diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java index 10f68f8c..75732b69 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java @@ -28,7 +28,9 @@ public class BlockDecorative extends BlockAbstractBase { setHardness(1.5f); setTranslationKey("warpdrive.decoration.decorative."); - setDefaultState(getDefaultState().withProperty(TYPE, EnumDecorativeType.PLAIN)); + setDefaultState(getDefaultState() + .withProperty(TYPE, EnumDecorativeType.PLAIN) + ); itemStackCache = new ItemStack[EnumDecorativeType.length]; } diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java index a17f46ee..a4d2949f 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java @@ -42,7 +42,9 @@ public class BlockGas extends BlockAbstractBase { setHardness(0.0F); setTranslationKey("warpdrive.decoration.gas"); - setDefaultState(getDefaultState().withProperty(COLOR, EnumGasColor.RED)); + setDefaultState(getDefaultState() + .withProperty(COLOR, EnumGasColor.RED) + ); } @Nonnull @@ -84,24 +86,24 @@ public class BlockGas extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(IBlockState state) { + public boolean isFullBlock(IBlockState blockState) { return true; } @Override - public boolean isAir(final IBlockState state, final IBlockAccess world, final BlockPos pos) { + public boolean isAir(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos pos) { return true; } @@ -113,30 +115,30 @@ public class BlockGas extends BlockAbstractBase { } @Override - public boolean isReplaceable(final IBlockAccess worldIn, @Nonnull final BlockPos blockPos) { + public boolean isReplaceable(final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos) { return true; } @Override - public boolean canPlaceBlockAt(final World worldIn, @Nonnull final BlockPos blockPos) { + public boolean canPlaceBlockAt(final World world, @Nonnull final BlockPos blockPos) { return true; } @Override - public boolean canCollideCheck(final IBlockState state, final boolean hitIfLiquid) { + public boolean canCollideCheck(final IBlockState blockState, final boolean hitIfLiquid) { return false; } @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.DESTROY; } @Nonnull @Override - public Item getItemDropped(final IBlockState state, final Random rand, final int fortune) { + public Item getItemDropped(final IBlockState blockState, final Random rand, final int fortune) { return Items.AIR; } @@ -147,7 +149,7 @@ public class BlockGas extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean isTranslucent(final IBlockState state) { + public boolean isTranslucent(final IBlockState blockState) { return true; } diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_bubble.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_bubble.java index 8e286ab7..9b6c0283 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_bubble.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_bubble.java @@ -30,8 +30,8 @@ public class BlockLamp_bubble extends BlockAbstractLamp { @Nonnull @SuppressWarnings("deprecation") @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - switch (state.getValue(BlockProperties.FACING)) { + public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess source, BlockPos pos) { + switch (blockState.getValue(BlockProperties.FACING)) { case DOWN : return AABB_DOWN ; case UP : return AABB_UP ; case NORTH: return AABB_NORTH; @@ -44,7 +44,7 @@ public class BlockLamp_bubble extends BlockAbstractLamp { @SuppressWarnings("deprecation") @Override - public boolean isTranslucent(final IBlockState state) { + public boolean isTranslucent(final IBlockState blockState) { return true; } diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_flat.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_flat.java index f459da23..255ca6cd 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_flat.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_flat.java @@ -26,8 +26,8 @@ public class BlockLamp_flat extends BlockAbstractLamp { @Nonnull @SuppressWarnings("deprecation") @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - switch (state.getValue(BlockProperties.FACING)) { + public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess source, BlockPos pos) { + switch (blockState.getValue(BlockProperties.FACING)) { case DOWN : return AABB_DOWN ; case UP : return AABB_UP ; case NORTH: return AABB_NORTH; diff --git a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_long.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_long.java index 4c3be345..8fabe4fb 100644 --- a/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_long.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockLamp_long.java @@ -26,8 +26,8 @@ public class BlockLamp_long extends BlockAbstractLamp { @Nonnull @SuppressWarnings("deprecation") @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - switch (state.getValue(BlockProperties.FACING)) { + public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess source, BlockPos pos) { + switch (blockState.getValue(BlockProperties.FACING)) { case DOWN : return AABB_DOWN ; case UP : return AABB_UP ; case NORTH: return AABB_NORTH; diff --git a/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCoil.java b/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCoil.java index 461f767c..9031748b 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCoil.java +++ b/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCoil.java @@ -33,9 +33,10 @@ public class BlockCloakingCoil extends BlockAbstractBase { setTranslationKey("warpdrive.detection.cloaking_coil"); setDefaultState(getDefaultState() - .withProperty(BlockProperties.ACTIVE, false) - .withProperty(OUTER, false) - .withProperty(BlockProperties.FACING, EnumFacing.UP)); + .withProperty(BlockProperties.ACTIVE, false) + .withProperty(OUTER, false) + .withProperty(BlockProperties.FACING, EnumFacing.UP) + ); } @Nonnull @@ -53,12 +54,12 @@ public class BlockCloakingCoil extends BlockAbstractBase { // 7 = not used // 1-6 = outer facing // 0 = inner - final boolean isActive = (metadata & 8) != 0; - final boolean isOuter = (metadata & 7) > 0; + final boolean isActive = (metadata & 0x8) != 0; + final boolean isOuter = (metadata & 0x7) > 0; return getDefaultState() .withProperty(BlockProperties.ACTIVE, isActive) .withProperty(OUTER, isOuter) - .withProperty(BlockProperties.FACING, isOuter ? EnumFacing.byIndex((metadata & 7) - 1) : EnumFacing.UP); + .withProperty(BlockProperties.FACING, isOuter ? EnumFacing.byIndex((metadata & 0x7) - 1) : EnumFacing.UP); } @SuppressWarnings("deprecation") @@ -69,7 +70,7 @@ public class BlockCloakingCoil extends BlockAbstractBase { } public static void setBlockState(@Nonnull final World world, @Nonnull final BlockPos blockPos, final boolean isActive, final boolean isOuter, final EnumFacing enumFacing) { - IBlockState blockStateActual = world.getBlockState(blockPos); + final IBlockState blockStateActual = world.getBlockState(blockPos); IBlockState blockStateNew = blockStateActual.withProperty(BlockProperties.ACTIVE, isActive).withProperty(OUTER, isOuter); if (enumFacing != null) { blockStateNew = blockStateNew.withProperty(BlockProperties.FACING, enumFacing); diff --git a/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCore.java b/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCore.java index 816b6598..10689360 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCore.java +++ b/src/main/java/cr0s/warpdrive/block/detection/BlockCloakingCore.java @@ -28,7 +28,9 @@ public class BlockCloakingCore extends BlockAbstractContainer { setTranslationKey("warpdrive.detection.cloaking_core"); - setDefaultState(getDefaultState().withProperty(BlockProperties.ACTIVE, false)); + setDefaultState(getDefaultState() + .withProperty(BlockProperties.ACTIVE, false) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/detection/BlockRadar.java b/src/main/java/cr0s/warpdrive/block/detection/BlockRadar.java index 6e9ddd63..e9acd202 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/BlockRadar.java +++ b/src/main/java/cr0s/warpdrive/block/detection/BlockRadar.java @@ -23,7 +23,9 @@ public class BlockRadar extends BlockAbstractContainer { setTranslationKey("warpdrive.detection.radar"); - setDefaultState(getDefaultState().withProperty(MODE, EnumRadarMode.INACTIVE)); + setDefaultState(getDefaultState() + .withProperty(MODE, EnumRadarMode.INACTIVE) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/detection/BlockSiren.java b/src/main/java/cr0s/warpdrive/block/detection/BlockSiren.java index 88b6282a..2c5acba8 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/BlockSiren.java +++ b/src/main/java/cr0s/warpdrive/block/detection/BlockSiren.java @@ -36,7 +36,8 @@ public class BlockSiren extends BlockAbstractContainer { setDefaultState(getDefaultState() .withProperty(BlockProperties.ACTIVE, false) - .withProperty(BlockProperties.FACING, EnumFacing.DOWN) ); + .withProperty(BlockProperties.FACING, EnumFacing.DOWN) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/detection/TileEntitySiren.java b/src/main/java/cr0s/warpdrive/block/detection/TileEntitySiren.java index 205281d1..8c098856 100644 --- a/src/main/java/cr0s/warpdrive/block/detection/TileEntitySiren.java +++ b/src/main/java/cr0s/warpdrive/block/detection/TileEntitySiren.java @@ -58,7 +58,7 @@ public class TileEntitySiren extends TileEntityAbstractMachine { } else { return; } - + if ( world == null || !world.isRemote ) { return; diff --git a/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFrameGlass.java b/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFrameGlass.java index d59b117f..cbf2448f 100644 --- a/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFrameGlass.java +++ b/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFrameGlass.java @@ -29,13 +29,13 @@ public class BlockEnanReactorFrameGlass extends BlockAbstractBase { @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isTranslucent(final IBlockState state) { + public boolean isTranslucent(final IBlockState blockState) { return true; } diff --git a/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFramePlain.java b/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFramePlain.java index ed48e23a..c0de7a00 100644 --- a/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFramePlain.java +++ b/src/main/java/cr0s/warpdrive/block/energy/BlockEnanReactorFramePlain.java @@ -30,7 +30,9 @@ public class BlockEnanReactorFramePlain extends BlockAbstractBase { setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[enumTier.getIndex()] / 3 * 5 / 3); setTranslationKey("warpdrive.energy.enan_reactor_frame." + enumTier.getName()); - setDefaultState(blockState.getBaseState().withProperty(BlockProperties.FRAME, EnumFrameType.PLAIN)); + setDefaultState(getDefaultState() + .withProperty(BlockProperties.FRAME, EnumFrameType.PLAIN) + ); } @SuppressWarnings("deprecation") diff --git a/src/main/java/cr0s/warpdrive/block/forcefield/BlockAbstractForceField.java b/src/main/java/cr0s/warpdrive/block/forcefield/BlockAbstractForceField.java index 081e4ac5..55b2f8a0 100644 --- a/src/main/java/cr0s/warpdrive/block/forcefield/BlockAbstractForceField.java +++ b/src/main/java/cr0s/warpdrive/block/forcefield/BlockAbstractForceField.java @@ -24,7 +24,7 @@ public abstract class BlockAbstractForceField extends BlockAbstractContainer { @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } diff --git a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceField.java b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceField.java index a3fd637a..e64b1440 100644 --- a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceField.java +++ b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceField.java @@ -77,8 +77,8 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR setBlockUnbreakable(); setDefaultState(getDefaultState() - .withProperty(FREQUENCY, 0) - ); + .withProperty(FREQUENCY, 0) + ); } @Nonnull @@ -178,19 +178,19 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(IBlockState state) { + public boolean isFullBlock(final IBlockState blockState) { return false; } @@ -207,7 +207,7 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR @Nonnull @Override - public EnumBlockRenderType getRenderType(final IBlockState state) { + public EnumBlockRenderType getRenderType(final IBlockState blockState) { return EnumBlockRenderType.MODEL; } diff --git a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldProjector.java b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldProjector.java index e99d4756..4c41e2df 100644 --- a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldProjector.java +++ b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldProjector.java @@ -62,9 +62,9 @@ public class BlockForceFieldProjector extends BlockAbstractForceField { setTranslationKey("warpdrive.force_field.projector." + enumTier.getName()); setDefaultState(getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.NORTH) - .withProperty(IS_DOUBLE_SIDED, false) - ); + .withProperty(BlockProperties.FACING, EnumFacing.DOWN) + .withProperty(IS_DOUBLE_SIDED, false) + ); } @Nonnull @@ -80,7 +80,7 @@ public class BlockForceFieldProjector extends BlockAbstractForceField { @Override public IBlockState getStateFromMeta(final int metadata) { return getDefaultState() - .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 7)) + .withProperty(BlockProperties.FACING, EnumFacing.byIndex(metadata & 0x7)) .withProperty(IS_DOUBLE_SIDED, metadata > 7); } @@ -134,21 +134,21 @@ public class BlockForceFieldProjector extends BlockAbstractForceField { @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @SuppressWarnings("deprecation") @Override - public boolean isFullCube(final IBlockState state) { + public boolean isFullCube(final IBlockState blockState) { return false; } @Nonnull @SuppressWarnings("deprecation") @Override - public AxisAlignedBB getBoundingBox(final IBlockState state, final IBlockAccess source, final BlockPos pos) { - switch (state.getValue(BlockProperties.FACING)) { + public AxisAlignedBB getBoundingBox(final IBlockState blockState, final IBlockAccess source, final BlockPos pos) { + switch (blockState.getValue(BlockProperties.FACING)) { case DOWN : return AABB_DOWN ; case UP : return AABB_UP ; case NORTH: return AABB_NORTH; @@ -180,8 +180,8 @@ public class BlockForceFieldProjector extends BlockAbstractForceField { } @Override - public int damageDropped(final IBlockState state) { - return state.getValue(IS_DOUBLE_SIDED) ? 1 : 0; + public int damageDropped(final IBlockState blockState) { + return blockState.getValue(IS_DOUBLE_SIDED) ? 1 : 0; } @Override diff --git a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldRelay.java b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldRelay.java index d9f5a600..139a51da 100644 --- a/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldRelay.java +++ b/src/main/java/cr0s/warpdrive/block/forcefield/BlockForceFieldRelay.java @@ -33,7 +33,9 @@ public class BlockForceFieldRelay extends BlockAbstractForceField { setTranslationKey("warpdrive.force_field.relay." + enumTier.getName()); - setDefaultState(getDefaultState().withProperty(UPGRADE, EnumForceFieldUpgrade.NONE)); + setDefaultState(getDefaultState() + .withProperty(UPGRADE, EnumForceFieldUpgrade.NONE) + ); } @Nonnull @@ -57,8 +59,8 @@ public class BlockForceFieldRelay extends BlockAbstractForceField { @SuppressWarnings("deprecation") @Nonnull @Override - public IBlockState getActualState(@Nonnull final IBlockState blockState, final IBlockAccess world, final BlockPos pos) { - TileEntity tileEntity = world.getTileEntity(pos); + public IBlockState getActualState(@Nonnull final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos pos) { + final TileEntity tileEntity = blockAccess.getTileEntity(pos); if (tileEntity instanceof TileEntityForceFieldRelay) { return blockState.withProperty(UPGRADE, ((TileEntityForceFieldRelay) tileEntity).getUpgrade()); } else { diff --git a/src/main/java/cr0s/warpdrive/block/forcefield/TileEntityForceFieldProjector.java b/src/main/java/cr0s/warpdrive/block/forcefield/TileEntityForceFieldProjector.java index fd4d57d3..bde34713 100644 --- a/src/main/java/cr0s/warpdrive/block/forcefield/TileEntityForceFieldProjector.java +++ b/src/main/java/cr0s/warpdrive/block/forcefield/TileEntityForceFieldProjector.java @@ -892,7 +892,7 @@ public class TileEntityForceFieldProjector extends TileEntityAbstractForceField public float getRotationYaw() { final int metadata = getBlockMetadata(); float totalYaw; - switch (EnumFacing.byIndex(metadata & 7)) { + switch (EnumFacing.byIndex(metadata & 0x7)) { case DOWN : totalYaw = 0.0F; break; case UP : totalYaw = 0.0F; break; case NORTH: totalYaw = 90.0F; break; @@ -910,7 +910,7 @@ public class TileEntityForceFieldProjector extends TileEntityAbstractForceField public float getRotationPitch() { final int metadata = getBlockMetadata(); float totalPitch; - switch (EnumFacing.byIndex(metadata & 7)) { + switch (EnumFacing.byIndex(metadata & 0x7)) { case DOWN : totalPitch = 180.0F; break; case UP : totalPitch = 0.0F; break; case NORTH: totalPitch = -90.0F; break; diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java index cc830a99..45b0fd6a 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullGlass.java @@ -53,13 +53,13 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } @SuppressWarnings("deprecation") @Override - public boolean isOpaqueCube(final IBlockState state) { + public boolean isOpaqueCube(final IBlockState blockState) { return false; } @@ -89,7 +89,7 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR @SuppressWarnings("deprecation") @Override - public boolean isTranslucent(final IBlockState state) { + public boolean isTranslucent(final IBlockState blockState) { return true; } diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullOmnipanel.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullOmnipanel.java index 961fa65f..51200606 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullOmnipanel.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullOmnipanel.java @@ -38,7 +38,9 @@ public class BlockHullOmnipanel extends BlockAbstractOmnipanel implements IDamag setLightLevel(10.0F / 15.0F); setSoundType(SoundType.GLASS); setTranslationKey("warpdrive.hull." + enumTier.getName() + ".omnipanel."); - setDefaultState(blockState.getBaseState().withProperty(BlockColored.COLOR, EnumDyeColor.WHITE)); + setDefaultState(getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.WHITE) + ); setRegistryName(registryName); WarpDrive.register(this, new ItemBlockHull(this)); } @@ -46,7 +48,7 @@ public class BlockHullOmnipanel extends BlockAbstractOmnipanel implements IDamag @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullPlain.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullPlain.java index 8ca58a00..5db6d917 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullPlain.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullPlain.java @@ -41,7 +41,9 @@ public class BlockHullPlain extends BlockAbstractBase implements IDamageReceiver setHardness(WarpDriveConfig.HULL_HARDNESS[enumTier.getIndex()]); setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[enumTier.getIndex()] * 5 / 3); setTranslationKey("warpdrive.hull." + enumTier.getName() + ".plain."); - setDefaultState(blockState.getBaseState().withProperty(BlockColored.COLOR, EnumDyeColor.WHITE)); + setDefaultState(getDefaultState() + .withProperty(BlockColored.COLOR, EnumDyeColor.WHITE) + ); setCreativeTab(WarpDrive.creativeTabHull); } @@ -54,7 +56,7 @@ public class BlockHullPlain extends BlockAbstractBase implements IDamageReceiver @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullSlab.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullSlab.java index 2da53b32..90981818 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullSlab.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullSlab.java @@ -31,6 +31,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.IStringSerializable; import net.minecraft.util.NonNullList; import net.minecraft.util.math.AxisAlignedBB; @@ -76,7 +77,8 @@ public class BlockHullSlab extends BlockSlab implements IBlockBase, IDamageRecei WarpDrive.register(this, new ItemBlockHullSlab(this)); setDefaultState(getDefaultState() - .withProperty(VARIANT, EnumVariant.PLAIN_DOWN)); + .withProperty(VARIANT, EnumVariant.PLAIN_DOWN) + ); } @Nonnull @@ -101,7 +103,7 @@ public class BlockHullSlab extends BlockSlab implements IBlockBase, IDamageRecei @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } @@ -171,21 +173,21 @@ public class BlockHullSlab extends BlockSlab implements IBlockBase, IDamageRecei @SuppressWarnings("deprecation") @Override - public boolean isFullBlock(IBlockState state) { - return ((BlockSlab) state.getBlock()).isDouble(); + public boolean isFullBlock(IBlockState blockState) { + return ((BlockSlab) blockState.getBlock()).isDouble(); } @SuppressWarnings("deprecation") @Override - public boolean isFullCube(final IBlockState state) { - return ((BlockSlab) state.getBlock()).isDouble(); + public boolean isFullCube(final IBlockState blockState) { + return ((BlockSlab) blockState.getBlock()).isDouble(); } @Nonnull @Override - public IBlockState getStateForPlacement(final World world, final BlockPos blockPos, final EnumFacing facing, + public IBlockState getStateForPlacement(@Nonnull final World world, @Nonnull final BlockPos blockPos, @Nonnull final EnumFacing facing, final float hitX, final float hitY, final float hitZ, final int metadata, - final EntityLivingBase entityLivingBase) { + @Nonnull final EntityLivingBase entityLivingBase, final EnumHand enumHand) { final IBlockState blockState = getStateFromMeta(metadata); // full block? diff --git a/src/main/java/cr0s/warpdrive/block/hull/BlockHullStairs.java b/src/main/java/cr0s/warpdrive/block/hull/BlockHullStairs.java index b9ec8b16..81a3841a 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/BlockHullStairs.java +++ b/src/main/java/cr0s/warpdrive/block/hull/BlockHullStairs.java @@ -45,7 +45,7 @@ public class BlockHullStairs extends BlockStairs implements IBlockBase, IDamageR @SuppressWarnings("deprecation") @Nonnull @Override - public EnumPushReaction getPushReaction(final IBlockState state) { + public EnumPushReaction getPushReaction(final IBlockState blockState) { return EnumPushReaction.BLOCK; } diff --git a/src/main/java/cr0s/warpdrive/block/hull/ItemBlockHullSlab.java b/src/main/java/cr0s/warpdrive/block/hull/ItemBlockHullSlab.java index 3208d43b..cbc1b034 100644 --- a/src/main/java/cr0s/warpdrive/block/hull/ItemBlockHullSlab.java +++ b/src/main/java/cr0s/warpdrive/block/hull/ItemBlockHullSlab.java @@ -36,10 +36,10 @@ public class ItemBlockHullSlab extends ItemBlockHull { @Nonnull @Override public EnumActionResult onItemUse(@Nonnull final EntityPlayer entityPlayer, final World world, @Nonnull final BlockPos blockPos, - @Nonnull final EnumHand hand, @Nonnull EnumFacing facing, + @Nonnull final EnumHand enumHand, @Nonnull EnumFacing facing, final float hitX, final float hitY, final float hitZ) { // get context - final ItemStack itemStackHeld = entityPlayer.getHeldItem(hand); + final ItemStack itemStackHeld = entityPlayer.getHeldItem(enumHand); if (itemStackHeld.isEmpty()) { return EnumActionResult.FAIL; } @@ -111,8 +111,7 @@ public class ItemBlockHullSlab extends ItemBlockHull { } // try to place ignoring the existing block - @SuppressWarnings("deprecation") - final IBlockState blockStatePlaced = blockSlab.getStateForPlacement(world, blockPosSide, facing, hitX, hitY, hitZ, metadataItem, entityPlayer); + final IBlockState blockStatePlaced = blockSlab.getStateForPlacement(world, blockPosSide, facing, hitX, hitY, hitZ, metadataItem, entityPlayer, enumHand); final EnumFacing enumFacingPlaced = blockStatePlaced.getValue(BlockHullSlab.VARIANT).getFacing().getOpposite(); // try to merge slabs when right-clicking on a side block @@ -153,7 +152,7 @@ public class ItemBlockHullSlab extends ItemBlockHull { } } - return super.onItemUse(entityPlayer, world, blockPos, hand, facing, hitX, hitY, hitZ); + return super.onItemUse(entityPlayer, world, blockPos, enumHand, facing, hitX, hitY, hitZ); } @Override diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockLift.java b/src/main/java/cr0s/warpdrive/block/movement/BlockLift.java index 542bd5f8..175e2e06 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockLift.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockLift.java @@ -22,7 +22,9 @@ public class BlockLift extends BlockAbstractContainer { setTranslationKey("warpdrive.movement.lift"); - setDefaultState(getDefaultState().withProperty(MODE, EnumLiftMode.INACTIVE)); + setDefaultState(getDefaultState() + .withProperty(MODE, EnumLiftMode.INACTIVE) + ); } @Nonnull diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterContainment.java b/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterContainment.java index 6b4e247a..80438f58 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterContainment.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterContainment.java @@ -30,10 +30,11 @@ public class BlockTransporterContainment extends BlockAbstractBase { } @Override - public boolean isNormalCube(final IBlockState state, final IBlockAccess blockAccess, final BlockPos blockPos) { + public boolean isNormalCube(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { return false; } + @SuppressWarnings("deprecation") @Override public boolean isSideSolid(final IBlockState blockState, @Nonnull final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos, final EnumFacing side) { return side == EnumFacing.DOWN; diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterScanner.java b/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterScanner.java index 95283be8..f3bb4bf8 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterScanner.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockTransporterScanner.java @@ -62,7 +62,7 @@ public class BlockTransporterScanner extends BlockAbstractBase { } @Override - public boolean isNormalCube(final IBlockState state, final IBlockAccess blockAccess, final BlockPos blockPos) { + public boolean isNormalCube(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) { return false; } diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java index 50995489..82a0c84a 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java @@ -181,10 +181,6 @@ public class TileEntityShipController extends TileEntityAbstractShipController { return new Object[] { tileEntityShipCore.dim_negative(arguments) }; } - // public Object[] command(final Object[] arguments); - - // public Object[] enable(final Object[] arguments); - @Override public Object[] energy() { final TileEntityShipCore tileEntityShipCore = tileEntityShipCoreWeakReference == null ? null : tileEntityShipCoreWeakReference.get(); diff --git a/src/main/java/cr0s/warpdrive/block/weapon/BlockLaserCamera.java b/src/main/java/cr0s/warpdrive/block/weapon/BlockLaserCamera.java index 3baccf2b..fb4e36ea 100644 --- a/src/main/java/cr0s/warpdrive/block/weapon/BlockLaserCamera.java +++ b/src/main/java/cr0s/warpdrive/block/weapon/BlockLaserCamera.java @@ -28,7 +28,7 @@ public class BlockLaserCamera extends BlockAbstractContainer { @SuppressWarnings("deprecation") @Override - public boolean causesSuffocation(final IBlockState state) { + public boolean causesSuffocation(final IBlockState blockState) { return false; } } \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/compat/CompatCarpentersBlocks.java b/src/main/java/cr0s/warpdrive/compat/CompatCarpentersBlocks.java index d55aa3a7..ce4031ed 100644 --- a/src/main/java/cr0s/warpdrive/compat/CompatCarpentersBlocks.java +++ b/src/main/java/cr0s/warpdrive/compat/CompatCarpentersBlocks.java @@ -110,7 +110,7 @@ public class CompatCarpentersBlocks implements IBlockTransformer { if (blockCarpentersBed.isInstance(block)) { final int metadataNBT = nbtTileEntity.getInteger("cbMetadata"); - final int rotation = (metadataNBT >> 13) & 7; + final int rotation = (metadataNBT >> 13) & 0x7; final int state = metadataNBT & 0x1FFF; switch (rotationSteps) { case 1: @@ -150,7 +150,7 @@ public class CompatCarpentersBlocks implements IBlockTransformer { if (blockCarpentersCollapsibleBlock.isInstance(block)) { final int metadataNBT = nbtTileEntity.getInteger("cbMetadata"); - final int state = metadataNBT & 7; + final int state = metadataNBT & 0x7; final int weightXPZP = (metadataNBT & 0x7FFF07) >> 3; final int weightXNZP = (metadataNBT & 0x7C1FFF) >> 13; final int weightXNZN = (metadataNBT & 0x03FFFF) >> 18; @@ -192,7 +192,7 @@ public class CompatCarpentersBlocks implements IBlockTransformer { if (blockCarpentersGarageDoor.isInstance(block)) { final int metadataNBT = nbtTileEntity.getInteger("cbMetadata"); - final int rotation = (metadataNBT >> 4) & 7; + final int rotation = (metadataNBT >> 4) & 0x7; final int state = metadataNBT & 0xFF8F; switch (rotationSteps) { case 1: @@ -211,7 +211,7 @@ public class CompatCarpentersBlocks implements IBlockTransformer { if (blockCarpentersGate.isInstance(block)) { final int metadataNBT = nbtTileEntity.getInteger("cbMetadata"); - final int rotation = (metadataNBT >> 4) & 7; + final int rotation = (metadataNBT >> 4) & 0x7; final int state = metadataNBT & 0xFF8F; switch (rotationSteps) { case 1: diff --git a/src/main/java/cr0s/warpdrive/compat/CompatWarpDrive.java b/src/main/java/cr0s/warpdrive/compat/CompatWarpDrive.java index a21f7f50..0e358d08 100644 --- a/src/main/java/cr0s/warpdrive/compat/CompatWarpDrive.java +++ b/src/main/java/cr0s/warpdrive/compat/CompatWarpDrive.java @@ -139,11 +139,11 @@ public class CompatWarpDrive implements IBlockTransformer { || block instanceof BlockShipCore ) { switch (rotationSteps) { case 1: - return mrotDirection[metadata & 7] | (metadata & 8); + return mrotDirection[metadata & 0x7] | (metadata & 0x8); case 2: - return mrotDirection[mrotDirection[metadata & 7]] | (metadata & 8); + return mrotDirection[mrotDirection[metadata & 0x7]] | (metadata & 0x8); case 3: - return mrotDirection[mrotDirection[mrotDirection[metadata & 7]]] | (metadata & 8); + return mrotDirection[mrotDirection[mrotDirection[metadata & 0x7]]] | (metadata & 0x8); default: return metadata; } diff --git a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java index f02bbb34..6d1e43f4 100644 --- a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java +++ b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java @@ -80,22 +80,22 @@ public class WarpDriveConfig { private static final boolean unused = false; // TODO - private static String stringConfigDirectory; - private static File configDirectory; + private static String stringConfigDirectory; + private static File configDirectory; private static DocumentBuilder xmlDocumentBuilder; - private static final String[] defaultXML_fillers = { + private static final String[] defaultXML_fillers = { "filler-default.xml", "filler-netherores.xml", "filler-undergroundbiomes.xml", }; - private static final String[] defaultXML_loots = { + private static final String[] defaultXML_loots = { "loot-default.xml", }; - private static final String[] defaultXML_structures = { + private static final String[] defaultXML_structures = { "structures-default.xml", "structures-netherores.xml", }; - private static final String[] defaultXML_celestialObjects = { + private static final String[] defaultXML_celestialObjects = { "celestialObjects-default.xml" }; @@ -105,58 +105,58 @@ public class WarpDriveConfig { /* * The variables which store whether or not individual mods are loaded */ - public static boolean isAdvancedRepulsionSystemLoaded = false; - public static boolean isAdvancedSolarPanelLoaded = false; - public static boolean isCoFHCoreLoaded = false; - public static boolean isComputerCraftLoaded = false; - public static boolean isDefenseTechLoaded = false; - public static boolean isEnderIOLoaded = false; - public static boolean isForgeMultipartLoaded = false; - public static boolean isGregTechLoaded = false; - public static boolean isICBMClassicLoaded = false; - public static boolean isImmersiveEngineeringLoaded = false; - public static boolean isIndustrialCraft2Loaded = false; - public static boolean isNotEnoughItemsLoaded = false; - public static boolean isOpenComputersLoaded = false; - public static boolean isThermalExpansionLoaded = false; - public static boolean isThermalFoundationLoaded = false; + public static boolean isAdvancedRepulsionSystemLoaded = false; + public static boolean isAdvancedSolarPanelLoaded = false; + public static boolean isCoFHCoreLoaded = false; + public static boolean isComputerCraftLoaded = false; + public static boolean isDefenseTechLoaded = false; + public static boolean isEnderIOLoaded = false; + public static boolean isForgeMultipartLoaded = false; + public static boolean isGregTechLoaded = false; + public static boolean isICBMClassicLoaded = false; + public static boolean isImmersiveEngineeringLoaded = false; + public static boolean isIndustrialCraft2Loaded = false; + public static boolean isNotEnoughItemsLoaded = false; + public static boolean isOpenComputersLoaded = false; + public static boolean isThermalExpansionLoaded = false; + public static boolean isThermalFoundationLoaded = false; - public static ItemStack IC2_compressedAir; - public static ItemStack IC2_emptyCell; - public static Block IC2_rubberWood; - public static ItemStack IC2_Resin; - public static Block CC_Computer, CC_peripheral, CCT_Turtle, CCT_Expanded, CCT_Advanced; + public static ItemStack IC2_compressedAir; + public static ItemStack IC2_emptyCell; + public static Block IC2_rubberWood; + public static ItemStack IC2_Resin; + public static Block CC_Computer, CC_peripheral, CCT_Turtle, CCT_Expanded, CCT_Advanced; // Mod configuration (see loadConfig() for comments/definitions) // General - public static int G_SPACE_BIOME_ID = 95; - public static int G_SPACE_PROVIDER_ID = 14; - public static int G_HYPERSPACE_PROVIDER_ID = 15; - public static int G_ENTITY_SPHERE_GENERATOR_ID = 241; - public static int G_ENTITY_STAR_CORE_ID = 242; - public static int G_ENTITY_CAMERA_ID = 243; - public static int G_ENTITY_PARTICLE_BUNCH_ID = 244; + public static int G_SPACE_BIOME_ID = 95; + public static int G_SPACE_PROVIDER_ID = 14; + public static int G_HYPERSPACE_PROVIDER_ID = 15; + public static int G_ENTITY_SPHERE_GENERATOR_ID = 241; + public static int G_ENTITY_STAR_CORE_ID = 242; + public static int G_ENTITY_CAMERA_ID = 243; + public static int G_ENTITY_PARTICLE_BUNCH_ID = 244; - public static final int LUA_SCRIPTS_NONE = 0; - public static final int LUA_SCRIPTS_TEMPLATES = 1; - public static final int LUA_SCRIPTS_ALL = 2; - public static int G_LUA_SCRIPTS = LUA_SCRIPTS_ALL; - public static String G_SCHEMALOCATION = "warpDrive_schematics"; - public static int G_BLOCKS_PER_TICK = 3500; - public static boolean G_ENABLE_PROTECTION_CHECKS = true; + public static final int LUA_SCRIPTS_NONE = 0; + public static final int LUA_SCRIPTS_TEMPLATES = 1; + public static final int LUA_SCRIPTS_ALL = 2; + public static int G_LUA_SCRIPTS = LUA_SCRIPTS_ALL; + public static String G_SCHEMALOCATION = "warpDrive_schematics"; + public static int G_BLOCKS_PER_TICK = 3500; + public static boolean G_ENABLE_PROTECTION_CHECKS = true; // Client - public static float CLIENT_LOCATION_SCALE = 1.0F; - public static String CLIENT_LOCATION_FORMAT_TITLE = "§l%1$s"; - public static int CLIENT_LOCATION_BACKGROUND_COLOR = Commons.colorARGBtoInt(64, 48, 48, 48); - public static int CLIENT_LOCATION_TEXT_COLOR = Commons.colorARGBtoInt(230, 180, 180, 240); - public static boolean CLIENT_LOCATION_HAS_SHADOW = true; + public static float CLIENT_LOCATION_SCALE = 1.0F; + public static String CLIENT_LOCATION_FORMAT_TITLE = "§l%1$s"; + public static int CLIENT_LOCATION_BACKGROUND_COLOR = Commons.colorARGBtoInt(64, 48, 48, 48); + public static int CLIENT_LOCATION_TEXT_COLOR = Commons.colorARGBtoInt(230, 180, 180, 240); + public static boolean CLIENT_LOCATION_HAS_SHADOW = true; public static EnumDisplayAlignment CLIENT_LOCATION_SCREEN_ALIGNMENT = EnumDisplayAlignment.MIDDLE_RIGHT; - public static int CLIENT_LOCATION_SCREEN_OFFSET_X = 0; - public static int CLIENT_LOCATION_SCREEN_OFFSET_Y = -20; + public static int CLIENT_LOCATION_SCREEN_OFFSET_X = 0; + public static int CLIENT_LOCATION_SCREEN_OFFSET_Y = -20; public static EnumDisplayAlignment CLIENT_LOCATION_TEXT_ALIGNMENT = EnumDisplayAlignment.TOP_RIGHT; - public static float CLIENT_LOCATION_WIDTH_RATIO = 0.0F; - public static int CLIENT_LOCATION_WIDTH_MIN = 90; + public static float CLIENT_LOCATION_WIDTH_RATIO = 0.0F; + public static int CLIENT_LOCATION_WIDTH_MIN = 90; public static EnumTooltipCondition CLIENT_TOOLTIP_REGISTRY_NAME = EnumTooltipCondition.ADVANCED_TOOLTIPS; public static EnumTooltipCondition CLIENT_TOOLTIP_ORE_DICTIONARY_NAME = EnumTooltipCondition.ALWAYS; @@ -204,95 +204,95 @@ public class WarpDriveConfig { public static boolean LOGGING_CLIENT_SYNCHRONIZATION = false; // Starmap - public static int STARMAP_REGISTRY_UPDATE_INTERVAL_SECONDS = 10; - public static boolean STARMAP_ALLOW_OVERLAPPING_CELESTIAL_OBJECTS = false; + public static int STARMAP_REGISTRY_UPDATE_INTERVAL_SECONDS = 10; + public static boolean STARMAP_ALLOW_OVERLAPPING_CELESTIAL_OBJECTS = false; // Space generator - public static int SPACE_GENERATOR_Y_MIN_CENTER = 55; - public static int SPACE_GENERATOR_Y_MAX_CENTER = 128; - public static int SPACE_GENERATOR_Y_MIN_BORDER = 5; - public static int SPACE_GENERATOR_Y_MAX_BORDER = 200; + public static int SPACE_GENERATOR_Y_MIN_CENTER = 55; + public static int SPACE_GENERATOR_Y_MAX_CENTER = 128; + public static int SPACE_GENERATOR_Y_MIN_BORDER = 5; + public static int SPACE_GENERATOR_Y_MAX_BORDER = 200; // Ship movement costs public static ShipMovementCosts.Factors[] SHIP_MOVEMENT_COSTS_FACTORS = null; // Ship - public static int[] SHIP_MAX_ENERGY_STORED_BY_TIER = { 0, 500000, 10000000, 100000000 }; - public static int[] SHIP_MASS_MAX_BY_TIER = { 2000000, 4000, 16000, 64000 }; - public static int[] SHIP_MASS_MIN_BY_TIER = { 0, 0, 3000, 12000 }; - public static int SHIP_MASS_MAX_ON_PLANET_SURFACE = 1200; - public static int SHIP_MASS_MIN_FOR_HYPERSPACE = 3000; - public static int[] SHIP_SIZE_MAX_PER_SIDE_BY_TIER = { 127, 32, 64, 127 }; - public static int SHIP_COLLISION_TOLERANCE_BLOCKS = 3; - public static int SHIP_WARMUP_RANDOM_TICKS = 60; - public static int SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS = 2; - public static int SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = 10; - public static int SHIP_VOLUME_SCAN_BLOCKS_PER_TICK = 1000; - public static int SHIP_VOLUME_SCAN_AGE_TOLERANCE_SECONDS = 120; - public static String[] SHIP_MASS_UNLIMITED_PLAYER_NAMES = { "notch", "someone" }; + public static int[] SHIP_MAX_ENERGY_STORED_BY_TIER = { 0, 500000, 10000000, 100000000 }; + public static int[] SHIP_MASS_MAX_BY_TIER = { 2000000, 4000, 16000, 64000 }; + public static int[] SHIP_MASS_MIN_BY_TIER = { 0, 0, 3000, 12000 }; + public static int SHIP_MASS_MAX_ON_PLANET_SURFACE = 1200; + public static int SHIP_MASS_MIN_FOR_HYPERSPACE = 3000; + public static int[] SHIP_SIZE_MAX_PER_SIDE_BY_TIER = { 127, 32, 64, 127 }; + public static int SHIP_COLLISION_TOLERANCE_BLOCKS = 3; + public static int SHIP_WARMUP_RANDOM_TICKS = 60; + public static int SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS = 2; + public static int SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = 10; + public static int SHIP_VOLUME_SCAN_BLOCKS_PER_TICK = 1000; + public static int SHIP_VOLUME_SCAN_AGE_TOLERANCE_SECONDS = 120; + public static String[] SHIP_MASS_UNLIMITED_PLAYER_NAMES = { "notch", "someone" }; // Jump gate - public static int[] JUMP_GATE_SIZE_MAX_PER_SIDE_BY_TIER = { 127, 32, 64, 127 }; + public static int[] JUMP_GATE_SIZE_MAX_PER_SIDE_BY_TIER = { 127, 32, 64, 127 }; // Radar - public static int RADAR_MAX_ENERGY_STORED = 100000000; // 100kk eU - public static int RADAR_SCAN_MIN_ENERGY_COST = 10000; - public static double[] RADAR_SCAN_ENERGY_COST_FACTORS = { 0.0, 0.0, 0.0, 0.0001 }; - public static int RADAR_SCAN_MIN_DELAY_SECONDS = 1; - public static double[] RADAR_SCAN_DELAY_FACTORS_SECONDS = { 1.0, 0.001, 0.0, 0.0 }; - public static int RADAR_MAX_ISOLATION_RANGE = 2; - public static int RADAR_MIN_ISOLATION_BLOCKS = 2; - public static int RADAR_MAX_ISOLATION_BLOCKS = 16; - public static double RADAR_MIN_ISOLATION_EFFECT = 0.12; - public static double RADAR_MAX_ISOLATION_EFFECT = 1.00; + public static int RADAR_MAX_ENERGY_STORED = 100000000; // 100kk eU + public static int RADAR_SCAN_MIN_ENERGY_COST = 10000; + public static double[] RADAR_SCAN_ENERGY_COST_FACTORS = { 0.0, 0.0, 0.0, 0.0001 }; + public static int RADAR_SCAN_MIN_DELAY_SECONDS = 1; + public static double[] RADAR_SCAN_DELAY_FACTORS_SECONDS = { 1.0, 0.001, 0.0, 0.0 }; + public static int RADAR_MAX_ISOLATION_RANGE = 2; + public static int RADAR_MIN_ISOLATION_BLOCKS = 2; + public static int RADAR_MAX_ISOLATION_BLOCKS = 16; + public static double RADAR_MIN_ISOLATION_EFFECT = 0.12; + public static double RADAR_MAX_ISOLATION_EFFECT = 1.00; // Siren - public static float[] SIREN_RANGE_BLOCKS_BY_TIER = { 0.0F, 32.0F, 64.0F, 128.0F }; + public static float[] SIREN_RANGE_BLOCKS_BY_TIER = { 0.0F, 32.0F, 64.0F, 128.0F }; // Ship Scanner - public static int SS_MAX_DEPLOY_RADIUS_BLOCKS = 50; - public static int SS_SEARCH_INTERVAL_TICKS = 20; - public static int SS_SCAN_BLOCKS_PER_SECOND = 10; - public static int SS_DEPLOY_BLOCKS_PER_INTERVAL = 10; - public static int SS_DEPLOY_INTERVAL_TICKS = 4; + public static int SS_MAX_DEPLOY_RADIUS_BLOCKS = 50; + public static int SS_SEARCH_INTERVAL_TICKS = 20; + public static int SS_SCAN_BLOCKS_PER_SECOND = 10; + public static int SS_DEPLOY_BLOCKS_PER_INTERVAL = 10; + public static int SS_DEPLOY_INTERVAL_TICKS = 4; // Laser medium - public static int[] LASER_MEDIUM_MAX_ENERGY_STORED_BY_TIER = { 1000000, 10000, 30000, 100000 }; + public static int[] LASER_MEDIUM_MAX_ENERGY_STORED_BY_TIER = { 1000000, 10000, 30000, 100000 }; // Laser Emitter // 1 main laser + 4 boosting lasers = 10 * 100k + 0.6 * 40 * 100k = 3.4M - public static int LASER_CANNON_MAX_MEDIUMS_COUNT = 10; - public static int LASER_CANNON_MAX_LASER_ENERGY = 3400000; - public static int LASER_CANNON_EMIT_FIRE_DELAY_TICKS = 5; - public static int LASER_CANNON_EMIT_SCAN_DELAY_TICKS = 1; + public static int LASER_CANNON_MAX_MEDIUMS_COUNT = 10; + public static int LASER_CANNON_MAX_LASER_ENERGY = 3400000; + public static int LASER_CANNON_EMIT_FIRE_DELAY_TICKS = 5; + public static int LASER_CANNON_EMIT_SCAN_DELAY_TICKS = 1; - public static double LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = 0.60D; - public static double LASER_CANNON_ENERGY_ATTENUATION_PER_AIR_BLOCK = 0.000200D; - public static double LASER_CANNON_ENERGY_ATTENUATION_PER_VOID_BLOCK = 0.000005D; - public static double LASER_CANNON_ENERGY_ATTENUATION_PER_BROKEN_BLOCK = 0.23D; - public static int LASER_CANNON_RANGE_MAX = 500; + public static double LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = 0.60D; + public static double LASER_CANNON_ENERGY_ATTENUATION_PER_AIR_BLOCK = 0.000200D; + public static double LASER_CANNON_ENERGY_ATTENUATION_PER_VOID_BLOCK = 0.000005D; + public static double LASER_CANNON_ENERGY_ATTENUATION_PER_BROKEN_BLOCK = 0.23D; + public static int LASER_CANNON_RANGE_MAX = 500; - public static int LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = 20; - public static int LASER_CANNON_ENTITY_HIT_ENERGY = 15000; - public static int LASER_CANNON_ENTITY_HIT_BASE_DAMAGE = 3; - public static int LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE = 30000; - public static int LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = 100; + public static int LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = 20; + public static int LASER_CANNON_ENTITY_HIT_ENERGY = 15000; + public static int LASER_CANNON_ENTITY_HIT_BASE_DAMAGE = 3; + public static int LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE = 30000; + public static int LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = 100; - public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_THRESHOLD = 900000; - public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = 4.0F; - public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000; - public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = 4.0F; + public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_THRESHOLD = 900000; + public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = 4.0F; + public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000; + public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = 4.0F; - public static int LASER_CANNON_BLOCK_HIT_ENERGY_MIN = 75000; - public static int LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_HARDNESS = 150000; - public static int LASER_CANNON_BLOCK_HIT_ENERGY_MAX = 750000; - public static double LASER_CANNON_BLOCK_HIT_ABSORPTION_PER_BLOCK_HARDNESS = 0.01; - public static double LASER_CANNON_BLOCK_HIT_ABSORPTION_MAX = 0.80; + public static int LASER_CANNON_BLOCK_HIT_ENERGY_MIN = 75000; + public static int LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_HARDNESS = 150000; + public static int LASER_CANNON_BLOCK_HIT_ENERGY_MAX = 750000; + public static double LASER_CANNON_BLOCK_HIT_ABSORPTION_PER_BLOCK_HARDNESS = 0.01; + public static double LASER_CANNON_BLOCK_HIT_ABSORPTION_MAX = 0.80; - public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_HARDNESS_THRESHOLD = 5.0F; - public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = 8.0F; - public static int LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000; - public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = 50F; + public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_HARDNESS_THRESHOLD = 5.0F; + public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = 8.0F; + public static int LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000; + public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = 50F; // Mining laser // BuildCraft quarry values for reference @@ -308,143 +308,143 @@ public class WarpDriveConfig { // - overall consumption in 'all, space' is ML_EU_PER_LAYER_SPACE + ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE => ~ 43150 EU/layer // - overall consumption in 'ores, space' is ML_EU_PER_LAYER_SPACE + ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE * ML_EU_MUL_ORESONLY / 25 => ~ 28630 EU/layer // - at radius 5, one layer takes 403 ticks (2 * ML_SCAN_DELAY_TICKS + ML_MINE_DELAY_TICKS * (ML_MAX_RADIUS * 2 + 1) ^ 2) - public static int MINING_LASER_MAX_MEDIUMS_COUNT = 3; - public static int MINING_LASER_RADIUS_NO_LASER_MEDIUM = 4; - public static int MINING_LASER_RADIUS_PER_LASER_MEDIUM = 1; - public static int MINING_LASER_WARMUP_DELAY_TICKS = 20; - public static int MINING_LASER_SCAN_DELAY_TICKS = 20; - public static int MINING_LASER_MINE_DELAY_TICKS = 3; - public static int MINING_LASER_SPACE_ENERGY_PER_LAYER = 20000; - public static int MINING_LASER_PLANET_ENERGY_PER_LAYER = 33000; - public static int MINING_LASER_SPACE_ENERGY_PER_BLOCK = 1500; - public static int MINING_LASER_PLANET_ENERGY_PER_BLOCK = 2500; - public static double MINING_LASER_ORESONLY_ENERGY_FACTOR = 15.0; // lower value encourages to keep the land 'clean' - public static double MINING_LASER_SILKTOUCH_ENERGY_FACTOR = 1.5; - public static double MINING_LASER_SILKTOUCH_DEUTERIUM_L = 0.0; - public static double MINING_LASER_FORTUNE_ENERGY_FACTOR = 1.5; + public static int MINING_LASER_MAX_MEDIUMS_COUNT = 3; + public static int MINING_LASER_RADIUS_NO_LASER_MEDIUM = 4; + public static int MINING_LASER_RADIUS_PER_LASER_MEDIUM = 1; + public static int MINING_LASER_WARMUP_DELAY_TICKS = 20; + public static int MINING_LASER_SCAN_DELAY_TICKS = 20; + public static int MINING_LASER_MINE_DELAY_TICKS = 3; + public static int MINING_LASER_SPACE_ENERGY_PER_LAYER = 20000; + public static int MINING_LASER_PLANET_ENERGY_PER_LAYER = 33000; + public static int MINING_LASER_SPACE_ENERGY_PER_BLOCK = 1500; + public static int MINING_LASER_PLANET_ENERGY_PER_BLOCK = 2500; + public static double MINING_LASER_ORESONLY_ENERGY_FACTOR = 15.0; // lower value encourages to keep the land 'clean' + public static double MINING_LASER_SILKTOUCH_ENERGY_FACTOR = 1.5; + public static double MINING_LASER_SILKTOUCH_DEUTERIUM_L = 0.0; + public static double MINING_LASER_FORTUNE_ENERGY_FACTOR = 1.5; // Tree farm - public static int TREE_FARM_MAX_MEDIUMS_COUNT = 5; - public static int TREE_FARM_MAX_SCAN_RADIUS_NO_LASER_MEDIUM = 3; - public static int TREE_FARM_MAX_SCAN_RADIUS_PER_LASER_MEDIUM = 2; - public static int TREE_FARM_totalMaxRadius = 0; - public static int TREE_FARM_MAX_LOG_DISTANCE = 8; - public static int TREE_FARM_MAX_LOG_DISTANCE_PER_MEDIUM = 4; + public static int TREE_FARM_MAX_MEDIUMS_COUNT = 5; + public static int TREE_FARM_MAX_SCAN_RADIUS_NO_LASER_MEDIUM = 3; + public static int TREE_FARM_MAX_SCAN_RADIUS_PER_LASER_MEDIUM = 2; + public static int TREE_FARM_totalMaxRadius = 0; + public static int TREE_FARM_MAX_LOG_DISTANCE = 8; + public static int TREE_FARM_MAX_LOG_DISTANCE_PER_MEDIUM = 4; // Cloaking - public static int CLOAKING_MAX_ENERGY_STORED = 500000000; - public static int CLOAKING_COIL_CAPTURE_BLOCKS = 5; - public static int CLOAKING_MAX_FIELD_RADIUS = 63; - public static int CLOAKING_TIER1_ENERGY_PER_BLOCK = 32; - public static int CLOAKING_TIER2_ENERGY_PER_BLOCK = 128; - public static int CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = 3; + public static int CLOAKING_MAX_ENERGY_STORED = 500000000; + public static int CLOAKING_COIL_CAPTURE_BLOCKS = 5; + public static int CLOAKING_MAX_FIELD_RADIUS = 63; + public static int CLOAKING_TIER1_ENERGY_PER_BLOCK = 32; + public static int CLOAKING_TIER2_ENERGY_PER_BLOCK = 128; + public static int CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = 3; // Breathing - public static int BREATHING_ENERGY_PER_CANISTER = 200; - public static int[] BREATHING_ENERGY_PER_NEW_AIR_BLOCK_BY_TIER = { 0, 12, 180, 2610 }; - public static int[] BREATHING_ENERGY_PER_EXISTING_AIR_BLOCK_BY_TIER = { 0, 4, 60, 870 }; - public static int[] BREATHING_MAX_ENERGY_STORED_BY_TIER = { 0, 1400, 21000, 304500 }; // almost 6 mn of autonomy - public static int BREATHING_AIR_GENERATION_TICKS = 40; - public static int[] BREATHING_AIR_GENERATION_RANGE_BLOCKS_BY_TIER = { 200, 16, 48, 144 }; - public static int BREATHING_VOLUME_UPDATE_DEPTH_BLOCKS = 256; - public static int BREATHING_AIR_SIMULATION_DELAY_TICKS = 30; - public static final boolean BREATHING_AIR_BLOCK_DEBUG = false; - public static boolean BREATHING_AIR_AT_ENTITY_DEBUG = false; + public static int BREATHING_ENERGY_PER_CANISTER = 200; + public static int[] BREATHING_ENERGY_PER_NEW_AIR_BLOCK_BY_TIER = { 0, 12, 180, 2610 }; + public static int[] BREATHING_ENERGY_PER_EXISTING_AIR_BLOCK_BY_TIER = { 0, 4, 60, 870 }; + public static int[] BREATHING_MAX_ENERGY_STORED_BY_TIER = { 0, 1400, 21000, 304500 }; // almost 6 mn of autonomy + public static int BREATHING_AIR_GENERATION_TICKS = 40; + public static int[] BREATHING_AIR_GENERATION_RANGE_BLOCKS_BY_TIER = { 200, 16, 48, 144 }; + public static int BREATHING_VOLUME_UPDATE_DEPTH_BLOCKS = 256; + public static int BREATHING_AIR_SIMULATION_DELAY_TICKS = 30; + public static final boolean BREATHING_AIR_BLOCK_DEBUG = false; + public static boolean BREATHING_AIR_AT_ENTITY_DEBUG = false; - public static int BREATHING_AIR_TANK_BREATH_DURATION_TICKS = 300; - public static int[] BREATHING_AIR_TANK_CAPACITY_BY_TIER = { 20, 32, 64, 128 }; + public static int BREATHING_AIR_TANK_BREATH_DURATION_TICKS = 300; + public static int[] BREATHING_AIR_TANK_CAPACITY_BY_TIER = { 20, 32, 64, 128 }; // IC2 Reactor cooler - public static int IC2_REACTOR_MAX_HEAT_STORED = 30000; - public static int IC2_REACTOR_FOCUS_HEAT_TRANSFER_PER_TICK = 648; - public static int IC2_REACTOR_COMPONENT_HEAT_TRANSFER_PER_TICK = 54; - public static int IC2_REACTOR_REACTOR_HEAT_TRANSFER_PER_TICK = 54; - public static int IC2_REACTOR_COOLING_PER_INTERVAL = 1080; - public static double IC2_REACTOR_ENERGY_PER_HEAT = 2.0D; - public static int IC2_REACTOR_COOLING_INTERVAL_TICKS = 10; + public static int IC2_REACTOR_MAX_HEAT_STORED = 30000; + public static int IC2_REACTOR_FOCUS_HEAT_TRANSFER_PER_TICK = 648; + public static int IC2_REACTOR_COMPONENT_HEAT_TRANSFER_PER_TICK = 54; + public static int IC2_REACTOR_REACTOR_HEAT_TRANSFER_PER_TICK = 54; + public static int IC2_REACTOR_COOLING_PER_INTERVAL = 1080; + public static double IC2_REACTOR_ENERGY_PER_HEAT = 2.0D; + public static int IC2_REACTOR_COOLING_INTERVAL_TICKS = 10; // Transporter - public static int TRANSPORTER_MAX_ENERGY_STORED = 1000000; - public static int TRANSPORTER_ENERGY_STORED_UPGRADE_BONUS = TRANSPORTER_MAX_ENERGY_STORED / 2; - public static int TRANSPORTER_ENERGY_STORED_UPGRADE_MAX_QUANTITY = 8; - public static int TRANSPORTER_SETUP_UPDATE_PARAMETERS_TICKS = 1 * 20; - public static int TRANSPORTER_SETUP_SCANNER_RANGE_XZ_BLOCKS = 8; - public static int TRANSPORTER_SETUP_SCANNER_RANGE_Y_BELOW_BLOCKS = 3; - public static int TRANSPORTER_SETUP_SCANNER_RANGE_Y_ABOVE_BLOCKS = 1; - public static int TRANSPORTER_RANGE_BASE_BLOCKS = 256; - public static int TRANSPORTER_RANGE_UPGRADE_BLOCKS = 64; - public static int TRANSPORTER_RANGE_UPGRADE_MAX_QUANTITY = 8; - public static double[] TRANSPORTER_LOCKING_ENERGY_FACTORS = { 20.0, 3.0, 0.0, 10.0, 1.0 / Math.sqrt(2.0) }; - public static double TRANSPORTER_LOCKING_STRENGTH_FACTOR_PER_TICK = Math.pow(0.01D, 1.0D / 300.0D); // natural decay down to 1% over 300 ticks - public static double TRANSPORTER_LOCKING_STRENGTH_IN_WILDERNESS = 0.25D; - public static double TRANSPORTER_LOCKING_STRENGTH_AT_BEACON = 0.50D; - public static double TRANSPORTER_LOCKING_STRENGTH_AT_TRANSPORTER = 1.00D; - public static double TRANSPORTER_LOCKING_STRENGTH_BONUS_AT_MAX_ENERGY_FACTOR = 0.5D; - public static double TRANSPORTER_LOCKING_STRENGTH_UPGRADE = 0.15D; - public static double TRANSPORTER_LOCKING_SPEED_IN_WILDERNESS = 0.25D; - public static double TRANSPORTER_LOCKING_SPEED_AT_BEACON = 0.75D; - public static double TRANSPORTER_LOCKING_SPEED_AT_TRANSPORTER = 1.0D; - public static double TRANSPORTER_LOCKING_SPEED_UPGRADE = 0.25D; - public static int TRANSPORTER_LOCKING_SPEED_OPTIMAL_TICKS = 5 * 20; - public static int TRANSPORTER_LOCKING_UPGRADE_MAX_QUANTITY = 2; - public static int TRANSPORTER_JAMMED_COOLDOWN_TICKS = 2 * 20; - public static double[] TRANSPORTER_ENERGIZING_ENERGY_FACTORS = { 10000.0, 1500.0, 0.0, 10.0, 1.0 / Math.sqrt(2.0) }; - public static double TRANSPORTER_ENERGIZING_MAX_ENERGY_FACTOR = 10.0D; - public static int TRANSPORTER_ENERGIZING_FAILURE_MAX_DAMAGE = 5; - public static double TRANSPORTER_ENERGIZING_SUCCESS_LOCK_BONUS = 0.20D; - public static int TRANSPORTER_ENERGIZING_SUCCESS_MAX_DAMAGE = 100; - public static double TRANSPORTER_ENERGIZING_LOCKING_LOST = 0.5D; - public static int TRANSPORTER_ENERGIZING_CHARGING_TICKS = 3 * 20; - public static int TRANSPORTER_ENERGIZING_COOLDOWN_TICKS = 10 * 20; - public static double TRANSPORTER_ENERGIZING_ENTITY_MOVEMENT_TOLERANCE_BLOCKS = 1.0D; - public static int TRANSPORTER_ENTITY_GRAB_RADIUS_BLOCKS = 2; - public static int TRANSPORTER_FOCUS_SEARCH_RADIUS_BLOCKS = 2; - public static int TRANSPORTER_BEACON_MAX_ENERGY_STORED = 60000; - public static int TRANSPORTER_BEACON_ENERGY_PER_TICK = 60000 / (300 * 20); // 10 EU/t over 5 minutes - public static int TRANSPORTER_BEACON_DEPLOYING_DELAY_TICKS = 20; + public static int TRANSPORTER_MAX_ENERGY_STORED = 1000000; + public static int TRANSPORTER_ENERGY_STORED_UPGRADE_BONUS = TRANSPORTER_MAX_ENERGY_STORED / 2; + public static int TRANSPORTER_ENERGY_STORED_UPGRADE_MAX_QUANTITY = 8; + public static int TRANSPORTER_SETUP_UPDATE_PARAMETERS_TICKS = 1 * 20; + public static int TRANSPORTER_SETUP_SCANNER_RANGE_XZ_BLOCKS = 8; + public static int TRANSPORTER_SETUP_SCANNER_RANGE_Y_BELOW_BLOCKS = 3; + public static int TRANSPORTER_SETUP_SCANNER_RANGE_Y_ABOVE_BLOCKS = 1; + public static int TRANSPORTER_RANGE_BASE_BLOCKS = 256; + public static int TRANSPORTER_RANGE_UPGRADE_BLOCKS = 64; + public static int TRANSPORTER_RANGE_UPGRADE_MAX_QUANTITY = 8; + public static double[] TRANSPORTER_LOCKING_ENERGY_FACTORS = { 20.0, 3.0, 0.0, 10.0, 1.0 / Math.sqrt(2.0) }; + public static double TRANSPORTER_LOCKING_STRENGTH_FACTOR_PER_TICK = Math.pow(0.01D, 1.0D / 300.0D); // natural decay down to 1% over 300 ticks + public static double TRANSPORTER_LOCKING_STRENGTH_IN_WILDERNESS = 0.25D; + public static double TRANSPORTER_LOCKING_STRENGTH_AT_BEACON = 0.50D; + public static double TRANSPORTER_LOCKING_STRENGTH_AT_TRANSPORTER = 1.00D; + public static double TRANSPORTER_LOCKING_STRENGTH_BONUS_AT_MAX_ENERGY_FACTOR = 0.5D; + public static double TRANSPORTER_LOCKING_STRENGTH_UPGRADE = 0.15D; + public static double TRANSPORTER_LOCKING_SPEED_IN_WILDERNESS = 0.25D; + public static double TRANSPORTER_LOCKING_SPEED_AT_BEACON = 0.75D; + public static double TRANSPORTER_LOCKING_SPEED_AT_TRANSPORTER = 1.0D; + public static double TRANSPORTER_LOCKING_SPEED_UPGRADE = 0.25D; + public static int TRANSPORTER_LOCKING_SPEED_OPTIMAL_TICKS = 5 * 20; + public static int TRANSPORTER_LOCKING_UPGRADE_MAX_QUANTITY = 2; + public static int TRANSPORTER_JAMMED_COOLDOWN_TICKS = 2 * 20; + public static double[] TRANSPORTER_ENERGIZING_ENERGY_FACTORS = { 10000.0, 1500.0, 0.0, 10.0, 1.0 / Math.sqrt(2.0) }; + public static double TRANSPORTER_ENERGIZING_MAX_ENERGY_FACTOR = 10.0D; + public static int TRANSPORTER_ENERGIZING_FAILURE_MAX_DAMAGE = 5; + public static double TRANSPORTER_ENERGIZING_SUCCESS_LOCK_BONUS = 0.20D; + public static int TRANSPORTER_ENERGIZING_SUCCESS_MAX_DAMAGE = 100; + public static double TRANSPORTER_ENERGIZING_LOCKING_LOST = 0.5D; + public static int TRANSPORTER_ENERGIZING_CHARGING_TICKS = 3 * 20; + public static int TRANSPORTER_ENERGIZING_COOLDOWN_TICKS = 10 * 20; + public static double TRANSPORTER_ENERGIZING_ENTITY_MOVEMENT_TOLERANCE_BLOCKS = 1.0D; + public static int TRANSPORTER_ENTITY_GRAB_RADIUS_BLOCKS = 2; + public static int TRANSPORTER_FOCUS_SEARCH_RADIUS_BLOCKS = 2; + public static int TRANSPORTER_BEACON_MAX_ENERGY_STORED = 60000; + public static int TRANSPORTER_BEACON_ENERGY_PER_TICK = 60000 / (300 * 20); // 10 EU/t over 5 minutes + public static int TRANSPORTER_BEACON_DEPLOYING_DELAY_TICKS = 20; // Enantiomorphic power reactor - public static int[] ENAN_REACTOR_MAX_ENERGY_STORED_BY_TIER = { 100000000, 100000000, 500000000, 2000000000 }; - public static final int ENAN_REACTOR_UPDATE_INTERVAL_TICKS = 5; // hardcoded in the equations, - public static int ENAN_REACTOR_MAX_LASERS_PER_SECOND = 6; - public static int[] ENAN_REACTOR_GENERATION_MIN_RF_BY_TIER = { 4, 4, 4, 4 }; - public static int[] ENAN_REACTOR_GENERATION_MAX_RF_BY_TIER = { 64000, 64000, 192000, 576000 }; - public static int[] ENAN_REACTOR_EXPLOSION_MAX_RADIUS_BY_TIER = { 6, 6, 8, 10 }; - public static double[] ENAN_REACTOR_EXPLOSION_MAX_REMOVAL_CHANCE_BY_TIER = { 0.1D, 0.1D, 0.1D, 0.1D }; - public static int[] ENAN_REACTOR_EXPLOSION_COUNT_BY_TIER = { 3, 3, 3, 3 }; - public static float[] ENAN_REACTOR_EXPLOSION_STRENGTH_MIN_BY_TIER = { 4.0F, 4.0F, 5.0F, 6.0F }; - public static float[] ENAN_REACTOR_EXPLOSION_STRENGTH_MAX_BY_TIER = { 7.0F, 7.0F, 9.0F, 11.0F }; + public static int[] ENAN_REACTOR_MAX_ENERGY_STORED_BY_TIER = { 100000000, 100000000, 500000000, 2000000000 }; + public static final int ENAN_REACTOR_UPDATE_INTERVAL_TICKS = 5; // hardcoded in the equations, + public static int ENAN_REACTOR_MAX_LASERS_PER_SECOND = 6; + public static int[] ENAN_REACTOR_GENERATION_MIN_RF_BY_TIER = { 4, 4, 4, 4 }; + public static int[] ENAN_REACTOR_GENERATION_MAX_RF_BY_TIER = { 64000, 64000, 192000, 576000 }; + public static int[] ENAN_REACTOR_EXPLOSION_MAX_RADIUS_BY_TIER = { 6, 6, 8, 10 }; + public static double[] ENAN_REACTOR_EXPLOSION_MAX_REMOVAL_CHANCE_BY_TIER = { 0.1D, 0.1D, 0.1D, 0.1D }; + public static int[] ENAN_REACTOR_EXPLOSION_COUNT_BY_TIER = { 3, 3, 3, 3 }; + public static float[] ENAN_REACTOR_EXPLOSION_STRENGTH_MIN_BY_TIER = { 4.0F, 4.0F, 5.0F, 6.0F }; + public static float[] ENAN_REACTOR_EXPLOSION_STRENGTH_MAX_BY_TIER = { 7.0F, 7.0F, 9.0F, 11.0F }; // Subspace capacitor - public static int[] CAPACITOR_MAX_ENERGY_STORED_BY_TIER = { 20000000, 800000, 4000000, 20000000 }; - public static int[] CAPACITOR_IC2_SINK_TIER_BY_TIER = { Integer.MAX_VALUE, 2, 3, 4 }; - public static int[] CAPACITOR_IC2_SOURCE_TIER_BY_TIER = { 20, 2, 3, 4 }; - public static int[] CAPACITOR_TRANSFER_PER_TICK_BY_TIER = { Integer.MAX_VALUE / 2, 200, 1000, 5000 }; - public static double[] CAPACITOR_EFFICIENCY_PER_UPGRADE = { 0.95D, 0.98D, 1.0D }; + public static int[] CAPACITOR_MAX_ENERGY_STORED_BY_TIER = { 20000000, 800000, 4000000, 20000000 }; + public static int[] CAPACITOR_IC2_SINK_TIER_BY_TIER = { Integer.MAX_VALUE, 2, 3, 4 }; + public static int[] CAPACITOR_IC2_SOURCE_TIER_BY_TIER = { 20, 2, 3, 4 }; + public static int[] CAPACITOR_TRANSFER_PER_TICK_BY_TIER = { Integer.MAX_VALUE / 2, 200, 1000, 5000 }; + public static double[] CAPACITOR_EFFICIENCY_PER_UPGRADE = { 0.95D, 0.98D, 1.0D }; // Laser lift - public static int LIFT_MAX_ENERGY_STORED = 900; - public static int LIFT_ENERGY_PER_ENTITY = 150; - public static int LIFT_UPDATE_INTERVAL_TICKS = 10; - public static int LIFT_ENTITY_COOLDOWN_TICKS = 40; + public static int LIFT_MAX_ENERGY_STORED = 900; + public static int LIFT_ENERGY_PER_ENTITY = 150; + public static int LIFT_UPDATE_INTERVAL_TICKS = 10; + public static int LIFT_ENTITY_COOLDOWN_TICKS = 40; // Chunk loader - public static int CHUNK_LOADER_MAX_ENERGY_STORED = 1000000; - public static int CHUNK_LOADER_MAX_RADIUS = 2; - public static int CHUNK_LOADER_ENERGY_PER_CHUNK = 8; + public static int CHUNK_LOADER_MAX_ENERGY_STORED = 1000000; + public static int CHUNK_LOADER_MAX_RADIUS = 2; + public static int CHUNK_LOADER_ENERGY_PER_CHUNK = 8; // Hull - public static float[] HULL_HARDNESS = { 666666.0F, 25.0F, 50.0F, 80.0F }; - public static float[] HULL_BLAST_RESISTANCE = { 666666.0F, 60.0F, 90.0F, 120.0F }; + public static float[] HULL_HARDNESS = { 666666.0F, 25.0F, 50.0F, 80.0F }; + public static float[] HULL_BLAST_RESISTANCE = { 666666.0F, 60.0F, 90.0F, 120.0F }; // Block transformers library public static HashMap blockTransformers = new HashMap<>(30); // Particles accelerator - public static boolean ACCELERATOR_ENABLE = false; - public static final double[] ACCELERATOR_TEMPERATURES_K = { 270.0, 200.0, 7.0 }; - public static final double ACCELERATOR_THRESHOLD_DEFAULT = 0.95D; - public static int ACCELERATOR_MAX_PARTICLE_BUNCHES = 20; + public static boolean ACCELERATOR_ENABLE = false; + public static final double[] ACCELERATOR_TEMPERATURES_K = { 270.0, 200.0, 7.0 }; + public static final double ACCELERATOR_THRESHOLD_DEFAULT = 0.95D; + public static int ACCELERATOR_MAX_PARTICLE_BUNCHES = 20; @Nonnull public static Block getBlockOrFire(@Nonnull final String registryName) { diff --git a/src/main/java/cr0s/warpdrive/config/structures/OrbInstance.java b/src/main/java/cr0s/warpdrive/config/structures/OrbInstance.java index 97df1655..637b77db 100644 --- a/src/main/java/cr0s/warpdrive/config/structures/OrbInstance.java +++ b/src/main/java/cr0s/warpdrive/config/structures/OrbInstance.java @@ -14,6 +14,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class OrbInstance extends AbstractStructureInstance { + protected OrbShell[] orbShells; protected int[] orbShellThicknesses; protected int totalThickness; diff --git a/src/main/java/cr0s/warpdrive/data/VectorI.java b/src/main/java/cr0s/warpdrive/data/VectorI.java index 96c27fd8..ac946550 100644 --- a/src/main/java/cr0s/warpdrive/data/VectorI.java +++ b/src/main/java/cr0s/warpdrive/data/VectorI.java @@ -121,12 +121,12 @@ public class VectorI implements Cloneable { return true; } - public IBlockState getBlockState_noChunkLoading(final IBlockAccess world, final EnumFacing side) { - return getBlockState_noChunkLoading(world, x + side.getXOffset(), y + side.getYOffset(), z + side.getZOffset()); + public IBlockState getBlockState_noChunkLoading(final IBlockAccess blockAccess, final EnumFacing side) { + return getBlockState_noChunkLoading(blockAccess, x + side.getXOffset(), y + side.getYOffset(), z + side.getZOffset()); } - public IBlockState getBlockState_noChunkLoading(final IBlockAccess world) { - return getBlockState_noChunkLoading(world, x, y, z); + public IBlockState getBlockState_noChunkLoading(final IBlockAccess blockAccess) { + return getBlockState_noChunkLoading(blockAccess, x, y, z); } static public IBlockState getBlockState_noChunkLoading(final IBlockAccess blockAccess, final int x, final int y, final int z) { @@ -141,8 +141,8 @@ public class VectorI implements Cloneable { return blockAccess.getBlockState(new BlockPos(x, y, z)); } - public TileEntity getTileEntity(final IBlockAccess world) { - return world.getTileEntity(new BlockPos(x, y, z)); + public TileEntity getTileEntity(final IBlockAccess blockAccess) { + return blockAccess.getTileEntity(new BlockPos(x, y, z)); } public void setBlockState(final World world, final IBlockState blockState) { diff --git a/src/main/java/cr0s/warpdrive/event/ClientHandler.java b/src/main/java/cr0s/warpdrive/event/ClientHandler.java index 423bbc11..f12b65a6 100644 --- a/src/main/java/cr0s/warpdrive/event/ClientHandler.java +++ b/src/main/java/cr0s/warpdrive/event/ClientHandler.java @@ -94,6 +94,7 @@ public class ClientHandler { } } + @SuppressWarnings("deprecation") public void addBlockDetails(final ItemTooltipEvent event, final Block block) { // item registry name final ResourceLocation registryNameItem = event.getItemStack().getItem().getRegistryName(); diff --git a/src/main/java/cr0s/warpdrive/item/ItemAirTank.java b/src/main/java/cr0s/warpdrive/item/ItemAirTank.java index 58a960b9..82af6065 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemAirTank.java +++ b/src/main/java/cr0s/warpdrive/item/ItemAirTank.java @@ -30,13 +30,13 @@ public class ItemAirTank extends ItemAbstractBase implements IAirContainerItem { return; } list.add(new ItemStack(this, 1, 0)); - list.add(new ItemStack(this, 1, getMaxDamage())); } @Nonnull @Override public EnumRarity getRarity(@Nonnull final ItemStack itemStack) { return enumAirTankTier.getRarity(); + list.add(new ItemStack(this, 1, getMaxDamage(null))); } @Override @@ -63,7 +63,7 @@ public class ItemAirTank extends ItemAbstractBase implements IAirContainerItem { || itemStack.getItem() != this ) { return 0; } - return getMaxDamage() - itemStack.getItemDamage(); + return getMaxDamage(itemStack) - itemStack.getItemDamage(); } @Override @@ -72,7 +72,7 @@ public class ItemAirTank extends ItemAbstractBase implements IAirContainerItem { || itemStack.getItem() != this ) { return itemStack; } - itemStack.setItemDamage(Math.min(getMaxDamage(), itemStack.getItemDamage() + 1)); // bypass unbreaking enchantment + itemStack.setItemDamage(Math.min(getMaxDamage(itemStack), itemStack.getItemDamage() + 1)); // bypass unbreaking enchantment return itemStack; } diff --git a/src/main/java/cr0s/warpdrive/item/ItemComponent.java b/src/main/java/cr0s/warpdrive/item/ItemComponent.java index 07d0faee..173460ca 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemComponent.java +++ b/src/main/java/cr0s/warpdrive/item/ItemComponent.java @@ -133,10 +133,10 @@ public class ItemComponent extends ItemAbstractBase implements IAirContainerItem } @Override - public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess world, final BlockPos blockPos, final EntityPlayer player) { - final Block block = world.getBlockState(blockPos).getBlock(); + public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess blockAccess, final BlockPos blockPos, final EntityPlayer player) { + final Block block = blockAccess.getBlockState(blockPos).getBlock(); return block instanceof BlockCapacitor - || super.doesSneakBypassUse(itemStack, world, blockPos, player); + || super.doesSneakBypassUse(itemStack, blockAccess, blockPos, player); } } \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/item/ItemForceFieldShape.java b/src/main/java/cr0s/warpdrive/item/ItemForceFieldShape.java index b6fd6774..816d2e89 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemForceFieldShape.java +++ b/src/main/java/cr0s/warpdrive/item/ItemForceFieldShape.java @@ -92,9 +92,9 @@ public class ItemForceFieldShape extends ItemAbstractBase { } @Override - public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess world, final BlockPos blockPos, final EntityPlayer player) { - Block block = world.getBlockState(blockPos).getBlock(); - return block instanceof BlockForceFieldRelay || block instanceof BlockForceFieldProjector || super.doesSneakBypassUse(itemStack, world, blockPos, player); + public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess blockAccess, final BlockPos blockPos, final EntityPlayer player) { + final Block block = blockAccess.getBlockState(blockPos).getBlock(); + return block instanceof BlockForceFieldRelay || block instanceof BlockForceFieldProjector || super.doesSneakBypassUse(itemStack, blockAccess, blockPos, player); } @Override diff --git a/src/main/java/cr0s/warpdrive/item/ItemTuningDriver.java b/src/main/java/cr0s/warpdrive/item/ItemTuningDriver.java index fddae480..26c16a00 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemTuningDriver.java +++ b/src/main/java/cr0s/warpdrive/item/ItemTuningDriver.java @@ -336,9 +336,9 @@ public class ItemTuningDriver extends ItemAbstractBase implements IWarpTool { } @Override - public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess world, final BlockPos blockPos, final EntityPlayer player) { - final Block block = world.getBlockState(blockPos).getBlock(); - return block instanceof BlockCapacitor || super.doesSneakBypassUse(itemStack, world, blockPos, player); + public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess blockAccess, final BlockPos blockPos, final EntityPlayer player) { + final Block block = blockAccess.getBlockState(blockPos).getBlock(); + return block instanceof BlockCapacitor || super.doesSneakBypassUse(itemStack, blockAccess, blockPos, player); } @Override diff --git a/src/main/java/cr0s/warpdrive/item/ItemTuningFork.java b/src/main/java/cr0s/warpdrive/item/ItemTuningFork.java index 6ded9620..dd42af46 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemTuningFork.java +++ b/src/main/java/cr0s/warpdrive/item/ItemTuningFork.java @@ -148,9 +148,9 @@ public class ItemTuningFork extends ItemAbstractBase implements IWarpTool { } @Override - public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess world, final BlockPos blockPos, final EntityPlayer player) { - final Block block = world.getBlockState(blockPos).getBlock(); - return block instanceof BlockCapacitor || super.doesSneakBypassUse(itemStack, world, blockPos, player); + public boolean doesSneakBypassUse(final ItemStack itemStack, final IBlockAccess blockAccess, final BlockPos blockPos, final EntityPlayer player) { + final Block block = blockAccess.getBlockState(blockPos).getBlock(); + return block instanceof BlockCapacitor || super.doesSneakBypassUse(itemStack, blockAccess, blockPos, player); } @Override diff --git a/src/main/java/cr0s/warpdrive/item/ItemWarpArmor.java b/src/main/java/cr0s/warpdrive/item/ItemWarpArmor.java index 307d9058..96c50409 100644 --- a/src/main/java/cr0s/warpdrive/item/ItemWarpArmor.java +++ b/src/main/java/cr0s/warpdrive/item/ItemWarpArmor.java @@ -28,6 +28,7 @@ public class ItemWarpArmor extends ItemArmor implements IItemBase, IBreathingHel setTranslationKey("warpdrive.armor." + suffixes[entityEquipmentSlot.getIndex()]); setRegistryName(registryName); setCreativeTab(WarpDrive.creativeTabMain); + setRegistryName(registryName); WarpDrive.register(this); } diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_bubble.mtl b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_bubble.mtl similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_bubble.mtl rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_bubble.mtl diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_bubble.obj b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_bubble.obj similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_bubble.obj rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_bubble.obj diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_flat.mtl b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_flat.mtl similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_flat.mtl rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_flat.mtl diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_flat.obj b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_flat.obj similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_flat.obj rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_flat.obj diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_long.mtl b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_long.mtl similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_long.mtl rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_long.mtl diff --git a/src/main/resources/assets/warpdrive/models/item/decoration/lamp_long.obj b/src/main/resources/assets/warpdrive/models/block/decoration/lamp_long.obj similarity index 100% rename from src/main/resources/assets/warpdrive/models/item/decoration/lamp_long.obj rename to src/main/resources/assets/warpdrive/models/block/decoration/lamp_long.obj