Fixed minor issues from 1.10 branch

This commit is contained in:
LemADEC 2017-05-04 20:03:50 +02:00
parent fd1d32899b
commit 55b6910ebc
79 changed files with 379 additions and 321 deletions

View file

@ -9,6 +9,7 @@ import cr0s.warpdrive.block.TileEntityChunkLoader;
import cr0s.warpdrive.block.TileEntityLaser;
import cr0s.warpdrive.block.TileEntityLaserMedium;
import cr0s.warpdrive.block.atomic.BlockAcceleratorControlPoint;
import cr0s.warpdrive.block.atomic.BlockAcceleratorController;
import cr0s.warpdrive.block.atomic.BlockChiller;
import cr0s.warpdrive.block.atomic.BlockElectromagnetGlass;
import cr0s.warpdrive.block.atomic.BlockElectromagnetPlain;
@ -17,6 +18,7 @@ import cr0s.warpdrive.block.atomic.BlockParticlesInjector;
import cr0s.warpdrive.block.atomic.BlockVoidShellGlass;
import cr0s.warpdrive.block.atomic.BlockVoidShellPlain;
import cr0s.warpdrive.block.atomic.TileEntityAcceleratorControlPoint;
import cr0s.warpdrive.block.atomic.TileEntityAcceleratorController;
import cr0s.warpdrive.block.atomic.TileEntityParticlesInjector;
import cr0s.warpdrive.block.breathing.BlockAirFlow;
import cr0s.warpdrive.block.breathing.BlockAirGenerator;
@ -233,7 +235,7 @@ public class WarpDrive implements LoadingCallback {
public static Block[] blockElectromagnetPlain;
public static Block[] blockElectromagnetGlass;
public static Block[] blockChillers;
public static BlockDecorative blockDecorative;
public static Block blockDecorative;
public static Block[][] blockHulls_plain;
public static Block[] blockHulls_glass;
public static Block[] blockHulls_omnipanel;
@ -441,7 +443,7 @@ public class WarpDrive implements LoadingCallback {
GameRegistry.registerBlock(blockHighlyAdvancedMachine, ItemBlockAbstractBase.class, "blockHighlyAdvancedMachine");
// SHIP SCANNER
// building blocks
blockShipScanner = new BlockShipScanner();
GameRegistry.registerBlock(blockShipScanner, ItemBlockAbstractBase.class, "blockShipScanner");
@ -495,7 +497,7 @@ public class WarpDrive implements LoadingCallback {
GameRegistry.registerBlock(blockChunkLoader, ItemBlockAbstractBase.class, "blockChunkLoader");
GameRegistry.registerTileEntity(TileEntityChunkLoader.class, MODID + ":blockChunkLoader");
// FORCE FIELD BLOCKS
// force field blocks and items
blockForceFields = new Block[3];
blockForceFieldProjectors = new Block[3];
blockForceFieldRelays = new Block[3];
@ -517,14 +519,19 @@ public class WarpDrive implements LoadingCallback {
GameRegistry.registerTileEntity(TileEntityForceFieldRelay.class, MODID + ":blockForceFieldRelay" + tier);
}
/* TODO
// SECURITY STATION
blockSecurityStation = new BlockSecurityStation();
GameRegistry.registerBlock(blockSecurityStation, ItemBlockAbstractBase.class, "blockSecurityStation");
GameRegistry.registerTileEntity(TileEntitySecurityStation.class, MODID + ":blockSecurityStation");
*/
itemForceFieldShape = new ItemForceFieldShape();
GameRegistry.registerItem(itemForceFieldShape, "itemForceFieldShape");
itemForceFieldUpgrade = new ItemForceFieldUpgrade();
GameRegistry.registerItem(itemForceFieldUpgrade, "itemForceFieldUpgrade");
if (WarpDriveConfig.ACCELERATOR_ENABLE) {
/*
// ACCELERATOR CONTROLLER
blockAcceleratorController = new BlockAcceleratorController();
GameRegistry.registerBlock(blockAcceleratorController, ItemBlockAbstractBase.class, "blockAcceleratorController");
@ -554,26 +561,26 @@ public class WarpDrive implements LoadingCallback {
blockElectromagnetGlass = new Block[3];
blockChillers = new Block[3];
for (byte tier = 1; tier <= 3; tier++) {
int index = tier - 1;
// ELECTROMAGNETS PLAIN
final int index = tier - 1;
// plain electromagnets
blockElectromagnetPlain[index] = new BlockElectromagnetPlain(tier);
GameRegistry.registerBlock(blockElectromagnetPlain[index], ItemBlockAbstractBase.class, "blockElectromagnetPlain" + tier);
// ELECTROMAGNETS GLASS
// glass electromagnets
blockElectromagnetGlass[index] = new BlockElectromagnetGlass(tier);
GameRegistry.registerBlock(blockElectromagnetGlass[index], ItemBlockAbstractBase.class, "blockElectromagnetGlass" + tier);
// CHILLER
// chiller
blockChillers[index] = new BlockChiller(tier);
GameRegistry.registerBlock(blockChillers[index], ItemBlockAbstractBase.class, "blockChiller" + tier);
}
}
// DECORATIVE
// decorative
blockDecorative = new BlockDecorative();
GameRegistry.registerBlock(blockDecorative, ItemBlockDecorative.class, "blockDecorative");
// HULL BLOCKS
// hull blocks
blockHulls_plain = new Block[3][EnumHullPlainType.length];
blockHulls_glass = new Block[3];
blockHulls_omnipanel = new Block[3];
@ -638,20 +645,13 @@ public class WarpDrive implements LoadingCallback {
itemTuningDriver = new ItemTuningDriver();
GameRegistry.registerItem(itemTuningDriver, "itemTuningDriver");
// FORCE FIELD UPGRADES
itemForceFieldShape = new ItemForceFieldShape();
GameRegistry.registerItem(itemForceFieldShape, "itemForceFieldShape");
itemForceFieldUpgrade = new ItemForceFieldUpgrade();
GameRegistry.registerItem(itemForceFieldUpgrade, "itemForceFieldUpgrade");
// electromagnetic cell
if (WarpDriveConfig.ACCELERATOR_ENABLE) {
// ELECTROMAGNETIC CELL
itemElectromagneticCell = new ItemElectromagneticCell();
GameRegistry.registerItem(itemElectromagneticCell, "itemElectromagneticCell");
}
// DAMAGE SOURCES
// damage sources
damageAsphyxia = new DamageAsphyxia();
damageCold = new DamageCold();
damageIrradiation = new DamageIrradiation();

View file

@ -238,9 +238,9 @@ public abstract class BlockAbstractOmnipanel extends BlockAbstractBase {
return true;
}
public int getConnectionMask(IBlockAccess world, int x, int y, int z, ForgeDirection forgeDirection) {
final Block block = world.getBlock(x, y, z);
public int getConnectionMask(IBlockAccess blockAccess, int x, int y, int z, ForgeDirection forgeDirection) {
final Block block = blockAccess.getBlock(x, y, z);
return (block.func_149730_j() || block == this || block.getMaterial() == Material.glass || block instanceof BlockPane ? 1 : 0)
+ (block.isSideSolid(world, x, y, z, forgeDirection.getOpposite()) ? 2 : 0);
+ (block.isSideSolid(blockAccess, x, y, z, forgeDirection.getOpposite()) ? 2 : 0);
}
}

View file

@ -33,8 +33,8 @@ public class BlockLaserMedium extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0 || side == 1) {
return iconBuffer[8];
}

View file

@ -39,7 +39,7 @@ public abstract class TileEntityAbstractEnergy extends TileEntityAbstractInterfa
protected int IC2_sinkTier = 3;
protected int IC2_sourceTier = 3;
private final static int SCAN_INTERVAL_TICKS = 20;
private static final int SCAN_INTERVAL_TICKS = 20;
private int scanTickCount = SCAN_INTERVAL_TICKS;
private Object[] cofhEnergyReceivers;

View file

@ -51,7 +51,7 @@ public class BlockAbstractAccelerator extends BlockAbstractBase implements IBloc
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess blockAccess, int x, int y, int z) {
return false;
}
}

View file

@ -4,6 +4,9 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockElectromagnetGlass extends BlockElectromagnetPlain {
public BlockElectromagnetGlass(final byte tier) {
@ -28,12 +31,13 @@ public class BlockElectromagnetGlass extends BlockElectromagnetPlain {
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
if (world.isAirBlock(x, y, z)) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (blockAccess.isAirBlock(x, y, z)) {
return true;
}
Block sideBlock = world.getBlock(x, y, z);
Block sideBlock = blockAccess.getBlock(x, y, z);
return !(sideBlock instanceof BlockElectromagnetGlass);
}
}

View file

@ -3,6 +3,9 @@ package cr0s.warpdrive.block.atomic;
import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockVoidShellGlass extends BlockVoidShellPlain {
public BlockVoidShellGlass() {
@ -21,12 +24,13 @@ public class BlockVoidShellGlass extends BlockVoidShellPlain {
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
if (world.isAirBlock(x, y, z)) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (blockAccess.isAirBlock(x, y, z)) {
return true;
}
Block sideBlock = world.getBlock(x, y, z);
Block sideBlock = blockAccess.getBlock(x, y, z);
return !(sideBlock instanceof BlockElectromagnetGlass);
}
}

View file

@ -1,6 +1,7 @@
package cr0s.warpdrive.block.breathing;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.block.BlockAbstractBase;
import cr0s.warpdrive.config.WarpDriveConfig;
import cr0s.warpdrive.render.RenderBlockStandard;
@ -18,8 +19,8 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockAbstractAir extends Block {
public abstract class BlockAbstractAir extends BlockAbstractBase {
@SideOnly(Side.CLIENT)
private IIcon[] iconBuffer;
@ -36,7 +37,7 @@ public abstract class BlockAbstractAir extends Block {
}
@Override
public boolean isAir(IBlockAccess world, int x, int y, int z) {
public boolean isAir(IBlockAccess blockAccess, int x, int y, int z) {
return true;
}
@ -46,7 +47,7 @@ public abstract class BlockAbstractAir extends Block {
}
@Override
public boolean isReplaceable(IBlockAccess world, int x, int y, int z) {
public boolean isReplaceable(IBlockAccess blockAccess, int x, int y, int z) {
return true;
}
@ -115,18 +116,19 @@ public abstract class BlockAbstractAir extends Block {
return 0;
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (WarpDriveConfig.BREATHING_AIR_BLOCK_DEBUG) {
return side == 0 || side == 1;
}
Block sideBlock = world.getBlock(x, y, z);
Block sideBlock = blockAccess.getBlock(x, y, z);
if (sideBlock instanceof BlockAbstractAir) {
return false;
}
return world.isAirBlock(x, y, z);
return blockAccess.isAirBlock(x, y, z);
}
@Override

View file

@ -11,7 +11,7 @@ import net.minecraft.world.World;
public class BlockAir extends BlockAbstractAir {
private final static int AIR_BLOCK_TICKS = 40;
private static final int AIR_BLOCK_TICKS = 40;
public BlockAir() {
super();

View file

@ -1,6 +1,5 @@
package cr0s.warpdrive.block.breathing;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.data.StateAir;
import cr0s.warpdrive.event.ChunkHandler;
@ -18,17 +17,9 @@ public class BlockAirFlow extends BlockAbstractAir {
if (!world.isRemote) {
final StateAir stateAir = ChunkHandler.getStateAir(world, x, y, z);
if (!stateAir.isAirFlow() || stateAir.concentration == 0) {
if (WarpDrive.isDev) {
WarpDrive.logger.info(String.format("Recovering: AirFlow removal by collision at %s", stateAir));
}
world.setBlockToAir(x, y, z);
}
}
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
}
@Override
public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) {
return super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
}
}

View file

@ -85,17 +85,17 @@ public class BlockAirGenerator extends BlockAbstractContainer {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityAirGenerator) {
TileEntityAirGenerator airGenerator = (TileEntityAirGenerator)tileEntity;
ItemStack heldItemStack = entityPlayer.getHeldItem();
if (heldItemStack == null) {
ItemStack itemStackHeld = entityPlayer.getHeldItem();
if (itemStackHeld == null) {
Commons.addChatMessage(entityPlayer, airGenerator.getStatus());
return true;
} else {
Item heldItem = heldItemStack.getItem();
if (heldItem != null && (heldItem instanceof IAirContainerItem)) {
IAirContainerItem airCanister = (IAirContainerItem) heldItem;
if (airCanister.canContainAir(heldItemStack) && airGenerator.energy_consume(WarpDriveConfig.BREATHING_ENERGY_PER_CANISTER, true)) {
Item itemHeld = itemStackHeld.getItem();
if (itemHeld instanceof IAirContainerItem) {
IAirContainerItem airCanister = (IAirContainerItem) itemHeld;
if (airCanister.canContainAir(itemStackHeld) && airGenerator.energy_consume(WarpDriveConfig.BREATHING_ENERGY_PER_CANISTER, true)) {
entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1);
ItemStack toAdd = airCanister.getFullAirContainer(heldItemStack);
ItemStack toAdd = airCanister.getFullAirContainer(itemStackHeld);
if (toAdd != null) {
if (!entityPlayer.inventory.addItemStackToInventory(toAdd)) {
EntityItem entityItem = new EntityItem(entityPlayer.worldObj, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, toAdd);

View file

@ -49,8 +49,8 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == (metadata & 7)) {
if ((metadata & 8) == 0) { // Inactive state
return iconBuffer[ICON_INACTIVE_SIDE];
@ -100,17 +100,17 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityAirGeneratorTiered) {
TileEntityAirGeneratorTiered airGenerator = (TileEntityAirGeneratorTiered)tileEntity;
ItemStack heldItemStack = entityPlayer.getHeldItem();
if (heldItemStack == null) {
ItemStack itemStackHeld = entityPlayer.getHeldItem();
if (itemStackHeld == null) {
Commons.addChatMessage(entityPlayer, airGenerator.getStatus());
return true;
} else {
Item heldItem = heldItemStack.getItem();
if (heldItem != null && (heldItem instanceof IAirContainerItem)) {
IAirContainerItem airCanister = (IAirContainerItem) heldItem;
if (airCanister.canContainAir(heldItemStack) && airGenerator.energy_consume(WarpDriveConfig.BREATHING_ENERGY_PER_CANISTER, true)) {
Item itemHeld = itemStackHeld.getItem();
if (itemHeld instanceof IAirContainerItem) {
IAirContainerItem airCanister = (IAirContainerItem) itemHeld;
if (airCanister.canContainAir(itemStackHeld) && airGenerator.energy_consume(WarpDriveConfig.BREATHING_ENERGY_PER_CANISTER, true)) {
entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1);
ItemStack toAdd = airCanister.getFullAirContainer(heldItemStack);
ItemStack toAdd = airCanister.getFullAirContainer(itemStackHeld);
if (toAdd != null) {
if (!entityPlayer.inventory.addItemStackToInventory(toAdd)) {
EntityItem entityItem = new EntityItem(entityPlayer.worldObj, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, toAdd);

View file

@ -142,9 +142,9 @@ public class TileEntityAirGeneratorTiered extends TileEntityAbstractEnergy {
@Override
public String toString() {
return String.format("%s @ \'%s\' (%d %d %d)",
getClass().getSimpleName(),
worldObj == null ? "~NULL~" : worldObj.getWorldInfo().getWorldName(),
xCoord, yCoord, zCoord);
getClass().getSimpleName(),
worldObj == null ? "~NULL~" : worldObj.getWorldInfo().getWorldName(),
xCoord, yCoord, zCoord);
}
public Object[] enable(Object[] arguments) {

View file

@ -12,11 +12,16 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cr0s.warpdrive.block.BlockAbstractContainer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockShipScanner extends BlockAbstractContainer {
@SideOnly(Side.CLIENT)
private IIcon[] iconBuffer;
private final static int ICON_BOTTOM = 0;
private final static int ICON_TOP = 1;
private final static int ICON_SIDE = 2;
private static final int ICON_BOTTOM = 0;
private static final int ICON_TOP = 1;
private static final int ICON_SIDE = 2;
public BlockShipScanner() {
super(Material.iron);

View file

@ -14,17 +14,22 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockLaserTreeFarm extends BlockAbstractContainer {
@SideOnly(Side.CLIENT)
private IIcon[] iconBuffer;
public final static int ICON_IDLE = 0;
public final static int ICON_FARMING_LOW_POWER = 1;
public final static int ICON_FARMING_POWERED = 2;
public final static int ICON_SCANNING_LOW_POWER = 3;
public final static int ICON_SCANNING_POWERED = 4;
public final static int ICON_PLANTING_LOW_POWER = 5;
public final static int ICON_PLANTING_POWERED = 6;
private final static int ICON_BOTTOM = 7;
private final static int ICON_TOP = 8;
public static final int ICON_IDLE = 0;
public static final int ICON_FARMING_LOW_POWER = 1;
public static final int ICON_FARMING_POWERED = 2;
public static final int ICON_SCANNING_LOW_POWER = 3;
public static final int ICON_SCANNING_POWERED = 4;
public static final int ICON_PLANTING_LOW_POWER = 5;
public static final int ICON_PLANTING_POWERED = 6;
private static final int ICON_BOTTOM = 7;
private static final int ICON_TOP = 8;
public BlockLaserTreeFarm() {
super(Material.iron);
@ -46,8 +51,8 @@ public class BlockLaserTreeFarm extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0) {
return iconBuffer[ICON_BOTTOM];
}

View file

@ -14,15 +14,20 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMiningLaser extends BlockAbstractContainer {
@SideOnly(Side.CLIENT)
private IIcon[] iconBuffer;
public final static int ICON_IDLE = 0;
public final static int ICON_MINING_LOW_POWER = 1;
public final static int ICON_MINING_POWERED = 2;
public final static int ICON_SCANNING_LOW_POWER = 3;
public final static int ICON_SCANNING_POWERED = 4;
private final static int ICON_BOTTOM = 5;
private final static int ICON_TOP = 6;
public static final int ICON_IDLE = 0;
public static final int ICON_MINING_LOW_POWER = 1;
public static final int ICON_MINING_POWERED = 2;
public static final int ICON_SCANNING_LOW_POWER = 3;
public static final int ICON_SCANNING_POWERED = 4;
private static final int ICON_BOTTOM = 5;
private static final int ICON_TOP = 6;
public BlockMiningLaser() {
super(Material.iron);
@ -42,8 +47,8 @@ public class BlockMiningLaser extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0) {
return iconBuffer[ICON_BOTTOM];
}

View file

@ -33,8 +33,8 @@ public class BlockCloakingCore extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (metadata < iconBuffer.length) {
return iconBuffer[metadata];
}
@ -62,11 +62,6 @@ public class BlockCloakingCore extends BlockAbstractContainer {
return 3;
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
return Item.getItemFromBlock(this);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) {
if (world.isRemote) {

View file

@ -32,8 +32,8 @@ public class BlockMonitor extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = blockAccess.getBlockMetadata(x, y, z);
return side == metadata ? iconFront : iconSide;
}

View file

@ -40,8 +40,8 @@ public class BlockRadar extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0) {
return iconBuffer[ICON_BOTTOM];
} else if (side == 1) {

View file

@ -24,10 +24,11 @@ import net.minecraft.world.ChunkPosition;
import cpw.mods.fml.common.Optional;
public class TileEntityCamera extends TileEntityAbstractInterfaced implements IVideoChannel {
private int videoChannel = -1;
private final static int REGISTRY_UPDATE_INTERVAL_TICKS = 15 * 20;
private final static int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private static final int REGISTRY_UPDATE_INTERVAL_TICKS = 15 * 20;
private static final int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private int packetSendTicks = 10;
private int registryUpdateTicks = 20;

View file

@ -22,9 +22,10 @@ import net.minecraft.util.StatCollector;
import cpw.mods.fml.common.Optional;
public class TileEntityMonitor extends TileEntityAbstractInterfaced implements IVideoChannel {
private int videoChannel = -1;
private final static int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private static final int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private int packetSendTicks = 10;
public TileEntityMonitor() {

View file

@ -39,8 +39,8 @@ public class BlockEnanReactorCore extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0 || side == 1) {
return iconBuffer[16];
}

View file

@ -44,8 +44,8 @@ public class BlockEnanReactorLaser extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0 || side == 1) {
return iconBuffer[0];
}

View file

@ -82,8 +82,8 @@ public class BlockEnergyBank extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final TileEntity tileEntity = blockAccess.getTileEntity(x, y, z);
if (tileEntity == null || !(tileEntity instanceof TileEntityEnergyBank)) {
return icons[3];
}
@ -109,6 +109,7 @@ public class BlockEnergyBank extends BlockAbstractContainer {
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) {
if (world.isRemote) {

View file

@ -33,15 +33,15 @@ public class BlockIC2reactorLaserMonitor extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int meta = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
final TileEntity tileEntity = blockAccess.getTileEntity(x, y, z);
if (tileEntity == null || !(tileEntity instanceof TileEntityIC2reactorLaserMonitor)) {
return icons[0];
}
if (((TileEntityIC2reactorLaserMonitor)tileEntity).isSideActive(side)) {
if ((meta & 8) == 0) {
if ((metadata & 8) == 0) {
return icons[1];
} else {
return icons[2];

View file

@ -85,7 +85,7 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTab, List list) {
/* Hide in NEI
for (int i = 0; i < 16; ++i) {
for (int i = 0; i < 16; i++) {
list.add(new ItemStack(item, 1, i));
}
/**/
@ -102,27 +102,30 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderBlockPass() {
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderType() {
return RenderBlockForceField.renderId;
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
if (world.isAirBlock(x, y, z)) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (blockAccess.isAirBlock(x, y, z)) {
return true;
}
ForgeDirection direction = ForgeDirection.getOrientation(side).getOpposite();
Block sideBlock = world.getBlock(x, y, z);
Block sideBlock = blockAccess.getBlock(x, y, z);
if (sideBlock instanceof BlockGlass || sideBlock instanceof BlockHullGlass || sideBlock instanceof BlockForceField) {
return world.getBlockMetadata(x, y, z)
!= world.getBlockMetadata(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ);
return blockAccess.getBlockMetadata(x, y, z)
!= blockAccess.getBlockMetadata(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ);
}
return !world.isSideSolid(x, y, z, direction, false);
return !blockAccess.isSideSolid(x, y, z, direction, false);
}
protected TileEntityForceFieldProjector getProjector(World world, int x, int y, int z) {

View file

@ -54,9 +54,9 @@ public class BlockForceFieldProjector extends BlockAbstractForceField {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
final TileEntity tileEntity = blockAccess.getTileEntity(x, y, z);
if (tileEntity == null || !(tileEntity instanceof TileEntityForceFieldProjector)) {
return icons[0];
}

View file

@ -44,8 +44,8 @@ public class BlockForceFieldRelay extends BlockAbstractForceField {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final TileEntity tileEntity = blockAccess.getTileEntity(x, y, z);
if (tileEntity == null || !(tileEntity instanceof TileEntityForceFieldRelay)) {
return icons[0];
}

View file

@ -16,6 +16,8 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageReceiver {
@ -65,18 +67,19 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR
}
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
if (world.isAirBlock(x, y, z)) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (blockAccess.isAirBlock(x, y, z)) {
return true;
}
ForgeDirection direction = ForgeDirection.getOrientation(side).getOpposite();
Block sideBlock = world.getBlock(x, y, z);
Block sideBlock = blockAccess.getBlock(x, y, z);
if (sideBlock instanceof BlockGlass || sideBlock instanceof BlockHullGlass) {
return world.getBlockMetadata(x, y, z)
!= world.getBlockMetadata(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ);
return blockAccess.getBlockMetadata(x, y, z)
!= blockAccess.getBlockMetadata(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ);
}
return !world.isSideSolid(x, y, z, direction, false);
return !blockAccess.isSideSolid(x, y, z, direction, false);
}
@Override

View file

@ -24,7 +24,7 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockHullPlain extends BlockAbstractBase implements IBlockBase, IDamageReceiver {
public class BlockHullPlain extends BlockAbstractBase implements IDamageReceiver {
@SideOnly(Side.CLIENT)
private IIcon[] icons;

View file

@ -176,8 +176,8 @@ public class BlockHullSlab extends BlockSlab implements IBlockBase, IDamageRecei
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
final int metadata = world.getBlockMetadata(x, y, z);
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
setBlockBoundsFromMetadata(metadata);
}
@ -268,10 +268,10 @@ public class BlockHullSlab extends BlockSlab implements IBlockBase, IDamageRecei
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
if (this.field_150004_a) {
return super.shouldSideBeRendered(world, x, y, z, side);
} else if (side != 1 && side != 0 && !super.shouldSideBeRendered(world, x, y, z, side)) {
return super.shouldSideBeRendered(blockAccess, x, y, z, side);
} else if (side != 1 && side != 0 && !super.shouldSideBeRendered(blockAccess, x, y, z, side)) {
return false;
} else {
return true;

View file

@ -16,6 +16,7 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class BlockHullStairs extends BlockStairs implements IBlockBase, IDamageReceiver {
protected final byte tier;
private final int metaHull;

View file

@ -34,8 +34,8 @@ public class BlockLift extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (metadata > 2) {
return iconBuffer[0];
}

View file

@ -50,8 +50,8 @@ public class BlockShipController extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0) {
return iconBuffer[ICON_BOTTOM];
} else if (side == 1) {

View file

@ -43,8 +43,8 @@ public class BlockShipCore extends BlockAbstractContainer {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int metadata = world.getBlockMetadata(x, y, z);
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
final int metadata = blockAccess.getBlockMetadata(x, y, z);
if (side == 0) {
return iconBuffer[ICON_BOTTOM];
} else if (side == 1) {

View file

@ -36,7 +36,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy {
private double lockStrengthMul = 1;
private boolean isLocked = false;
private final static Vector3 centreOnMe = new Vector3(0.5D, 1.0D, 0.5D);
private static final Vector3 centreOnMe = new Vector3(0.5D, 1.0D, 0.5D);
private Vector3 sourceVec = new Vector3();
private Vector3 destVec = new Vector3();

View file

@ -13,15 +13,21 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockDecorative extends Block {
@SideOnly(Side.CLIENT)
private static IIcon[] icons;
private static ItemStack[] itemStackCache;
public BlockDecorative() {
super(Material.iron);
setHardness(1.5f);
setStepSound(Block.soundTypeMetal);
setBlockName("warpdrive.passive.Plain");
setBlockName("warpdrive.decoration.decorative.plain");
setCreativeTab(WarpDrive.creativeTabWarpDrive);
icons = new IIcon[EnumDecorativeType.length];
@ -38,7 +44,7 @@ public class BlockDecorative extends Block {
@Override
public void registerBlockIcons(IIconRegister iconRegister) {
for (EnumDecorativeType enumDecorativeType : EnumDecorativeType.values()) {
icons[enumDecorativeType.ordinal()] = iconRegister.registerIcon("warpdrive:passive/decorative" + enumDecorativeType.unlocalizedName);
icons[enumDecorativeType.ordinal()] = iconRegister.registerIcon("warpdrive:decoration/decorative-" + enumDecorativeType.unlocalizedName);
}
}

View file

@ -2,27 +2,43 @@ package cr0s.warpdrive.block.passive;
import cr0s.warpdrive.WarpDrive;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockGas extends Block {
@SideOnly(Side.CLIENT)
private IIcon[] iconBuffer;
public BlockGas() {
super(Material.fire);
setHardness(0.0F);
setCreativeTab(WarpDrive.creativeTabWarpDrive);
setBlockName("warpdrive.passive.Gas");
setBlockName("warpdrive.decoration.gas");
}
@Override
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
for (int index = 0; index < 12; index++) {
list.add(new ItemStack(item, 1, index));
}
}
@Override
public boolean isOpaqueCube() {
return false;
@ -61,18 +77,18 @@ public class BlockGas extends Block {
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
iconBuffer = new IIcon[12];
iconBuffer[0] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockBlue");
iconBuffer[1] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockRed");
iconBuffer[2] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockGreen");
iconBuffer[3] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockYellow");
iconBuffer[4] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockDark");
iconBuffer[5] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockDarkness");
iconBuffer[6] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockWhite");
iconBuffer[7] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockMilk");
iconBuffer[8] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockOrange");
iconBuffer[9] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockSyren");
iconBuffer[10] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockGray");
iconBuffer[11] = par1IconRegister.registerIcon("warpdrive:passive/gasBlockViolet");
iconBuffer[0] = par1IconRegister.registerIcon("warpdrive:decoration/gas-blue");
iconBuffer[1] = par1IconRegister.registerIcon("warpdrive:decoration/gas-red");
iconBuffer[2] = par1IconRegister.registerIcon("warpdrive:decoration/gas-green");
iconBuffer[3] = par1IconRegister.registerIcon("warpdrive:decoration/gas-yellow");
iconBuffer[4] = par1IconRegister.registerIcon("warpdrive:decoration/gas-dark");
iconBuffer[5] = par1IconRegister.registerIcon("warpdrive:decoration/gas-darkness");
iconBuffer[6] = par1IconRegister.registerIcon("warpdrive:decoration/gas-white");
iconBuffer[7] = par1IconRegister.registerIcon("warpdrive:decoration/gas-milk");
iconBuffer[8] = par1IconRegister.registerIcon("warpdrive:decoration/gas-orange");
iconBuffer[9] = par1IconRegister.registerIcon("warpdrive:decoration/gas-siren");
iconBuffer[10] = par1IconRegister.registerIcon("warpdrive:decoration/gas-gray");
iconBuffer[11] = par1IconRegister.registerIcon("warpdrive:decoration/gas-violet");
}
@Override
@ -94,14 +110,15 @@ public class BlockGas extends Block {
public int quantityDropped(Random par1Random) {
return 0;
}
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
Block sideBlock = world.getBlock(x, y, z);
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
Block sideBlock = blockAccess.getBlock(x, y, z);
if (sideBlock.isAssociatedBlock(this)) {
return false;
}
return world.isAirBlock(x, y, z);
return blockAccess.isAirBlock(x, y, z);
}
@Override

View file

@ -15,7 +15,7 @@ public class ItemBlockDecorative extends ItemBlock {
public ItemBlockDecorative(Block block) {
super(block);
setHasSubtypes(true);
setUnlocalizedName("warpdrive.passive.decorative");
setUnlocalizedName("warpdrive.decoration.decorative");
}
@Override
@ -35,6 +35,6 @@ public class ItemBlockDecorative extends ItemBlock {
if (itemstack == null) {
return getUnlocalizedName();
}
return "tile.warpdrive.passive." + EnumDecorativeType.get(itemstack.getItemDamage()).unlocalizedName;
return "tile.warpdrive.decoration.decorative." + EnumDecorativeType.get(itemstack.getItemDamage()).unlocalizedName;
}
}

View file

@ -24,10 +24,11 @@ import net.minecraft.world.ChunkPosition;
import cpw.mods.fml.common.Optional;
public class TileEntityLaserCamera extends TileEntityLaser implements IVideoChannel {
private int videoChannel = -1;
private final static int REGISTRY_UPDATE_INTERVAL_TICKS = 15 * 20;
private final static int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private static final int REGISTRY_UPDATE_INTERVAL_TICKS = 15 * 20;
private static final int PACKET_SEND_INTERVAL_TICKS = 60 * 20;
private int packetSendTicks = 10;
private int registryUpdateTicks = 20;

View file

@ -30,17 +30,17 @@ public class CommandSpace extends CommandBase {
}
@Override
public void processCommand(ICommandSender sender, String[] params) {
if (sender == null) { return; }
public void processCommand(ICommandSender commandSender, String[] params) {
if (commandSender == null) { return; }
MinecraftServer server = MinecraftServer.getServer();
// set defaults
int targetDimensionId = Integer.MAX_VALUE;
EntityPlayerMP[] entityPlayerMPs = null;
if (sender instanceof EntityPlayerMP) {
if (commandSender instanceof EntityPlayerMP) {
entityPlayerMPs = new EntityPlayerMP[1];
entityPlayerMPs[0] = (EntityPlayerMP) sender;
entityPlayerMPs[0] = (EntityPlayerMP) commandSender;
}
// parse arguments
@ -49,37 +49,37 @@ public class CommandSpace extends CommandBase {
// nop
} else if (params.length == 1) {
if (params[0].equalsIgnoreCase("help") || params[0].equalsIgnoreCase("?")) {
Commons.addChatMessage(sender, getCommandUsage(sender));
Commons.addChatMessage(commandSender, getCommandUsage(commandSender));
return;
}
EntityPlayerMP[] entityPlayerMPs_found = getOnlinePlayerByNameOrSelector(sender, params[0]);
EntityPlayerMP[] entityPlayerMPs_found = getOnlinePlayerByNameOrSelector(commandSender, params[0]);
if (entityPlayerMPs_found != null) {
entityPlayerMPs = entityPlayerMPs_found;
} else if (sender instanceof EntityPlayer) {
targetDimensionId = StarMapRegistry.getDimensionId(params[0], (EntityPlayer) sender);
} else if (commandSender instanceof EntityPlayer) {
targetDimensionId = StarMapRegistry.getDimensionId(params[0], (EntityPlayer) commandSender);
} else {
Commons.addChatMessage(sender, "/space: player not found '" + params[0] + "'");
Commons.addChatMessage(commandSender, "/space: player not found '" + params[0] + "'");
return;
}
} else if (params.length == 2) {
EntityPlayerMP[] entityPlayerMPs_found = getOnlinePlayerByNameOrSelector(sender, params[0]);
EntityPlayerMP[] entityPlayerMPs_found = getOnlinePlayerByNameOrSelector(commandSender, params[0]);
if (entityPlayerMPs_found != null) {
entityPlayerMPs = entityPlayerMPs_found;
} else {
Commons.addChatMessage(sender, "/space: player not found '" + params[0] + "'");
Commons.addChatMessage(commandSender, "/space: player not found '" + params[0] + "'");
return;
}
targetDimensionId = StarMapRegistry.getDimensionId(params[1], entityPlayerMPs[0]);
} else {
Commons.addChatMessage(sender, "/space: too many arguments " + params.length);
Commons.addChatMessage(commandSender, "/space: too many arguments " + params.length);
return;
}
// check player
if (entityPlayerMPs == null || entityPlayerMPs.length <= 0) {
Commons.addChatMessage(sender, "/space: undefined player");
Commons.addChatMessage(commandSender, "/space: undefined player");
return;
}
@ -91,7 +91,7 @@ public class CommandSpace extends CommandBase {
if (targetDimensionId == Integer.MAX_VALUE) {
CelestialObject celestialObject = StarMapRegistry.getCelestialObject(entityPlayerMP.worldObj.provider.dimensionId, (int) entityPlayerMP.posX, (int) entityPlayerMP.posZ);
if (celestialObject == null) {
Commons.addChatMessage(sender,
Commons.addChatMessage(commandSender,
String.format("/space: player %s is in unknown dimension %d. Try specifying an explicit target dimension instead.",
entityPlayerMP.getCommandSenderName(), entityPlayerMP.worldObj.provider.dimensionId));
return;
@ -102,9 +102,9 @@ public class CommandSpace extends CommandBase {
if (celestialObject == null) {
targetDimensionId = 0;
} else if (celestialObject.isVirtual) {
Commons.addChatMessage(sender,
String.format("/space: player %s closest celestial object is virtual (%s). Try specifying an explicit target dimension instead.",
entityPlayerMP.getCommandSenderName(), celestialObject.getFullName()));
Commons.addChatMessage(commandSender,
String.format("/space: player %s closest celestial object is virtual (%s). Try specifying an explicit target dimension instead.",
entityPlayerMP.getCommandSenderName(), celestialObject.getFullName()));
return;
} else {
targetDimensionId = celestialObject.dimensionId;
@ -147,16 +147,16 @@ public class CommandSpace extends CommandBase {
// get target world
WorldServer targetWorld = server.worldServerForDimension(targetDimensionId);
if (targetWorld == null) {
Commons.addChatMessage(sender, "/space: undefined dimension '" + targetDimensionId + "'");
Commons.addChatMessage(commandSender, "/space: undefined dimension '" + targetDimensionId + "'");
return;
}
// inform player
String message = "Teleporting player " + entityPlayerMP.getCommandSenderName() + " to dimension " + targetDimensionId + "..."; // + ":" + targetWorld.getWorldInfo().getWorldName();
Commons.addChatMessage(sender, message);
Commons.addChatMessage(commandSender, message);
WarpDrive.logger.info(message);
if (sender != entityPlayerMP) {
Commons.addChatMessage(entityPlayerMP, sender.getCommandSenderName() + " is teleporting you to dimension " + targetDimensionId); // + ":" + targetWorld.getWorldInfo().getWorldName());
if (commandSender != entityPlayerMP) {
Commons.addChatMessage(entityPlayerMP, commandSender.getCommandSenderName() + " is teleporting you to dimension " + targetDimensionId); // + ":" + targetWorld.getWorldInfo().getWorldName());
}
// find a good spot

View file

@ -876,7 +876,7 @@ public class Recipes {
if (WarpDriveConfig.isThermalExpansionLoaded) {
oreCoolant = "dustCryotheum";
} else if (WarpDriveConfig.isIndustrialCraft2Loaded) {
oreCoolant = WarpDriveConfig.getModItemStack("IC2", "reactorCoolantSimple", -1);
oreCoolant = WarpDriveConfig.getModItemStack("IC2", "reactorCoolantSimple", -1); // 10k Coolant Cell
}
GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.getItemStack(EnumComponentType.SUPERCONDUCTOR), false, "pcp", "cec", "pcp",
'p', ItemComponent.getItemStack(EnumComponentType.POWER_INTERFACE),

View file

@ -300,7 +300,7 @@ public class WarpDriveConfig {
public static int[] BREATHING_AIR_GENERATION_RANGE_BLOCKS = { 16, 48, 144 };
public static int BREATHING_REPRESSURIZATION_SPEED_BLOCKS = 512;
public static int BREATHING_AIR_SIMULATION_DELAY_TICKS = 30;
public final static boolean BREATHING_AIR_BLOCK_DEBUG = false;
public static final boolean BREATHING_AIR_BLOCK_DEBUG = false;
public static boolean BREATHING_AIR_AT_ENTITY_DEBUG = false;
// IC2 Reactor monitor
@ -344,6 +344,8 @@ public class WarpDriveConfig {
// 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 Block getModBlock(final String mod, final String id) {

View file

@ -13,22 +13,22 @@ import net.minecraft.world.World;
public class AsteroidFieldInstance extends AbstractStructureInstance {
public AsteroidFieldInstance(AsteroidField asteroidField, Random random) {
public AsteroidFieldInstance(final AsteroidField asteroidField, final Random random) {
super(asteroidField, random);
}
public AsteroidFieldInstance(NBTTagCompound tag) {
public AsteroidFieldInstance(final NBTTagCompound tag) {
super(tag);
// TODO not implemented
}
@Override
public void WriteToNBT(NBTTagCompound tag) {
public void WriteToNBT(final NBTTagCompound tag) {
super.WriteToNBT(tag);
// TODO not implemented
}
private static float binomialRandom(World world) {
private static float binomialRandom(final World world) {
float linear = world.rand.nextFloat();
// ideal sphere repartition = x ^ 0.5 (sqrt)
// Dilution but slow to compute = 0.5 * ( x ^ 0.3 + 1 + (x - 1) ^ 3 )
@ -40,7 +40,7 @@ public class AsteroidFieldInstance extends AbstractStructureInstance {
}
@Override
public boolean generate(World world, Random random, final int x, final int y1, final int z) {
public boolean generate(final World world, final Random random, final int x, final int y1, final int z) {
LocalProfiler.start("SpaceWorldGenerator.generateAsteroidField");
// 6.0.1 au = 120 radius with 60 to 140 big + 60 to 140 small + 5 to 13 gaz
// 45238 blocks surface with 120 to 280 asteroids => 161 to 376 blocks per asteroid (big & small)
@ -84,7 +84,7 @@ public class AsteroidFieldInstance extends AbstractStructureInstance {
int maxHeight = 70 + world.rand.nextInt(50);
int y2 = Math.min(WarpDriveConfig.SPACE_GENERATOR_Y_MAX_BORDER - maxHeight,
Math.max(y1, WarpDriveConfig.SPACE_GENERATOR_Y_MIN_BORDER + maxHeight));
WarpDrive.logger.info("Generating asteroid field at " + x + "," + y2 + "," + z + " qty " + numOfBigAsteroids + ", " + numOfSmallAsteroids + ", "
WarpDrive.logger.info("Generating asteroid field at (" + x + " " + y2 + " " + z + ") qty " + numOfBigAsteroids + ", " + numOfSmallAsteroids + ", "
+ numOfClouds + " over " + maxDistance + ", " + maxHeight + " surfacePerAsteroid " + String.format("%.1f", surfacePerAsteroid));
// Setting up of big asteroids
@ -100,7 +100,7 @@ public class AsteroidFieldInstance extends AbstractStructureInstance {
int aZ = (int) (z + Math.round(horizontalRange * Math.sin(bearing)));
if (WarpDriveConfig.LOGGING_WORLD_GENERATION) {
WarpDrive.logger.info(String.format("Big asteroid: %.3f %.3f r %.3f r makes %3d, %3d, %3d",
WarpDrive.logger.info(String.format("Big asteroid: %.3f %.3f r %.3f r makes (%3d %3d %3d)",
(double) binomial, bearing, yawn, aX, aY, aZ));
}
@ -159,19 +159,19 @@ public class AsteroidFieldInstance extends AbstractStructureInstance {
return true;
}
private static void generateSmallShip(World world, final int x, final int y, final int z, final int jitter) {
private static void generateSmallShip(final World world, final int x, final int y, final int z, final int jitter) {
int x2 = x + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
int y2 = y + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
int z2 = z + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
WarpDrive.logger.info("Generating small ship at " + x2 + "," + y2 + "," + z2);
WarpDrive.logger.info("Generating small ship at " + x2 + " " + y2 + " " + z2);
new WorldGenSmallShip(world.rand.nextFloat() > 0.2F).generate(world, world.rand, x2, y2, z2);
}
private static void generateStation(World world, final int x, final int y, final int z, final int jitter) {
private static void generateStation(final World world, final int x, final int y, final int z, final int jitter) {
int x2 = x + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
int y2 = y + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
int z2 = z + (((world.rand.nextBoolean()) ? -1 : 1) * world.rand.nextInt(jitter));
WarpDrive.logger.info("Generating small ship at " + x2 + "," + y2 + "," + z2);
WarpDrive.logger.info("Generating station at " + x2 + " " + y2 + " " + z2);
new WorldGenStation(world.rand.nextBoolean()).generate(world, world.rand, x2, y2, z2);
}
}

View file

@ -12,7 +12,6 @@ import cr0s.warpdrive.block.atomic.BlockParticlesCollider;
import cr0s.warpdrive.block.atomic.BlockParticlesInjector;
import cr0s.warpdrive.block.atomic.BlockVoidShellPlain;
import cr0s.warpdrive.block.atomic.TileEntityAcceleratorControlPoint;
import cr0s.warpdrive.block.atomic.TileEntityAcceleratorController;
import cr0s.warpdrive.block.atomic.TileEntityParticlesInjector;
import cr0s.warpdrive.block.energy.BlockEnergyBank;
import cr0s.warpdrive.block.energy.TileEntityEnergyBank;
@ -148,7 +147,7 @@ public class AcceleratorSetup extends GlobalPosition {
// compute values
final int indexHighest = countMagnets[2] > 0 ? 2 : countMagnets[1] > 0 ? 1 : 0;
temperatureTarget_K = TileEntityAcceleratorController.ACCELERATOR_TEMPERATURES_K[indexHighest];
temperatureTarget_K = WarpDriveConfig.ACCELERATOR_TEMPERATURES_K[indexHighest];
final double coolingFactor = 10.0 / (countMagnets[0] + countMagnets[1] + countMagnets[2]);
temperatures_cooling_K_perTick[0] = (countChillers[0] * 1.00 + countChillers[1] * 0.75 + countChillers[2] * 0.5) * coolingFactor;
@ -544,7 +543,7 @@ public class AcceleratorSetup extends GlobalPosition {
}
// Pseudo-API for computers
public Object[][] getControlPoints(final IBlockAccess world) {
public Object[][] getControlPoints(final IBlockAccess blockAccess) {
final Object[][] objectResults = new Object[controlPoints.size() + keyInjectors.length][];
int index = 0;
for (final Entry<VectorI, Integer> entryControlPoint : controlPoints.entrySet()) {
@ -552,7 +551,7 @@ public class AcceleratorSetup extends GlobalPosition {
final String type = TrajectoryPoint.isCollider(entryControlPoint.getValue()) ? "Collider" :
TrajectoryPoint.isOutput(entryControlPoint.getValue()) ? "Output" :
TrajectoryPoint.isInput(entryControlPoint.getValue()) ? "Input" : "?";
final TileEntity tileEntity = entryControlPoint.getKey().getTileEntity(world);
final TileEntity tileEntity = entryControlPoint.getKey().getTileEntity(blockAccess);
final Boolean isEnabled = (tileEntity instanceof TileEntityAcceleratorControlPoint) && ((TileEntityAcceleratorControlPoint) tileEntity).getIsEnabled();
final Integer controlChannel = (tileEntity instanceof IControlChannel) ? ((IControlChannel) tileEntity).getControlChannel() : -1;
@ -563,7 +562,7 @@ public class AcceleratorSetup extends GlobalPosition {
for (final Entry<Integer, VectorI> entryControlPoint : mapInjectors.entrySet()) {
final Integer tier = 1;
final String type = "Injector";
final TileEntity tileEntity = entryControlPoint.getValue().getTileEntity(world);
final TileEntity tileEntity = entryControlPoint.getValue().getTileEntity(blockAccess);
final Boolean isEnabled = (tileEntity instanceof TileEntityParticlesInjector) && ((TileEntityParticlesInjector) tileEntity).getIsEnabled();
final Integer controlChannel = (tileEntity instanceof IControlChannel) ? ((IControlChannel) tileEntity).getControlChannel() : -1;

View file

@ -193,15 +193,17 @@ public class AirSpreader {
} else {
boolean hasGenerator = false;
final int metadataSource = world.getBlockMetadata(x, y, z);
ForgeDirection forgeDirection = ForgeDirection.getOrientation(metadataSource & 7).getOpposite();
Block block = world.getBlock(x + forgeDirection.offsetX,
y + forgeDirection.offsetY,
z + forgeDirection.offsetZ);
final ForgeDirection facingSource = ForgeDirection.getOrientation(metadataSource & 7);
final Block block = world.getBlock(x - facingSource.offsetX,
y - facingSource.offsetY,
z - facingSource.offsetZ);
if (block instanceof BlockAirGeneratorTiered) {
int metadataGenerator = world.getBlockMetadata(x + forgeDirection.offsetX,
y + forgeDirection.offsetY,
z + forgeDirection.offsetZ);
if ((metadataGenerator & 8) != 0 && (metadataGenerator & 7) == (metadataSource & 7)) {
final int metadataGenerator = world.getBlockMetadata(x - facingSource.offsetX,
y - facingSource.offsetY,
z - facingSource.offsetZ);
final ForgeDirection facingGenerator = ForgeDirection.getOrientation(metadataGenerator & 7);
final boolean isActiveGenerator = (metadataGenerator & 8) != 0;
if (isActiveGenerator && facingGenerator == facingSource) {
// all good
hasGenerator = true;
}

View file

@ -3,9 +3,9 @@ package cr0s.warpdrive.data;
import java.util.HashMap;
public enum EnumDecorativeType {
PLAIN ("Plain"),
ENERGIZED ("Energized"),
NETWORK ("Network");
PLAIN ("plain"),
ENERGIZED ("energized"),
NETWORK ("network");
public final String unlocalizedName;
@ -20,7 +20,7 @@ public enum EnumDecorativeType {
}
}
private EnumDecorativeType(String unlocalizedName) {
EnumDecorativeType(String unlocalizedName) {
this.unlocalizedName = unlocalizedName;
}

View file

@ -37,7 +37,7 @@ public enum EnumForceFieldUpgrade implements IForceFieldUpgrade, IForceFieldUpgr
FUSION ("fusion" , 1, 1, 1.0F, 1.0F, 0.000F, 0.000F, 0.000F, 0.000F, 1000.0F, 0.040F, 0.150F, 0.0F, "value is boolean"),
HEATING ("heating" , 3, 1, 100.0F, 10000.0F, 0.000F, 0.000F, 0.900F, 0.900F, 150.0F, 0.300F, 3.000F, 25.0F, "value is heat units"),
INVERSION ("inversion" , 1, 0, 1.0F, 1.0F, 1.250F, 1.250F, 0.000F, 0.000F, 1500.0F, 0.150F, 0.150F, 20.0F, "value is boolean"),
ITEM_PORT ("itemPort" , 0, 1, 1.0F, 10.0F, 0.000F, 0.000F, 0.950F, 0.900F, 50.0F, 0.120F, 0.500F, 2.0F, "value is boolean"),
ITEM_PORT ("item_port" , 0, 1, 1.0F, 10.0F, 0.000F, 0.000F, 0.950F, 0.900F, 50.0F, 0.120F, 0.500F, 2.0F, "value is boolean"),
PUMPING ("pumping" , 0, 1, 1000.0F, 50000.0F, 0.800F, 1.000F, 0.400F, 1.000F, 800.0F, 0.150F, 4.500F, 0.0F, "value is viscosity"),
RANGE ("range" , 4, 1, 8.0F, 56.0F, 1.150F, 0.800F, 1.150F, 0.800F, 10.0F, 0.300F, 0.750F, 12.0F, "value is bonus blocks"),
REPULSION ("repulsion" , 0, 1, 1.0F, 4.0F, 0.000F, 0.000F, 0.000F, 0.000F, 50.0F, 0.150F, 0.000F, 5.0F, "value is acceleration"),

View file

@ -95,16 +95,16 @@ public class Vector3 implements Cloneable {
return new Vector3(x, y, z);
}
public Block getBlockID(IBlockAccess world) {
return world.getBlock(intX(), intY(), intZ());
public Block getBlockID(IBlockAccess blockAccess) {
return blockAccess.getBlock(intX(), intY(), intZ());
}
public int getBlockMetadata(IBlockAccess world) {
return world.getBlockMetadata(intX(), intY(), intZ());
public int getBlockMetadata(IBlockAccess blockAccess) {
return blockAccess.getBlockMetadata(intX(), intY(), intZ());
}
public TileEntity getTileEntity(IBlockAccess world) {
return world.getTileEntity(intX(), intY(), intZ());
public TileEntity getTileEntity(IBlockAccess blockAccess) {
return blockAccess.getTileEntity(intX(), intY(), intZ());
}
public boolean setBlock(World world, Block id, int metadata, int notify) {

View file

@ -92,20 +92,20 @@ public class VectorI implements Cloneable {
return new VectorI(x + side.offsetX, y + side.offsetY, z + side.offsetZ);
}
public Block getBlock(IBlockAccess world) {
return world.getBlock(x, y, z);
public Block getBlock(IBlockAccess blockAccess) {
return blockAccess.getBlock(x, y, z);
}
public boolean isChunkLoaded(IBlockAccess world) {
return isChunkLoaded(world, x, z);
public boolean isChunkLoaded(IBlockAccess blockAccess) {
return isChunkLoaded(blockAccess, x, z);
}
static public boolean isChunkLoaded(IBlockAccess world, final int x, final int z) {
if (world instanceof WorldServer) {
return ChunkHandler.isLoaded((WorldServer) world, x, 64, z);
static public boolean isChunkLoaded(IBlockAccess blockAccess, final int x, final int z) {
if (blockAccess instanceof WorldServer) {
return ChunkHandler.isLoaded((WorldServer) blockAccess, x, 64, z);
/*
if (((WorldServer) world).getChunkProvider() instanceof ChunkProviderServer) {
ChunkProviderServer chunkProviderServer = (ChunkProviderServer) ((WorldServer) world).getChunkProvider();
if (((WorldServer) blockAccess).getChunkProvider() instanceof ChunkProviderServer) {
ChunkProviderServer chunkProviderServer = (ChunkProviderServer) ((WorldServer) blockAccess).getChunkProvider();
try {
Chunk chunk = (Chunk) chunkProviderServer.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x >> 4, z >> 4));
return chunk != null && chunk.isChunkLoaded;
@ -113,39 +113,39 @@ public class VectorI implements Cloneable {
return chunkProviderServer.chunkExists(x >> 4, z >> 4);
}
} else {
return ((WorldServer) world).getChunkProvider().chunkExists(x >> 4, z >> 4);
return ((WorldServer) blockAccess).getChunkProvider().chunkExists(x >> 4, z >> 4);
}
/**/
}
return true;
}
public Block getBlock_noChunkLoading(IBlockAccess world, ForgeDirection side) {
return getBlock_noChunkLoading(world, x + side.offsetX, y + side.offsetY, z + side.offsetZ);
public Block getBlock_noChunkLoading(IBlockAccess blockAccess, ForgeDirection side) {
return getBlock_noChunkLoading(blockAccess, x + side.offsetX, y + side.offsetY, z + side.offsetZ);
}
public Block getBlock_noChunkLoading(IBlockAccess world) {
return getBlock_noChunkLoading(world, x, y, z);
public Block getBlock_noChunkLoading(IBlockAccess blockAccess) {
return getBlock_noChunkLoading(blockAccess, x, y, z);
}
static public Block getBlock_noChunkLoading(IBlockAccess world, final int x, final int y, final int z) {
static public Block getBlock_noChunkLoading(IBlockAccess blockAccess, final int x, final int y, final int z) {
// skip unloaded worlds
if (world == null) {
if (blockAccess == null) {
return null;
}
// skip unloaded chunks
if (!isChunkLoaded(world, x, z)) {
if (!isChunkLoaded(blockAccess, x, z)) {
return null;
}
return world.getBlock(x, y, z);
return blockAccess.getBlock(x, y, z);
}
public TileEntity getTileEntity(IBlockAccess world) {
return world.getTileEntity(x, y, z);
public TileEntity getTileEntity(IBlockAccess blockAccess) {
return blockAccess.getTileEntity(x, y, z);
}
public int getBlockMetadata(IBlockAccess world) {
return world.getBlockMetadata(x, y, z);
public int getBlockMetadata(IBlockAccess blockAccess) {
return blockAccess.getBlockMetadata(x, y, z);
}
public void setBlock(World worldObj, final Block block) {

View file

@ -52,6 +52,7 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.ForgeChunkManager.Type;
public class JumpSequencer extends AbstractSequencer {
// Jump vector
private Transformation transformation;
@ -70,17 +71,17 @@ public class JumpSequencer extends AbstractSequencer {
private float collisionStrength = 0;
private boolean isEnabled = false;
private final static int STATE_IDLE = 0;
private final static int STATE_CHUNKLOADING = 1;
private final static int STATE_SAVING = 2;
private final static int STATE_BORDERS = 3;
private final static int STATE_TRANSFORMER = 4;
private final static int STATE_BLOCKS = 5;
private final static int STATE_EXTERNALS = 6;
private final static int STATE_ENTITIES = 7;
private final static int STATE_REMOVING = 8;
private final static int STATE_CHUNKUNLOADING = 9;
private final static int STATE_FINISHING = 10;
private static final int STATE_IDLE = 0;
private static final int STATE_CHUNKLOADING = 1;
private static final int STATE_SAVING = 2;
private static final int STATE_BORDERS = 3;
private static final int STATE_TRANSFORMER = 4;
private static final int STATE_BLOCKS = 5;
private static final int STATE_EXTERNALS = 6;
private static final int STATE_ENTITIES = 7;
private static final int STATE_REMOVING = 8;
private static final int STATE_CHUNKUNLOADING = 9;
private static final int STATE_FINISHING = 10;
private int state = STATE_IDLE;
private int actualIndexInShip = 0;

View file

@ -27,6 +27,7 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
public class LivingHandler {
private final HashMap<String, Integer> player_cloakTicks;
private static final int CLOAK_CHECK_TIMEOUT_TICKS = 100;
@ -243,9 +244,9 @@ public class LivingHandler {
// check for equipment with NOFALLDAMAGE tag
for (int i = 1; i < 5; i++) {
final ItemStack armor = entity.getEquipmentInSlot(i);
if (armor != null) {
if (Dictionary.ITEMS_NOFALLDAMAGE.contains(armor.getItem())) {
final ItemStack itemStackInSlot = entity.getEquipmentInSlot(i);
if (itemStackInSlot != null) {
if (Dictionary.ITEMS_NOFALLDAMAGE.contains(itemStackInSlot.getItem())) {
event.setCanceled(true); // Don't damage entity
}
}

View file

@ -15,11 +15,12 @@ import cpw.mods.fml.common.Optional;
@Optional.Interface(iface = "ic2.api.reactor.IReactorComponent", modid = "IC2")
})
public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent {
private final static int maxHeat = 3000;
private static final int MAX_HEAT = 3000;
public ItemIC2reactorLaserFocus() {
super();
setMaxDamage(maxHeat);
setMaxDamage(MAX_HEAT);
setCreativeTab(WarpDrive.creativeTabWarpDrive);
setUnlocalizedName("warpdrive.energy.IC2reactorLaserFocus");
}
@ -31,7 +32,7 @@ public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent
private static void damageComponent(ItemStack self, int damage) {
int currDamage = self.getItemDamage();
int nextDamage = Math.min(maxHeat, Math.max(0, currDamage + damage));
int nextDamage = Math.min(MAX_HEAT, Math.max(0, currDamage + damage));
self.setItemDamage(nextDamage);
}
@ -47,7 +48,7 @@ public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent
@Optional.Method(modid = "IC2")
private static void coolComponent(ItemStack self, IReactorComponent comp, IReactor reactor, ItemStack stack, int x, int y) {
int maxTransfer = maxHeat - self.getItemDamage();
int maxTransfer = MAX_HEAT - self.getItemDamage();
int compHeat = comp.getCurrentHeat(reactor, stack, x, y);
int transferHeat = -Math.min(compHeat, maxTransfer);
int retained = comp.alterHeat(reactor, stack, x, y, transferHeat);
@ -58,7 +59,7 @@ public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent
private static void coolReactor(IReactor reactor, ItemStack stack) {
int reactorHeat = reactor.getHeat();
int myHeat = stack.getItemDamage();
int transfer = Math.min(maxHeat - myHeat, reactorHeat);
int transfer = Math.min(MAX_HEAT - myHeat, reactorHeat);
reactor.addHeat(-transfer);
damageComponent(stack, transfer);
}
@ -102,7 +103,7 @@ public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent
@Override
@Optional.Method(modid = "IC2")
public int getMaxHeat(IReactor reactor, ItemStack yourStack, int x, int y) {
return maxHeat;
return MAX_HEAT;
}
@Override
@ -117,7 +118,7 @@ public class ItemIC2reactorLaserFocus extends Item implements IReactorComponent
if (WarpDriveConfig.LOGGING_ENERGY) {
WarpDrive.logger.info(this + " alterHeat " + heat);
}
int transferred = Math.min(heat, maxHeat - yourStack.getItemDamage());
int transferred = Math.min(heat, MAX_HEAT - yourStack.getItemDamage());
damageComponent(yourStack, transferred);
return heat - transferred;
}

View file

@ -44,14 +44,14 @@ public class RenderBlockForceField implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
final TileEntity tileEntity = blockAccess.getTileEntity(x, y, z);
if (!(tileEntity instanceof TileEntityForceField)) {
return false;
}
int renderType = -1;
Block blockCamouflage = ((TileEntityForceField)tileEntity).cache_blockCamouflage;
Block blockCamouflage = ((TileEntityForceField) tileEntity).cache_blockCamouflage;
if (blockCamouflage != null && !Dictionary.BLOCKS_NOCAMOUFLAGE.contains(blockCamouflage)) {
renderType = blockCamouflage.getRenderType();
}

View file

@ -18,7 +18,7 @@ public class RenderBlockStandard implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return renderer.renderStandardBlock(block, x, y, z);
}

View file

@ -9,32 +9,35 @@ import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
public class SpaceChunkProvider extends ChunkProviderGenerate {
private World worldObj;
private Random rand;
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
public SpaceChunkProvider(World worldObj, long par2) {
super(worldObj, par2, false);
rand = new Random(par2);
this.worldObj = worldObj;
private final World world;
private final Random rand;
public SpaceChunkProvider(World world, long seed) {
super(world, seed, false);
rand = new Random(seed);
this.world = world;
}
@Override
public Chunk provideChunk(int par1, int par2) {
rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
Block[] var3 = new Block[32768];
// biomesForGeneration[0] = WarpDrive.spaceBiome;
// caveGenerator.generate(this, this.worldObj, par1, par2, var3);
biomesForGeneration[0] = WarpDrive.spaceBiome;
Chunk var4 = new Chunk(worldObj, var3, par1, par2);
var4.generateSkylightMap();
return var4;
public Chunk provideChunk(int x, int z) {
rand.setSeed(x * 341873128712L + z * 132897987541L);
final Block[] chunkprimer = new Block[32768];
final Chunk chunk = new Chunk(world, chunkprimer, x, z);
final byte[] byteBiomes = chunk.getBiomeArray();
for (int i = 0; i < byteBiomes.length; ++i) {
byteBiomes[i] = (byte) WarpDrive.spaceBiome.biomeID;
}
chunk.generateSkylightMap();
return chunk;
}
@Override

View file

@ -84,8 +84,8 @@ item.warpdrive.forcefield.upgrade.heating.name=Heizungs Upgrade
item.warpdrive.forcefield.upgrade.heating.tooltip=Erhitze Blöcke und Entities. Mehr Upgrades verstärken den Effekt. Nutze ein Inversions Upgrade für Terraforming Effekt.
item.warpdrive.forcefield.upgrade.inversion.name=Inversions Upgrade
item.warpdrive.forcefield.upgrade.inversion.tooltip=§4Work in progress\nOberflächen Effekt zu Raum Effekt. Für Entity Zielerfassung oder Terraforming.
item.warpdrive.forcefield.upgrade.itemPort.name=Item Anschluss Upgrade
item.warpdrive.forcefield.upgrade.itemPort.tooltip=Interagiere mit angeschlossenen Stauräumen. Nutze ein Anziehungs Upgrade, um Block Brecher Drops anzuziehen. Nutze ein Rückstoß Upgrade, um mit einem Stabilisations Upgrade Blöcke zu setzen.
item.warpdrive.forcefield.upgrade.item_port.name=Item Anschluss Upgrade
item.warpdrive.forcefield.upgrade.item_port.tooltip=Interagiere mit angeschlossenen Stauräumen. Nutze ein Anziehungs Upgrade, um Block Brecher Drops anzuziehen. Nutze ein Rückstoß Upgrade, um mit einem Stabilisations Upgrade Blöcke zu setzen.
item.warpdrive.forcefield.upgrade.pumping.name=Pumpen Upgrade
item.warpdrive.forcefield.upgrade.pumping.tooltip=§4Work in progress\nPumpe Flüssigkeiten im Einflussbereich. Um dickflüssigeres zu pumpen füge mehr Pumpen Upgrades hinzu.
item.warpdrive.forcefield.upgrade.range.name=Reichweiten Upgrade
@ -154,12 +154,13 @@ item.warpdrive.tool.tuning_fork.black.name=Schwarze Stimmgabel
item.warpdrive.tool.tuning_fork.tooltip.usage=§bRecktsklicke einen Block§7 um seine Kristalle einzustellen\n§bSschleiche§7 um alternative Kristalle einzustellen
tile.warpdrive.passive.Energized.name=Energiegeladener Block
tile.warpdrive.passive.Gas.name=Gas Block
tile.warpdrive.decoration.decorative.energized.name=Energiegeladener Block
tile.warpdrive.decoration.decorative.network.name=Netzwerk Block
tile.warpdrive.decoration.decorative.plain.name=Ebenen Block
tile.warpdrive.decoration.gas.name=Gas Block
tile.warpdrive.passive.IridiumBlock.name=Iridium Block
tile.warpdrive.passive.HighlyAdvancedMachine.name=Stark weiterentwickelter Maschinen Block
tile.warpdrive.passive.Network.name=Netzwerk Block
tile.warpdrive.passive.Plain.name=Ebenen Block
tile.warpdrive.passive.TransportBeacon.name=Transport Leuchtfeuer
tile.warpdrive.machines.ChunkLoader.name=Chunk Loader
@ -583,7 +584,7 @@ warpdrive.forcefield.upgrade.statusLine.cooling=Kühler
warpdrive.forcefield.upgrade.statusLine.fusion=Fusions
warpdrive.forcefield.upgrade.statusLine.heating=Heizungs
warpdrive.forcefield.upgrade.statusLine.inversion=Inversions
warpdrive.forcefield.upgrade.statusLine.itemPort=Item Anschluss
warpdrive.forcefield.upgrade.statusLine.item_port=Item Anschluss
warpdrive.forcefield.upgrade.statusLine.pumping=Pumpen
warpdrive.forcefield.upgrade.statusLine.range=Reichweiten
warpdrive.forcefield.upgrade.statusLine.repulsion=Rückstoß

View file

@ -84,8 +84,8 @@ item.warpdrive.forcefield.upgrade.heating.name=Heating upgrade
item.warpdrive.forcefield.upgrade.heating.tooltip=Heat up blocks and entities. Add more Heating upgrades to boost effect. Add an Inversion for an area/terraforming effect.
item.warpdrive.forcefield.upgrade.inversion.name=Inversion upgrade
item.warpdrive.forcefield.upgrade.inversion.tooltip=§4Work in progress\nChange from surface to volume effect area. Use this for entity targeting or terraforming.
item.warpdrive.forcefield.upgrade.itemPort.name=Item port upgrade
item.warpdrive.forcefield.upgrade.itemPort.tooltip=Interface with attached containers. Add an Attraction upgrade to collect Block breaker drops. Add a Repulsion upgrade to provide blocks to place using a Stabilization upgrade.
item.warpdrive.forcefield.upgrade.item_port.name=Item port upgrade
item.warpdrive.forcefield.upgrade.item_port.tooltip=Interface with attached containers. Add an Attraction upgrade to collect Block breaker drops. Add a Repulsion upgrade to provide blocks to place using a Stabilization upgrade.
item.warpdrive.forcefield.upgrade.pumping.name=Pumping upgrade
item.warpdrive.forcefield.upgrade.pumping.tooltip=§4Work in progress\nPump fluids at the force field location. Add more Pump upgrades to pull fluid with higher viscosity fluids like lava.
item.warpdrive.forcefield.upgrade.range.name=Range upgrade
@ -154,12 +154,13 @@ item.warpdrive.tool.tuning_fork.black.name=Black Tuning Fork
item.warpdrive.tool.tuning_fork.tooltip.usage=§bRight click a block§7 to tune its crystals\n§bSneak§7 to tune alternate crystals
tile.warpdrive.passive.Energized.name=Energized Block
tile.warpdrive.passive.Gas.name=Gas Block
tile.warpdrive.decoration.decorative.energized.name=Energized Block
tile.warpdrive.decoration.decorative.network.name=Network Block
tile.warpdrive.decoration.decorative.plain.name=Plain Block
tile.warpdrive.decoration.gas.name=Gas Block
tile.warpdrive.passive.IridiumBlock.name=Iridium Block
tile.warpdrive.passive.HighlyAdvancedMachine.name=Highly Advanced Machine Block
tile.warpdrive.passive.Network.name=Network Block
tile.warpdrive.passive.Plain.name=Plain Block
tile.warpdrive.passive.TransportBeacon.name=Transport Beacon
tile.warpdrive.machines.ChunkLoader.name=Chunk Loader
@ -583,7 +584,7 @@ warpdrive.forcefield.upgrade.statusLine.cooling=cooling
warpdrive.forcefield.upgrade.statusLine.fusion=fusion
warpdrive.forcefield.upgrade.statusLine.heating=heating
warpdrive.forcefield.upgrade.statusLine.inversion=inversion
warpdrive.forcefield.upgrade.statusLine.itemPort=item port
warpdrive.forcefield.upgrade.statusLine.item_port=item port
warpdrive.forcefield.upgrade.statusLine.pumping=pumping
warpdrive.forcefield.upgrade.statusLine.range=increased range
warpdrive.forcefield.upgrade.statusLine.repulsion=repulsion

View file

@ -84,8 +84,8 @@ item.warpdrive.forcefield.upgrade.heating.name=Augmentation de chauffage
item.warpdrive.forcefield.upgrade.heating.tooltip=Chauffe les blocs et entités. Ajoutes en d'autres pour accroître l'effet. Ajoute une inversion pour un effet de zone ou terraformation.
item.warpdrive.forcefield.upgrade.inversion.name=Augmentation d'inversion
item.warpdrive.forcefield.upgrade.inversion.tooltip=§4En cours d'implémentation\nModifie la zone d'effet de surface en volume. Utilise le pour cibler des entités à l'intérieur du champ ou effectuer une terraformation.
item.warpdrive.forcefield.upgrade.itemPort.name=Augmentation de port d'item
item.warpdrive.forcefield.upgrade.itemPort.tooltip=S'interface avec des conteneurs attachés. Ajoutes une Augmentation d'attraction pour collecter les items du Casseur de block. Ajoutes une augmentation de répulsion pour fournir les blocks à placer avec l'augmentation de stabilisation.
item.warpdrive.forcefield.upgrade.item_port.name=Augmentation de port d'item
item.warpdrive.forcefield.upgrade.item_port.tooltip=S'interface avec des conteneurs attachés. Ajoutes une Augmentation d'attraction pour collecter les items du Casseur de block. Ajoutes une augmentation de répulsion pour fournir les blocks à placer avec l'augmentation de stabilisation.
item.warpdrive.forcefield.upgrade.pumping.name=Augmentation de pompage
item.warpdrive.forcefield.upgrade.pumping.tooltip=§4En cours d'implémentation\nPompe des liquides à l'emplacement du champ de force. Ajoute d'autres pompes pour supporter des fluides plus visceux tels que la lave.
item.warpdrive.forcefield.upgrade.range.name=Augmentation de portée
@ -154,12 +154,13 @@ item.warpdrive.tool.tuning_fork.black.name=Diapason noir
item.warpdrive.tool.tuning_fork.tooltip.usage=§bCliques droit sur un block§r pour ajuster ses cristaux\n§bAccroupi§r pour ajuster les cristaux alternatifs
tile.warpdrive.passive.Energized.name=Block energisé
tile.warpdrive.passive.Gas.name=Bloc de gaz
tile.warpdrive.decoration.decorative.energized.name=Block energisé
tile.warpdrive.decoration.decorative.network.name=Bloc de réseau
tile.warpdrive.decoration.decorative.plain.name=Bloc ordinaire
tile.warpdrive.decoration.gas.name=Bloc de gaz
tile.warpdrive.passive.IridiumBlock.name=Bloc d'iridium
tile.warpdrive.passive.HighlyAdvancedMachine.name=Bloc de machine hyper avancé
tile.warpdrive.passive.Network.name=Bloc de réseau
tile.warpdrive.passive.Plain.name=Bloc ordinaire
tile.warpdrive.passive.TransportBeacon.name=Balise de transport
tile.warpdrive.machines.ChunkLoader.name=Chargeur de chunk
@ -583,7 +584,7 @@ warpdrive.forcefield.upgrade.statusLine.cooling=refroidissement
warpdrive.forcefield.upgrade.statusLine.fusion=fusion
warpdrive.forcefield.upgrade.statusLine.heating=chauffage
warpdrive.forcefield.upgrade.statusLine.inversion=inversion
warpdrive.forcefield.upgrade.statusLine.itemPort=port d'item
warpdrive.forcefield.upgrade.statusLine.item_port=port d'item
warpdrive.forcefield.upgrade.statusLine.pumping=pompe
warpdrive.forcefield.upgrade.statusLine.range=portée
warpdrive.forcefield.upgrade.statusLine.repulsion=répulsion

View file

@ -84,8 +84,8 @@ item.warpdrive.forcefield.upgrade.heating.name=Heating upgrade
item.warpdrive.forcefield.upgrade.heating.tooltip=Heat up blocks and entities. Add more Heating upgrades to boost effect. Add an Inversion for an area/terraforming effect.
item.warpdrive.forcefield.upgrade.inversion.name=Inversion upgrade
item.warpdrive.forcefield.upgrade.inversion.tooltip=§4Work in progress\nChange from surface to volume effect area. Use this for entity targeting or terraforming.
item.warpdrive.forcefield.upgrade.itemPort.name=Item port upgrade
item.warpdrive.forcefield.upgrade.itemPort.tooltip=Interface with attached containers. Add an Attraction upgrade to collect Block breaker drops. Add a Repulsion upgrade to provide blocks to place using a Stabilization upgrade.
item.warpdrive.forcefield.upgrade.item_port.name=Item port upgrade
item.warpdrive.forcefield.upgrade.item_port.tooltip=Interface with attached containers. Add an Attraction upgrade to collect Block breaker drops. Add a Repulsion upgrade to provide blocks to place using a Stabilization upgrade.
item.warpdrive.forcefield.upgrade.pumping.name=Pumping upgrade
item.warpdrive.forcefield.upgrade.pumping.tooltip=§4Work in progress\nPump fluids at the force field location. Add more Pump upgrades to pull fluid with higher viscosity fluids like lava.
item.warpdrive.forcefield.upgrade.range.name=Range upgrade
@ -154,12 +154,13 @@ item.warpdrive.tool.tuning_fork.black.name=Черный камертон
item.warpdrive.tool.tuning_fork.tooltip.usage=§bИспользуйте на блоке§7, чтобы настроить его кристаллы\n§bПрисядьте§7, чтобы настроить вторичные кристаллы
tile.warpdrive.passive.Energized.name=Энергизированный блок
tile.warpdrive.passive.Gas.name=Газ
tile.warpdrive.decoration.decorative.energized.name=Энергизированный блок
tile.warpdrive.decoration.decorative.network.name=Сетевой блок
tile.warpdrive.decoration.decorative.plain.name=Простой блок
tile.warpdrive.decoration.gas.name=Газ
tile.warpdrive.passive.IridiumBlock.name=Блок иридия
tile.warpdrive.passive.HighlyAdvancedMachine.name=Высокотехнологичный корпус механизма
tile.warpdrive.passive.Network.name=Сетевой блок
tile.warpdrive.passive.Plain.name=Простой блок
tile.warpdrive.passive.TransportBeacon.name=Маяк для транспортера
tile.warpdrive.machines.ChunkLoader.name=Загрузчик чанков
@ -583,7 +584,7 @@ warpdrive.forcefield.upgrade.statusLine.cooling=cooling
warpdrive.forcefield.upgrade.statusLine.fusion=fusion
warpdrive.forcefield.upgrade.statusLine.heating=heating
warpdrive.forcefield.upgrade.statusLine.inversion=inversion
warpdrive.forcefield.upgrade.statusLine.itemPort=item port
warpdrive.forcefield.upgrade.statusLine.item_port=item port
warpdrive.forcefield.upgrade.statusLine.pumping=pumping
warpdrive.forcefield.upgrade.statusLine.range=increased range
warpdrive.forcefield.upgrade.statusLine.repulsion=repulsion