This commit is contained in:
mDiyo committed 2013-10-18 05:53:48 -07:00
commit ebb2ae15a6
170 files changed
+4343 -432

No files matched your search

+13 -7
View File
@@ -23,6 +23,8 @@ import tconstruct.util.player.TPlayerHandler;
import tconstruct.worldgen.*;
import tconstruct.worldgen.village.*;
import java.util.logging.Logger;
/** TConstruct, the tool mod.
* Craft your tools with style, then modify until the original is gone!
* @author: mDiyo
@@ -37,6 +39,9 @@ public class TConstruct
public static final int ingotLiquidValue = 144;
public static final int liquidUpdateAmount = 6;
// Shared mod logger
public static final Logger logger = Logger.getLogger("TConstruct");
/* Instance of this mod, used for grabbing prototype fields */
@Instance("TConstruct")
public static TConstruct instance;
@@ -46,27 +51,28 @@ public class TConstruct
public TConstruct()
{
logger.setParent(FMLCommonHandler.instance().getFMLLogger());
if (Loader.isModLoaded("Natura"))
{
System.out.println("[TConstruct] Natura, what are we going to do tomorrow night?");
TConstruct.logger.info("[TConstruct] Natura, what are we going to do tomorrow night?");
if (Loader.isModLoaded("ChaoticBastion"))
{
System.out.println("[Natura] TConstruct, we're going to...");
System.out.println("[ChaoticBastion] All your base are belong to us!");
TConstruct.logger.info("[Natura] TConstruct, we're going to...");
TConstruct.logger.info("[ChaoticBastion] All your base are belong to us!");
}
else
System.out.println("[Natura] TConstruct, we're going to take over the world!");
TConstruct.logger.info("[Natura] TConstruct, we're going to take over the world!");
}
else
{
if (Loader.isModLoaded("ChaoticBastion"))
{
System.out.println("[TConstruct] Preparing to...");
System.out.println("[ChaoticBastion] I'MA FIRING MY LAZOR!");
TConstruct.logger.info("[TConstruct] Preparing to...");
TConstruct.logger.info("[ChaoticBastion] I'MA FIRING MY LAZOR!");
}
else
System.out.println("[TConstruct] Preparing to take over the world");
TConstruct.logger.info("[TConstruct] Preparing to take over the world");
}
}
+36
View File
@@ -0,0 +1,36 @@
package tconstruct.blocks;
import net.minecraft.block.BlockLadder;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
public class StoneLadder extends BlockLadder {
// Override ladder material
public final Material blockMaterial = Material.rock;
private Icon icon;
// Use the normally protected constructor
public StoneLadder(int id)
{
super(id);
this.setUnlocalizedName("decoration.stoneladder");
this.setCreativeTab(CreativeTabs.tabDecorations);
}
@Override
public void registerIcons(IconRegister register)
{
icon = register.registerIcon("tinker:ladder_stone");
}
@Override
public Icon getIcon(int meta, int side)
{
return icon;
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ public class TankAirBlock extends BlockContainer
public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z)
{
TankAirLogic tank = (TankAirLogic) world.getBlockTileEntity(x, y, z);
if (tank.hasItem())
if (tank != null && tank.hasItem())
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
return null;
@@ -246,6 +246,14 @@ public class SmelteryComponent extends LogicComponent
return meltingTemps[slot];
}
public int getScaledFuelGague (int scale)
{
int ret = (fuelGague * scale) / 52;
if (ret < 1)
ret = 1;
return ret;
}
/* NBT */
public void readNetworkNBT (NBTTagCompound tags)
{
@@ -46,6 +46,16 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
int tick = 0;
public MultiFluidTank getMultiTank ()
{
return multitank;
}
public SmelteryComponent getSmeltery ()
{
return smeltery;
}
public void updateEntity ()
{
tick++;
@@ -234,8 +244,8 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
{
return null;
}
}
}
@Override
public void onInventoryChanged ()
{
@@ -424,7 +434,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
{
return "crafters.Smeltery";
}
/* Fluids */
@Override
@@ -204,7 +204,7 @@ public class AdvancedDrawbridgeLogic extends InventoryLogic implements IFacingLo
itemstack.stackSize = getInventoryStackLimit();
}
}
@Override
public Container getGuiContainer(InventoryPlayer inventoryplayer, World world, int x, int y, int z) {
return new AdvancedDrawbridgeContainer(inventoryplayer, this);
@@ -519,14 +519,21 @@ public class AdvancedDrawbridgeLogic extends InventoryLogic implements IFacingLo
@Override
public void setInventorySlotContents(int slot, ItemStack content) {
super.setInventorySlotContents(slot, content);
if (slot == 0)
if (slot == 0 && worldObj != null)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
public void onInventoryChanged() {
super.onInventoryChanged();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
if(worldObj != null){
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
@Override
public int getInventoryStackLimit(){
return 1;
}
}
}
@@ -88,7 +88,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv);
}
System.out.println("Ret: " + ret);
TConstruct.logger.info("Ret: " + ret);
return ret;
}
@@ -304,7 +304,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
{
if (castingDelay > 0)
{
//System.out.println("Casting");
//TConstruct.logger.info("Casting");
castingDelay--;
if (castingDelay == 0)
castLiquid();
@@ -121,7 +121,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
HashMap tankMap = this.getOutputs();
if (tankMap.size() <= 0)
{
//System.out.println("Nope, no connections to go to");
//TConstruct.logger.info("Nope, no connections to go to");
return;
}
boolean yFilled = false;
@@ -211,7 +211,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
HashMap tankMap = this.getOutputs();
if (tankMap.size() <= 0)
{
//System.out.println("Nope, no connections to go to");
//TConstruct.logger.info("Nope, no connections to go to");
return;
}
boolean yFilled = false;
@@ -88,7 +88,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv);
}
System.out.println("Ret: " + ret);
TConstruct.logger.info("Ret: " + ret);
return ret;
}
@@ -304,7 +304,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
{
if (castingDelay > 0)
{
//System.out.println("Casting");
//TConstruct.logger.info("Casting");
castingDelay--;
if (castingDelay == 0)
castLiquid();
@@ -1,12 +1,16 @@
package tconstruct.blocks.logic;
import net.minecraft.item.ItemStack;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.world.World;
import tconstruct.inventory.CraftingStationContainer;
import tconstruct.library.blocks.InventoryLogic;
public class CraftingStationLogic extends InventoryLogic
public class CraftingStationLogic extends InventoryLogic implements ISidedInventory
{
public CraftingStationLogic()
{
@@ -31,4 +35,19 @@ public class CraftingStationLogic extends InventoryLogic
return false;
return true;
}
@Override
public int[] getAccessibleSlotsFromSide(int var1) {
return new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
}
@Override
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
return i != 0;
}
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
return i != 0;
}
}
@@ -258,6 +258,9 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc
int yPos = yCoord;
int zPos = zCoord;
bufferStack = inventory[0].copy();
bufferStack.stackSize = 1;
switch (direction)
{
case 0:
@@ -1,5 +1,6 @@
package tconstruct.blocks.logic;
import tconstruct.TConstruct;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.library.util.IActiveLogic;
import tconstruct.library.util.IFacingLogic;
@@ -70,7 +71,7 @@ public class FirestarterLogic extends TileEntity implements IFacingLogic, IActiv
Block block = Block.blocksList[worldObj.getBlockId(xPos, yPos, zPos)];
if (active)
{
System.out.println("Setting fire");
TConstruct.logger.info("Setting fire");
if (block == null || block.isAirBlock(worldObj, xPos, yPos, zPos))
{
worldObj.playSoundEffect((double) xPos + 0.5D, (double) yPos + 0.5D, (double) zPos + 0.5D, "fire.ignite", 1.0F, AbilityHelper.random.nextFloat() * 0.4F + 0.8F);
@@ -79,7 +80,7 @@ public class FirestarterLogic extends TileEntity implements IFacingLogic, IActiv
}
else
{
//System.out.println("Stopping fire "+putOut);
//TConstruct.logger.info("Stopping fire "+putOut);
if (block == Block.fire)
{
//worldObj.playSoundEffect((double) xPos + 0.5D, (double) yPos + 0.5D, (double) zPos + 0.5D, "random.fizz", 1.0F, AbilityHelper.random.nextFloat() * 0.4F + 0.8F);
@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.src.ModLoader;
import net.minecraft.tileentity.TileEntity;
import tconstruct.TConstruct;
public class GolemPedestalLogic extends TileEntity implements IInventory
{
@@ -190,7 +191,7 @@ public class GolemPedestalLogic extends TileEntity implements IInventory
public boolean subtractSoul (int i)
{
System.out.println("SUBTRACT WHY");
TConstruct.logger.info("SUBTRACT WHY");
if (supply == null || supply.itemID >= 512 || cost[supply.itemID] == 0)
{
worldObj.playSoundAtEntity(ModLoader.getMinecraftInstance().thePlayer, "mob.blaze.death", 1.0F, 0.5F);
@@ -200,7 +201,7 @@ public class GolemPedestalLogic extends TileEntity implements IInventory
int j = cost[supply.itemID];
int k = souls[supply.itemID];
int l = (supply.stackSize / j) * k;
System.out.println((new StringBuilder()).append("Subtracting amt").append(i).append(" s").append(k).append(" c").append(j).append(" ss").append(supply.stackSize).append(" id")
TConstruct.logger.info((new StringBuilder()).append("Subtracting amt").append(i).append(" s").append(k).append(" c").append(j).append(" ss").append(supply.stackSize).append(" id")
.append(supply.itemID).append(" sa").append(l).append(" calc").append(Math.ceil((double) i / (double) k)).toString());
if (l < i)
{
@@ -1,5 +1,6 @@
package tconstruct.blocks.logic;
import tconstruct.TConstruct;
import tconstruct.library.crafting.AlloyMix;
import tconstruct.library.util.IFacingLogic;
import tconstruct.library.util.IMasterLogic;
@@ -28,7 +29,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
@Override
public boolean setPotentialMaster (IMasterLogic master, World world, int x, int y, int z)
{
System.out.println("Master: "+master);
// TConstruct.logger.info("Master: "+master);
return (master instanceof AdaptiveSmelteryLogic || master instanceof SmelteryDrainLogic) && !hasMaster;
}
@@ -46,11 +47,11 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
@Override
public FluidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
{
System.out.println("Attempting drain "+hasValidMaster());
// TConstruct.logger.info("Attempting drain " + hasValidMaster());
if (hasValidMaster() && canDrain(from, null))
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
System.out.println("Found master");
// TConstruct.logger.info("Found master");
return smeltery.drain(from, maxDrain, doDrain);
}
return null;
@@ -455,7 +455,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
return false;
currentLiquid += liquid.amount;
//System.out.println("Current liquid: "+currentLiquid);
//TConstruct.logger.info("Current liquid: "+currentLiquid);
boolean added = false;
for (int i = 0; i < moltenMetal.size(); i++)
{
@@ -585,11 +585,11 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
TileEntity newTankContainer = worldObj.getBlockTileEntity(possibleTank.x, possibleTank.y, possibleTank.z);
if (newTankContainer instanceof IFluidHandler)
{
//System.out.println("Tank: "+possibleTank.toString());
//TConstruct.logger.info("Tank: "+possibleTank.toString());
FluidStack newliquid = ((IFluidHandler) newTankContainer).drain(ForgeDirection.UNKNOWN, 150, false);
if (newliquid != null && newliquid.getFluid().getBlockID() == Block.lavaStill.blockID && newliquid.amount > 0)
{
//System.out.println("Tank: "+possibleTank.toString());
//TConstruct.logger.info("Tank: "+possibleTank.toString());
foundTank = true;
activeLavaTank = possibleTank;
iter = lavaTanks.size();
@@ -616,7 +616,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
if (iter >= lavaTanks.size())
foundTank = true;
}
//System.out.println("Searching for tank, size: "+lavaTanks.size());
//TConstruct.logger.info("Searching for tank, size: "+lavaTanks.size());
}
}
}
+2 -2
View File
@@ -44,11 +44,11 @@ public class TClientEvents
soundmanager.addSound("tinker:frypan_hit.ogg");
soundmanager.addSound("tinker:little_saw.ogg");
soundmanager.addSound("tinker:launcher_clank.ogg");
System.out.println("[TConstruct] Successfully loaded sounds.");
TConstruct.logger.info("Successfully loaded sounds.");
}
catch (Exception e)
{
System.err.println("[TConstruct] Failed to register one or more sounds");
TConstruct.logger.warning("Failed to register one or more sounds");
}
}
}
@@ -46,7 +46,7 @@ public class TClientTickHandler implements ITickHandler
//this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/newhearts.png");
int hp = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth());//(int) player.getEntityAttribute(SharedMonsterAttributes.field_111267_a).func_111125_b();//player.getHealth();
//System.out.println("hp: "+hp);
//TConstruct.logger.info("hp: "+hp);
for (int iter = 0; iter < hp / 20; iter++)
{
int renderHearts = (hp - 20*(iter+1)) / 2;
+1 -1
View File
@@ -37,7 +37,7 @@ public class TControls extends TKeyHandler
public TControls()
{
super(new KeyBinding[] { armorKey, refreshCapes }, new boolean[] { false, false }, getVanillaKeyBindings(), new boolean[] { false, false });
//System.out.println("Controls registered");
//TConstruct.logger.info("Controls registered");
}
private static KeyBinding[] getVanillaKeyBindings ()
+1 -1
View File
@@ -78,7 +78,7 @@ public class TProxyClient extends TProxyCommon
if (ID == craftingStationID)
return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getBlockTileEntity(x, y, z), x, y, z);
if (ID == advDrawbridgeID)
return new AdvDrawbridgeGui(player.inventory, (AdvancedDrawbridgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z);
return new AdvDrawbridgeGui(player, (AdvancedDrawbridgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z);
if (ID == manualGuiID)
{
+2 -1
View File
@@ -10,6 +10,7 @@ import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import tconstruct.TConstruct;
import tconstruct.library.tools.ToolCore;
public class ToolCoreRenderer implements IItemRenderer
@@ -27,7 +28,7 @@ public class ToolCoreRenderer implements IItemRenderer
case INVENTORY:
return true;
default:
System.out.println("[TCon] Unhandled render case!");
TConstruct.logger.warning("[TCon] Unhandled render case!");
case FIRST_PERSON_MAP:
return false;
}
@@ -158,7 +158,7 @@ public class BlockRenderCastingChannel implements ISimpleBlockRenderingHandler
float liquidAmount = tile.liquid.amount / 288f * 0.125f;
renderer.setRenderBounds(0.375D, startY, 0.375D, 0.625D, 0.5 + liquidAmount, 0.625D); //Center
renderLiquidPart(world, x, y, z, block, renderer, tile);
//System.out.println(tile.recentlyFilledDelay);
//TConstruct.logger.info(tile.recentlyFilledDelay);
if (tile.hasTankConnected(ForgeDirection.NORTH))
{
@@ -18,7 +18,7 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8)
{
//System.out.println("Render!!!");
//TConstruct.logger.info("Render!!!");
this.render((CastingTableLogic) logic, var2, var4, var6, var8);
}
@@ -23,7 +23,7 @@ public class DryingRackSpecialRender extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8)
{
//System.out.println("Render!!!");
//TConstruct.logger.info("Render!!!");
this.render((DryingRackLogic) logic, var2, var4, var6, var8);
}
@@ -56,7 +56,7 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler
ForgeDirection dir = Helper.convertMetaToForgeOrientation(i1);
//System.out.println(i1 + " for " + dir);
//TConstruct.logger.info(i1 + " for " + dir);
switch (dir)
{
+188 -183
View File
@@ -159,156 +159,159 @@ public class SearedRender implements ISimpleBlockRenderingHandler
renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
{
float minHeight = 0.9375F;
float maxHeight = 1F;
float minX = 0.0625F;
float maxX = 0.9375F;
float minZ = 0.0625F;
float maxZ = 0.9375F;
ItemStack it = logic.getStackInSlot(0);
if(it != null){
CastingRecipe rec = TConstruct.tableCasting.getCastingRecipe(logic.liquid, it);
if(rec != null){
minHeight = rec.fluidRenderProperties.minHeight;
maxHeight = rec.fluidRenderProperties.maxHeight;
minX = rec.fluidRenderProperties.minX;
maxX = rec.fluidRenderProperties.maxX;
minZ = rec.fluidRenderProperties.minZ;
maxZ = rec.fluidRenderProperties.maxZ;
}
}
float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F;
renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ);
if (world.getBlockTileEntity(x, y, z) instanceof CastingTableLogic) {
CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
{
float minHeight = 0.9375F;
float maxHeight = 1F;
Fluid fluid = logic.liquid.getFluid();
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (logic.liquid.fluidID < 4096) //Block
{
Block liquidBlock = Block.blocksList[logic.liquid.fluidID];
if (liquidBlock != null)
float minX = 0.0625F;
float maxX = 0.9375F;
float minZ = 0.0625F;
float maxZ = 0.9375F;
ItemStack it = logic.getStackInSlot(0);
if(it != null){
CastingRecipe rec = TConstruct.tableCasting.getCastingRecipe(logic.liquid, it);
if(rec != null && rec.fluidRenderProperties != null){
minHeight = rec.fluidRenderProperties.minHeight;
maxHeight = rec.fluidRenderProperties.maxHeight;
minX = rec.fluidRenderProperties.minX;
maxX = rec.fluidRenderProperties.maxX;
minZ = rec.fluidRenderProperties.minZ;
maxZ = rec.fluidRenderProperties.maxZ;
}
}
float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F;
renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ);
Fluid fluid = logic.liquid.getFluid();
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (logic.liquid.fluidID < 4096) //Block
{
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
Block liquidBlock = Block.blocksList[logic.liquid.fluidID];
if (liquidBlock != null)
{
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
}
}
else
//Item
{
Item liquidItem = Item.itemsList[logic.liquid.fluidID];
if (liquidItem != null)
{
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(0), x, y, z, renderer, world);
}
}*/
}
else
//Item
{
Item liquidItem = Item.itemsList[logic.liquid.fluidID];
if (liquidItem != null)
{
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(0), x, y, z, renderer, world);
}
}*/
}
}
else if (metadata == 1)
{
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
float xMin = 0.375F, zMin = 0.375F, xMax = 0.625F, zMax = 0.625F;
switch (logic.getRenderDirection())
{
case 2:
renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.25, 0.375, 0.625, 0.375, 0.625, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.625, 0.75, 0.625, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1);
zMin = 0.5F;
//zMin = 0.625F;
break;
case 3:
renderer.setRenderBounds(0.25, 0.25, 0, 0.75, 0.375, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.25, 0.375, 0, 0.375, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0, 0.75, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.375, 0.375, 0, 0.625, 0.625, 0.375);
zMax = 0.5F;
break;
case 4:
renderer.setRenderBounds(0.625, 0.25, 0.25, 1, 0.375, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.25, 1, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.625, 1, 0.625, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.375, 1, 0.625, 0.625);
xMin = 0.5F;
break;
case 5:
renderer.setRenderBounds(0, 0.25, 0.25, 0.375, 0.375, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.25, 0.375, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.625, 0.375, 0.625, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.375, 0.375, 0.625, 0.625);
xMax = 0.5F;
break;
}
float yMin = 0F;
int uID = world.getBlockId(x, y - 1, z);
int uMeta = world.getBlockMetadata(x, y - 1, z);
if (uID == TContent.searedBlock.blockID && uMeta == 0)
{
yMin = -0.125F;
}
else if (uID == TContent.searedBlock.blockID && uMeta == 2)
{
yMin = -0.75F;
}
else if (uID == TContent.lavaTank.blockID)
{
yMin = -1F;
}
else if (uID == TContent.castingChannel.blockID)
{
yMin = -0.5F;
}
if (logic.liquid != null)
{
Fluid fluid = logic.liquid.getFluid();
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (fluid.canBePlacedInWorld())
if (world.getBlockTileEntity(x, y, z) instanceof FaucetLogic) {
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
float xMin = 0.375F, zMin = 0.375F, xMax = 0.625F, zMax = 0.625F;
switch (logic.getRenderDirection())
{
Block liquidBlock = Block.blocksList[blockToRender.itemID];
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
}*/
/*ItemStack blockToRender = new ItemStack(logic.liquid.fluidID, 1, logic.liquid.itemMeta);
if (blockToRender.itemID < 4096) //Block
{
case 2:
renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.25, 0.375, 0.625, 0.375, 0.625, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.625, 0.75, 0.625, 1);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1);
zMin = 0.5F;
//zMin = 0.625F;
break;
case 3:
renderer.setRenderBounds(0.25, 0.25, 0, 0.75, 0.375, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.25, 0.375, 0, 0.375, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0, 0.75, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.375, 0.375, 0, 0.625, 0.625, 0.375);
zMax = 0.5F;
break;
case 4:
renderer.setRenderBounds(0.625, 0.25, 0.25, 1, 0.375, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.25, 1, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.625, 1, 0.625, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.625, 0.375, 0.375, 1, 0.625, 0.625);
xMin = 0.5F;
break;
case 5:
renderer.setRenderBounds(0, 0.25, 0.25, 0.375, 0.375, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.25, 0.375, 0.625, 0.375);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.625, 0.375, 0.625, 0.75);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0, 0.375, 0.375, 0.375, 0.625, 0.625);
xMax = 0.5F;
break;
}
else
//Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
int meta = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world);
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world);
}*/
//renderer.renderStandardBlock(block, x, y, z);
}
float yMin = 0F;
int uID = world.getBlockId(x, y - 1, z);
int uMeta = world.getBlockMetadata(x, y - 1, z);
if (uID == TContent.searedBlock.blockID && uMeta == 0)
{
yMin = -0.125F;
}
else if (uID == TContent.searedBlock.blockID && uMeta == 2)
{
yMin = -0.75F;
}
else if (uID == TContent.lavaTank.blockID)
{
yMin = -1F;
}
else if (uID == TContent.castingChannel.blockID)
{
yMin = -0.5F;
}
if (logic.liquid != null)
{
Fluid fluid = logic.liquid.getFluid();
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (fluid.canBePlacedInWorld())
{
Block liquidBlock = Block.blocksList[blockToRender.itemID];
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
}*/
/*ItemStack blockToRender = new ItemStack(logic.liquid.fluidID, 1, logic.liquid.itemMeta);
if (blockToRender.itemID < 4096) //Block
{
}
else
//Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
int meta = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world);
renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world);
}*/
//renderer.renderStandardBlock(block, x, y, z);
}
}
}
else if (metadata == 2)
{
@@ -374,54 +377,56 @@ public class SearedRender implements ISimpleBlockRenderingHandler
renderer.renderStandardBlock(block, x, y, z);
//Liquids
CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
{
float minHeight = 0.25F;
float maxHeight = 0.95F;
float minX = 0.0625F;
float maxX = 0.9375F;
float minZ = 0.0625F;
float maxZ = 0.9375F;
ItemStack it = logic.getStackInSlot(0);
if(it != null){
CastingRecipe rec = TConstruct.basinCasting.getCastingRecipe(logic.liquid, it);
if(rec != null){
minHeight = rec.fluidRenderProperties.minHeight;
maxHeight = rec.fluidRenderProperties.maxHeight;
minX = rec.fluidRenderProperties.minX;
maxX = rec.fluidRenderProperties.maxX;
minZ = rec.fluidRenderProperties.minZ;
maxZ = rec.fluidRenderProperties.maxZ;
}
}
float height = (logic.getLiquidAmount() / (logic.getCapacity() * 1.05F) * 0.6875F) / maxHeight;
renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ);
if (world.getBlockTileEntity(x, y, z) instanceof CastingBasinLogic) {
CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
{
float minHeight = 0.25F;
float maxHeight = 0.95F;
Fluid fluid = logic.liquid.getFluid();
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (logic.liquid.itemID < 4096) //Block
{
Block liquidBlock = Block.blocksList[logic.liquid.itemID];
if (liquidBlock != null)
float minX = 0.0625F;
float maxX = 0.9375F;
float minZ = 0.0625F;
float maxZ = 0.9375F;
ItemStack it = logic.getStackInSlot(0);
if(it != null){
CastingRecipe rec = TConstruct.basinCasting.getCastingRecipe(logic.liquid, it);
if(rec != null && rec.fluidRenderProperties != null){
minHeight = rec.fluidRenderProperties.minHeight;
maxHeight = rec.fluidRenderProperties.maxHeight;
minX = rec.fluidRenderProperties.minX;
maxX = rec.fluidRenderProperties.maxX;
minZ = rec.fluidRenderProperties.minZ;
maxZ = rec.fluidRenderProperties.maxZ;
}
}
float height = (logic.getLiquidAmount() / (logic.getCapacity() * 1.05F) * 0.6875F) / maxHeight;
renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ);
Fluid fluid = logic.liquid.getFluid();
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
/*if (logic.liquid.itemID < 4096) //Block
{
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, logic.liquid.itemMeta, x, y, z, renderer, world);
Block liquidBlock = Block.blocksList[logic.liquid.itemID];
if (liquidBlock != null)
{
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, logic.liquid.itemMeta, x, y, z, renderer, world);
}
}
else
//Item
{
Item liquidItem = Item.itemsList[logic.liquid.itemID];
if (liquidItem != null)
{
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(logic.liquid.itemMeta), x, y, z, renderer, world);
}
}*/
}
else
//Item
{
Item liquidItem = Item.itemsList[logic.liquid.itemID];
if (liquidItem != null)
{
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(logic.liquid.itemMeta), x, y, z, renderer, world);
}
}*/
}
}
else
@@ -1,12 +1,17 @@
package tconstruct.client.gui;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation;
@@ -21,9 +26,12 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import cpw.mods.fml.common.network.PacketDispatcher;
import tconstruct.blocks.component.SmelteryComponent;
import tconstruct.blocks.logic.AdaptiveSmelteryLogic;
import tconstruct.inventory.ActiveContainer;
import tconstruct.inventory.AdaptiveSmelteryContainer;
import tconstruct.library.component.MultiFluidTank;
public class AdaptiveSmelteryGui extends NewContainerGui
{
@@ -34,14 +42,18 @@ public class AdaptiveSmelteryGui extends NewContainerGui
float currentScroll = 0.0F;
int slotPos = 0;
int prevSlotPos = 0;
private SmelteryComponent scomp;
private MultiFluidTank multitank;
public AdaptiveSmelteryGui(InventoryPlayer inventoryplayer, AdaptiveSmelteryLogic smeltery, World world, int x, int y, int z)
{
super((ActiveContainer) smeltery.getGuiContainer(inventoryplayer, world, x, y, z));
logic = smeltery;
username = inventoryplayer.player.username;
xSize = 248;
//smeltery.updateFuelDisplay();
scomp = logic.getSmeltery();
multitank = logic.getMultiTank();
scomp.update();
}
public void drawScreen (int mouseX, int mouseY, float par3)
@@ -144,17 +156,17 @@ public class AdaptiveSmelteryGui extends NewContainerGui
}
}
/*if (logic.fuelGague > 0)
if (scomp.fuelGague > 0)
{
int leftX = cornerX + 117;
int topY = (cornerY + 68) - logic.getScaledFuelGague(52);
int topY = (cornerY + 68) - scomp.getScaledFuelGague(52);
int sizeX = 12;
int sizeY = logic.getScaledFuelGague(52);
int sizeY = scomp.getScaledFuelGague(52);
if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY)
{
drawFluidStackTooltip(new FluidStack(-37, logic.fuelAmount), mouseX - cornerX + 36, mouseY - cornerY);
drawFluidStackTooltip(new FluidStack(-37, scomp.fuelAmount), mouseX - cornerX + 36, mouseY - cornerY);
}
}*/
}
}
private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/smeltery.png");
@@ -170,11 +182,11 @@ public class AdaptiveSmelteryGui extends NewContainerGui
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, 176, ySize);
//Fuel - Lava
/*this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
if (logic.fuelGague > 0)
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
if (scomp.fuelGague > 0)
{
Icon lavaIcon = Block.lavaStill.getIcon(0, 0);
int fuel = logic.getScaledFuelGague(52);
int fuel = scomp.getScaledFuelGague(52);
int count = 0;
while (fuel > 0)
{
@@ -183,7 +195,7 @@ public class AdaptiveSmelteryGui extends NewContainerGui
drawLiquidRect(cornerX + 117, (cornerY + 68) - size - 16 * count, lavaIcon, 12, size);
count++;
}
}*/
}
FluidTankInfo[] info = logic.getTankInfo(ForgeDirection.UNKNOWN);
int capacity = 0;
@@ -440,14 +452,14 @@ public class AdaptiveSmelteryGui extends NewContainerGui
int cornerY = (height - ySize) / 2;
int fluidToBeBroughtUp = -1;
for (FluidStack liquid : logic.moltenMetal)
for (FluidStack liquid : multitank.getAllFluids())
{
int basePos = 54;
int initialLiquidSize = 0;
int liquidSize = 0;//liquid.amount * 52 / liquidLayers;
if (logic.getCapacity() > 0)
if (multitank.getCapacity() > 0)
{
int total = logic.getTotalLiquid();
int total = multitank.getFluidAmount();
int liquidLayers = (total / 20000 + 1) * 20000;
if (liquidLayers > 0)
{
@@ -5,22 +5,26 @@ import java.io.*;
import java.util.Iterator;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.util.*;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import tconstruct.blocks.logic.AdvancedDrawbridgeLogic;
import tconstruct.inventory.AdvancedDrawbridgeContainer;
public class AdvDrawbridgeGui extends GuiContainer
{
public AdvancedDrawbridgeLogic logic;
public boolean isGuiExpanded = false;
public boolean containerNeglectMouse = false;
public AdvDrawbridgeGui(InventoryPlayer inventoryplayer, AdvancedDrawbridgeLogic frypan, World world, int x, int y, int z)
public AdvDrawbridgeGui(EntityPlayer player, AdvancedDrawbridgeLogic frypan, World world, int x, int y, int z)
{
super(frypan.getGuiContainer(inventoryplayer, world, x, y, z));
super(frypan.getGuiContainer(player.inventory, world, x, y, z));
this.inventorySlots = new AdvancedDrawbridgeContainer(player.inventory, frypan, this);
player.openContainer = this.inventorySlots;
logic = frypan;
}
@@ -42,8 +46,15 @@ public class AdvDrawbridgeGui extends GuiContainer
if(!isGuiExpanded){
drawTexturedModalRect(cornerX + 34, cornerY + 35, 238, 0, 18, 18);
}else{
drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
drawTexturedModalRect(cornerX + 173, cornerY + 29, 10, 167, 10, 40);
for(int index = 0; index < 16; index++){
drawTexturedModalRect(index < 8 ? cornerX + 9 + 20 * index : cornerX + 9 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1), 238, 0, 18, 18);
if(index != 15){
drawTexturedModalRect(index < 8 ? cornerX + 26 + 20 * index : cornerX + 26 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1) + 6, 253, 18, 3, 5);
}
}
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
// drawTexturedModalRect(cornerX + 173, cornerY + 29, 10, 167, 10, 40);
}
}
@@ -53,6 +64,7 @@ public class AdvDrawbridgeGui extends GuiContainer
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
this.setExpanded(false);
this.buttonList.clear();
GuiButton button = new DrawbridgeButton(0, cornerX + 131, cornerY + 18, 176, 0, 21, 22);
if (logic.getPlacementDirection() == 0)
@@ -80,7 +92,7 @@ public class AdvDrawbridgeGui extends GuiContainer
public void setExpanded(boolean flag){
this.isGuiExpanded = flag;
this.containerNeglectMouse = true;
Iterator<GuiButton> i1 = this.buttonList.iterator();
while(i1.hasNext()){
GuiButton b = i1.next();
@@ -90,6 +102,7 @@ public class AdvDrawbridgeGui extends GuiContainer
b.drawButton = !flag;
}
}
((AdvancedDrawbridgeContainer)this.inventorySlots).updateContainerSlots();
}
protected void actionPerformed (GuiButton button)
@@ -135,4 +148,10 @@ public class AdvDrawbridgeGui extends GuiContainer
PacketDispatcher.sendPacketToServer(packet);
}
@Override
public void updateScreen(){
super.updateScreen();
this.containerNeglectMouse = false;
}
}
@@ -18,7 +18,7 @@ public class CraftingStationGui extends GuiContainer
/*public void onGuiClosed ()
{
System.out.println("Gui Closed");
TConstruct.logger.info("Gui Closed");
super.onGuiClosed();
}*/
+7 -3
View File
@@ -140,6 +140,7 @@ public class TContent implements IFuelHandler
//Decoration
public static Block stoneTorch;
public static Block stoneLadder;
public static Block multiBrick;
public static Block multiBrickFancy;
@@ -707,6 +708,8 @@ public class TContent implements IFuelHandler
//Decoration
stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch");
GameRegistry.registerBlock(stoneTorch, "decoration.stonetorch");
stoneLadder = new StoneLadder(PHConstruct.stoneLadder).setUnlocalizedName("decoration.stoneladder");
GameRegistry.registerBlock(stoneLadder, "decoration.stoneladder");
multiBrick = new MultiBrick(PHConstruct.multiBrick).setUnlocalizedName("Decoration.Brick");
GameRegistry.registerBlock(multiBrick, MultiBrickItem.class, "decoration.multibrick");
@@ -1645,6 +1648,7 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(Block.pumpkinLantern, 1, 0), "p", "s", 'p', new ItemStack(Block.pumpkin), 'w', new ItemStack(stoneTorch));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stoneTorch, 4), "p", "w", 'p', new ItemStack(Item.coal, 1, Short.MAX_VALUE), 'w', "stoneRod"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stoneLadder, 3), "w w", "www", "w w", 'w', "stoneRod"));
GameRegistry.addRecipe(new ItemStack(toolRod, 4, 1), "c", "c", 'c', new ItemStack(Block.stone));
GameRegistry.addRecipe(new ItemStack(toolRod, 2, 1), "c", "c", 'c', new ItemStack(Block.cobblestone));
@@ -2064,7 +2068,7 @@ public class TContent implements IFuelHandler
Object obj = getStaticItem("itemResource", "thaumcraft.common.config.ConfigItems");
if (obj != null)
{
System.out.println("[TConstruct] Thaumcraft detected. Adding thaumium tools.");
TConstruct.logger.info("Thaumcraft detected. Adding thaumium tools.");
thaumcraftAvailable = true;
TConstructClientRegistry.addMaterialRenderMapping(31, "tinker", "thaumium", true);
TConstructRegistry.addToolMaterial(31, "Thaumium", 3, 400, 700, 2, 1.3F, 0, 0f, "\u00A75", "Thaumic");
@@ -2081,7 +2085,7 @@ public class TContent implements IFuelHandler
}
else
{
System.out.println("[TConstruct] Thaumcraft not detected.");
TConstruct.logger.warning("Thaumcraft not detected.");
}
if (Loader.isModLoaded("Natura"))
@@ -2191,7 +2195,7 @@ public class TContent implements IFuelHandler
}
catch (Exception e)
{
System.out.println("[TConstruct] Could not find " + name);
TConstruct.logger.warning("Could not find " + name);
return null;
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ import java.util.EnumSet;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
import tconstruct.TConstruct;
public class TimeTicker implements ITickHandler
{
@@ -15,7 +16,7 @@ public class TimeTicker implements ITickHandler
@Override
public void tickStart (EnumSet<TickType> type, Object... tickData)
{
System.out.println("Tick");
TConstruct.logger.info("Tick");
time++;
tickParts = (int) (time % 20);
seconds = (int) (time / 20);
+1 -1
View File
@@ -469,7 +469,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
void moveTowardsEntity (Entity entity)
{
//System.out.println("Moving towards entity");
//TConstruct.logger.info("Moving towards entity");
/*double distX = this.posX - entity.posX;
double distZ = this.posZ - entity.posZ;
//posY = posY + 0.1;
@@ -22,7 +22,7 @@ public class DaggerEntity extends RotatingBase
public DaggerEntity(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
super(world, entityplayer, 0.75F, 0.8F);
//System.out.println("Stack: "+itemstack);
//TConstruct.logger.info("Stack: "+itemstack);
returnStackSlot = entityplayer.inventory.currentItem;
returnStack = itemstack;
}
@@ -55,7 +55,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer
if (invRow != slotRow)
{
slotRow = invRow;
//System.out.println(invRow);
//TConstruct.logger.info(invRow);
int basePos = invRow * 3;
for (int iter = 0; iter < activeInventorySlots.size(); iter++)
{
@@ -135,7 +135,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer
@Override
protected boolean mergeItemStack (ItemStack inputStack, int startSlot, int endSlot, boolean flag)
{
//System.out.println("Merge");
//TConstruct.logger.info("Merge");
boolean merged = false;
int slotPos = startSlot;
@@ -149,7 +149,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer
/*if (inputStack.isStackable() && startSlot >= logic.getSizeInventory())
{
System.out.println("Rawr!");
TConstruct.logger.info("Rawr!");
while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot))
{
slot = (Slot) this.inventorySlots.get(slotPos);
@@ -1,11 +1,13 @@
package tconstruct.inventory;
import tconstruct.client.gui.AdvDrawbridgeGui;
import net.minecraft.entity.player.EntityPlayer;
import java.util.Iterator;
import net.minecraft.entity.player.*;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.*;
import tconstruct.blocks.logic.AdvancedDrawbridgeLogic;
import tconstruct.client.gui.AdvDrawbridgeGui;
public class AdvancedDrawbridgeContainer extends Container {
public AdvancedDrawbridgeLogic logic;
@@ -26,7 +28,7 @@ public class AdvancedDrawbridgeContainer extends Container {
public AdvancedDrawbridgeContainer(InventoryPlayer inventoryplayer, AdvancedDrawbridgeLogic logic, AdvDrawbridgeGui gui) {
this.logic = logic;
this.gui = gui;
addContainerSlots(logic);
bindPlayerInventory(inventoryplayer);
updateContainerSlots();
@@ -46,9 +48,12 @@ public class AdvancedDrawbridgeContainer extends Container {
public void addContainerSlots(AdvancedDrawbridgeLogic logic) {
this.addSlotToContainer(new SlotOpaqueBlocksOnly(logic.camoInventory, 0, 35, 36));
for(int i = 0; i < logic.getSizeInventory(); i++){
this.addSlotToContainer(new DrawbridgeSlot(logic, i, -2 + 18 * i, 40, logic));
for (int i = 0; i < logic.getSizeInventory(); i++) {
int ind = (int) (Math.floor(i / 8) * 8);
int x = i < 8 ? 10 + 20 * i : 10 + 20 * (i - 8);
int y = 35 + (int) Math.floor(i / 8) * 18 + (i < 8 ? 0 : 1);
this.addSlotToContainer(new DrawbridgeSlot(logic, i, x, y, logic));
}
}
@@ -85,8 +90,45 @@ public class AdvancedDrawbridgeContainer extends Container {
}
public void updateContainerSlots() {
if (gui == null || gui.isGuiExpanded) {
if (gui == null) {
return;
} else if (gui.isGuiExpanded) {
Iterator<Slot> i1 = inventorySlots.iterator();
int index = 0;
while (i1.hasNext()) {
Slot sl = i1.next();
if (index == 0) {
sl.xDisplayPosition = -1000;
sl.yDisplayPosition = -1000;
} else if (sl instanceof DrawbridgeSlot) {
sl.xDisplayPosition = (index - 1) < 8 ? 10 + 20 * (index - 1) : 10 + 20 * ((index - 1) - 8);
sl.yDisplayPosition = 35 + (int) Math.floor((index - 1) / 8) * 18 + ((index - 1) < 8 ? 0 : 1);
}
index++;
}
} else {
Iterator<Slot> i1 = inventorySlots.iterator();
int index = 0;
while (i1.hasNext()) {
Slot sl = i1.next();
if (index == 0) {
sl.xDisplayPosition = 35;
sl.yDisplayPosition = 36;
} else if (sl instanceof DrawbridgeSlot) {
sl.xDisplayPosition = -1000;
sl.yDisplayPosition = -1000;
}
index++;
}
}
}
@Override
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer){
if(gui != null && gui.containerNeglectMouse){
return null;
}else{
return super.slotClick(par1, par2, par3, par4EntityPlayer);
}
}
}
@@ -49,7 +49,7 @@ public class SmelteryContainer extends ActiveContainer
if (invRow != slotRow)
{
slotRow = invRow;
//System.out.println(invRow);
//TConstruct.logger.info(invRow);
int basePos = invRow * 3;
for (int iter = 0; iter < activeInventorySlots.size(); iter++)
{
@@ -166,7 +166,7 @@ public class SmelteryContainer extends ActiveContainer
@Override
protected boolean mergeItemStack (ItemStack inputStack, int startSlot, int endSlot, boolean flag)
{
//System.out.println("Merge");
//TConstruct.logger.info("Merge");
boolean merged = false;
int slotPos = startSlot;
@@ -180,7 +180,7 @@ public class SmelteryContainer extends ActiveContainer
/*if (inputStack.isStackable() && startSlot >= logic.getSizeInventory())
{
System.out.println("Rawr!");
TConstruct.logger.info("Rawr!");
while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot))
{
slot = (Slot) this.inventorySlots.get(slotPos);
@@ -231,7 +231,7 @@ public class ToolStationContainer extends ActiveContainer
}
/*boolean emptySlots = ( ((Slot) inventorySlots.get(2)).getStack() == null && ((Slot) inventorySlots.get(3)).getStack() == null );
System.out.println("Empty slots");
TConstruct.logger.info("Empty slots");
if (!failedToMerge && emptySlots)
player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/
+9 -2
View File
@@ -24,10 +24,17 @@ public class ToolPart extends CraftingItem implements IToolPart
@Override
public String getItemDisplayName (ItemStack par1ItemStack)
{
StringBuilder builder = new StringBuilder();
String material = StatCollector.translateToLocal("parttype." + toolTextureNames[par1ItemStack.getItemDamage()]);
String name = StatCollector.translateToLocal("toolpart." + partName);
name = name.replaceAll("%%material", material);
return name;
/*StringBuilder builder = new StringBuilder();
builder.append(StatCollector.translateToLocal("parttype." + toolTextureNames[par1ItemStack.getItemDamage()])).append(" ").append(StatCollector.translateToLocal("toolpart." + partName));
return builder.toString();
/*String s = ("" + StatCollector.translateToLocal("toolpart."+partName)).trim();
--
String s = ("" + StatCollector.translateToLocal("toolpart."+partName)).trim();
String s1 = toolMaterialNames[par1ItemStack.getItemDamage()];
if (s1 != null)
+7 -6
View File
@@ -2,6 +2,7 @@ package tconstruct.items.tools;
import java.util.List;
import tconstruct.TConstruct;
import tconstruct.common.TContent;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.ToolCore;
@@ -104,8 +105,8 @@ public class Arrow extends ToolCore
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 3), new ItemStack(getHandleItem(), 1, 0), accessoryStack, extraStack, "");
if (tool == null)
{
System.out.println("Creative builder failed tool for Vanilla style" + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for Vanilla style" + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
@@ -124,8 +125,8 @@ public class Arrow extends ToolCore
if (tool == null)
{
System.out.println("Creative builder failed tool for Vanilla style" + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for Vanilla style" + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
@@ -146,8 +147,8 @@ public class Arrow extends ToolCore
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, id), accessoryStack, extraStack, name + getToolName());
if (tool == null)
{
System.out.println("Creative builder failed tool for " + name + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
+3 -2
View File
@@ -5,6 +5,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import tconstruct.TConstruct;
import tconstruct.common.TContent;
import tconstruct.entity.projectile.ArrowEntity;
import tconstruct.library.crafting.ToolBuilder;
@@ -770,8 +771,8 @@ public abstract class BowBase extends ToolCore
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, 0), accessoryStack, extraStack, name + getToolName());
if (tool == null)
{
System.out.println("Creative builder failed tool for " + name + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
+3 -2
View File
@@ -8,6 +8,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.common.TContent;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.AbilityHelper;
@@ -119,8 +120,8 @@ public class Mattock extends DualHarvestTool
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, id), accessoryStack, extraStack, name + getToolName());
if (tool == null)
{
System.out.println("Creative builder failed tool for " + name + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
+11 -8
View File
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Logger;
import tconstruct.library.crafting.Detailing;
import tconstruct.library.crafting.LiquidCasting;
@@ -31,6 +32,8 @@ public class TConstructRegistry
{
public static TConstructRegistry instance = new TConstructRegistry();
public static Logger logger = Logger.getLogger("TCon-API");
/* Creative tabs */
public static TabTools toolTab;
public static TabTools materialTab;
@@ -67,7 +70,7 @@ public class TConstructRegistry
{
Item add = itemDirectory.get(name);
if (add != null)
System.out.println("[TCon API] " + name + " is already present in the Item directory");
logger.warning(name + " is already present in the Item directory");
itemDirectory.put(name, itemstack);
}
@@ -82,7 +85,7 @@ public class TConstructRegistry
{
Item ret = itemDirectory.get(name);
if (ret == null)
System.out.println("[TCon API] Could not find " + name + " in the Item directory");
logger.warning("Could not find " + name + " in the Item directory");
return ret;
}
@@ -113,7 +116,7 @@ public class TConstructRegistry
{
ItemStack add = itemstackDirectory.get(name);
if (add != null)
System.out.println("[TCon API] " + name + " is already present in the ItemStack directory");
logger.warning(name + " is already present in the ItemStack directory");
itemstackDirectory.put(name, itemstack);
}
@@ -128,7 +131,7 @@ public class TConstructRegistry
{
ItemStack ret = itemstackDirectory.get(name);
if (ret == null)
System.out.println("[TCon API] Could not find " + name + " in the ItemStack directory");
logger.warning("Could not find " + name + " in the ItemStack directory");
return ret;
}
@@ -197,7 +200,7 @@ public class TConstructRegistry
{
ToolBuilder tb = ToolBuilder.instance;
if (parts.length < 1 || parts.length > 4 || parts.length == 3)
System.out.println("[TCon API] Wrong amount of items to craft into a tool");
logger.warning("Wrong amount of items to craft into a tool");
tb.addToolRecipe(output, parts);
}
@@ -446,7 +449,7 @@ public class TConstructRegistry
}
catch (Exception e)
{
System.out.println("[TCon API] Could not find casting table recipes.");
logger.warning("Could not find casting table recipes.");
return null;
}
}
@@ -467,7 +470,7 @@ public class TConstructRegistry
}
catch (Exception e)
{
System.out.println("[TCon API] Could not find casting basin recipes.");
logger.warning("Could not find casting basin recipes.");
return null;
}
}
@@ -488,7 +491,7 @@ public class TConstructRegistry
}
catch (Exception e)
{
System.out.println("[TCon API] Could not find chisel detailing recipes.");
logger.warning("Could not find chisel detailing recipes.");
return null;
}
}
@@ -10,7 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import tconstruct.common.TContent;
import scala.compat.Platform$;
import tconstruct.TConstruct;
import tconstruct.library.util.CoordTuple;
import tconstruct.library.util.CoordTupleSort;
import tconstruct.library.util.IFacingLogic;
@@ -36,7 +37,8 @@ public class TankLayerScan extends LogicComponent
protected ArrayList<int[]> validAirCoords = new ArrayList<int[]>();
protected CoordTuple returnStone;
private boolean debug = false;
private static boolean debug = false;
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion causes overflows on 32-bit, so reduce if not 64-bit
public TankLayerScan(TileEntity te, Block... ids)
{
@@ -49,6 +51,7 @@ public class TankLayerScan extends LogicComponent
validAirCoords.add(new int[] { -1, 0 });
validAirCoords.add(new int[] { 0, 1 });
validAirCoords.add(new int[] { 0, -1 });
//TConstruct.logger.info("Using recursion size " + MAX_LAYER_RECURSION_DEPTH + " on JVM arch " + System.getProperty("os.arch"));
}
public void checkValidStructure ()
@@ -108,7 +111,7 @@ public class TankLayerScan extends LogicComponent
break;
}
if (!world.isRemote && debug)
System.out.println("Bricks in recursion: " + blockCoords.size());
TConstruct.logger.info("Bricks in recursion: " + blockCoords.size());
blockCoords.clear();
bricks = 0;
@@ -116,8 +119,8 @@ public class TankLayerScan extends LogicComponent
boolean sealed = floodTest(master.xCoord + xPos, master.yCoord, master.zCoord + zPos);
if (!world.isRemote && debug)
{
System.out.println("Air in ring: " + airBlocks);
System.out.println("Bricks in ring: " + bricks);
TConstruct.logger.info("Air in ring: " + airBlocks);
TConstruct.logger.info("Bricks in ring: " + bricks);
}
if (sealed)
@@ -135,8 +138,8 @@ public class TankLayerScan extends LogicComponent
if (!world.isRemote && debug)
{
System.out.println("Air in structure: " + airCoords.size());
System.out.println("Bricks in structure: " + blockCoords.size());
TConstruct.logger.info("Air in structure: " + airCoords.size());
TConstruct.logger.info("Bricks in structure: " + blockCoords.size());
}
}
}
@@ -255,7 +258,7 @@ public class TankLayerScan extends LogicComponent
protected boolean floodTest (int x, int y, int z)
{
if (airBlocks > 4000)
if (airBlocks > MAX_LAYER_RECURSION_DEPTH)
return false;
for (int[] offset : validAirCoords)
@@ -40,7 +40,7 @@ public class ShapelessToolRecipe extends ShapelessRecipes
{
ItemStack itemstack1 = (ItemStack) iterator.next();
//System.out.println("Rawr! "+itemstack1.getItemDamage());
//TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage());
if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
{
if (itemstack.getItem() instanceof ToolCore)
@@ -196,7 +196,7 @@ public class ToolBuilder
}
}
//System.out.println("Valid: "+item);
//TConstruct.logger.info("Valid: "+item);
if (item == null)
return null;
+11 -7
View File
@@ -9,6 +9,9 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import appeng.api.IAEItemStack;
import appeng.api.me.items.IAEChargeableItem;
import appeng.api.me.items.IStorageCell;
import mods.battlegear2.api.weapons.IBattlegearWeapon;
import mods.battlegear2.api.weapons.OffhandAttackEvent;
import net.minecraft.block.Block;
@@ -24,6 +27,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import tconstruct.TConstruct;
import tconstruct.library.ActiveToolMod;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.ToolBuilder;
@@ -56,7 +60,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* @see ToolMod
*/
public abstract class ToolCore extends Item implements ICustomElectricItem, IBoxable, IBattlegearWeapon//, IStorageCell, IAEChargeableItem
public abstract class ToolCore extends Item implements ICustomElectricItem, IBoxable, IBattlegearWeapon, IStorageCell, IAEChargeableItem
{
protected Random random = new Random();
protected int damageVsEntity;
@@ -537,8 +541,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, id), accessoryStack, extraStack, name + getToolName());
if (tool == null)
{
System.out.println("Creative builder failed tool for " + name + this.getToolName());
System.out.println("Make sure you do not have item ID conflicts");
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
}
else
{
@@ -989,7 +993,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
}
/* Applied Energistics support, IAEChargableItem */
/*@Override
@Override
public float addEnergy (ItemStack target, float energy)
{
// TODO Auto-generated method stub
@@ -1001,10 +1005,10 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
{
// TODO Auto-generated method stub
return false;
}*/
}
/* Applied Energistics support, IStorageCell */
/*@Override
@Override
public int getBytes (ItemStack cellItem)
{
// TODO Auto-generated method stub
@@ -1036,5 +1040,5 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
{
// TODO Auto-generated method stub
return false;
}*/
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ public class ModBoolean extends ToolMod
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean(key, true);
//System.out.println("Key: "+key+" "+tags.getBoolean(key));
//TConstruct.logger.info("Key: "+key+" "+tags.getBoolean(key));
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
+1 -1
View File
@@ -60,7 +60,7 @@ public class ModRepair extends ToolMod
materialValue = PatternBuilder.instance.getPartValue(input[1]);
int increase = (int) (50 + (dur * 0.4f * materialValue));
//System.out.println("Increase: "+increase);
//TConstruct.logger.info("Increase: "+increase);
int modifiers = tags.getInteger("Modifiers");
float mods = 1.0f;
+1 -1
View File
@@ -438,7 +438,7 @@ public class TEventHandler
{
if (event.entity instanceof EntityXPOrb)
{
System.out.println("Entity: " + event.entity);
TConstruct.logger.info("Entity: " + event.entity);
}
}*/
+2 -1
View File
@@ -3,6 +3,7 @@ package tconstruct.util.config;
import java.io.File;
import java.io.IOException;
import net.minecraftforge.common.Configuration;
import tconstruct.TConstruct;
public class BOPConfig
{
@@ -25,7 +26,7 @@ public class BOPConfig
config.load();
promisedLandDimensionID = config.get("dimension settings", "Promised Land Dimension ID", -200).getInt();
System.out.println("[TConstruct]PL Dim ID: " + promisedLandDimensionID);
TConstruct.logger.info("PL Dim ID: " + promisedLandDimensionID);
}
else
{
@@ -42,7 +42,7 @@ public class DimensionBlacklist
{
if (blacklist.get(len) == dim)
return false;
//System.out.println("[TConstruct]diminblist +" + blacklist.get(len));
//TConstruct.logger.info("diminblist +" + blacklist.get(len));
}
return true;
@@ -53,7 +53,7 @@ public class DimensionBlacklist
for (int len = 0; len < nopool.size(); len++)
{
if (nopool.get(len) == dim)
//System.out.println("[TConstruct]DimNoPool "+ nopool.get(len));
//TConstruct.logger.info("DimNoPool "+ nopool.get(len));
return true;
}
return false;
+5 -2
View File
@@ -5,6 +5,7 @@ import java.io.IOException;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
import tconstruct.TConstruct;
import tconstruct.library.tools.AbilityHelper;
public class PHConstruct
@@ -29,8 +30,8 @@ public class PHConstruct
}
catch (IOException e)
{
System.out.println("Could not create configuration file for TConstruct. Reason:");
System.out.println(e);
TConstruct.logger.severe("Could not create configuration file for TConstruct. Reason:");
TConstruct.logger.severe(e.getLocalizedMessage());
}
/* [Forge] Configuration class, used as config method */
@@ -88,6 +89,7 @@ public class PHConstruct
multiBrick = config.getBlock("Multi Brick", 1481).getInt(1481);
stoneTorch = config.getBlock("Stone Torch", 1484).getInt(1484);
stoneLadder = config.getBlock("Stone Ladder", 1479).getInt(1479);
oreBerry = config.getBlock("Ore Berry One", 1485).getInt(1485);
oreBerrySecond = config.getBlock("Ore Berry Two", 1486).getInt(1486);
@@ -473,6 +475,7 @@ public class PHConstruct
//Decoration
public static int stoneTorch;
public static int stoneLadder;
public static int multiBrick;
public static int multiBrickFancy;
public static int redstoneBallRepeater;
@@ -3,6 +3,7 @@ package tconstruct.util.config;
import java.io.File;
import java.io.IOException;
import net.minecraftforge.common.Configuration;
import tconstruct.TConstruct;
public class TwilightForestConfig
{
@@ -16,7 +17,7 @@ public class TwilightForestConfig
config.load();
twilightForestDimensionID = config.get("dimension", "dimensionID", -100).getInt();
System.out.println("[TConstruct]TF Dim ID: " + twilightForestDimensionID);
TConstruct.logger.info("TF Dim ID: " + twilightForestDimensionID);
}
else
{
@@ -55,9 +55,8 @@ public class TPacketHandler implements IPacketHandler
}
catch (Exception e)
{
System.out.println("Failed at reading client packet for TConstruct.");
TConstruct.logger.warning("Failed at reading client packet for TConstruct.");
e.printStackTrace();
return;
}
}
@@ -187,9 +186,8 @@ public class TPacketHandler implements IPacketHandler
}
catch (IOException e)
{
System.out.println("Failed at reading server packet for TConstruct.");
TConstruct.logger.warning("Failed at reading server packet for TConstruct.");
e.printStackTrace();
return;
}
}
@@ -50,7 +50,7 @@ public class ArmorExtended implements IInventory
{
if (inventory[slot] != null)
{
//System.out.println("Took something from slot " + slot);
//TConstruct.logger.info("Took something from slot " + slot);
if (inventory[slot].stackSize <= quantity)
{
ItemStack stack = inventory[slot];
@@ -83,7 +83,7 @@ public class ArmorExtended implements IInventory
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
inventory[slot] = itemstack;
//System.out.println("Changed slot " + slot + " on side " + FMLCommonHandler.instance().getEffectiveSide());
//TConstruct.logger.info("Changed slot " + slot + " on side " + FMLCommonHandler.instance().getEffectiveSide());
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
@@ -159,7 +159,7 @@ public class ArmorExtended implements IInventory
{
ItemStack stack = inventory[6];
int meta = stack.getItemDamage();
//System.out.println("Calculating HP on side " + FMLCommonHandler.instance().getEffectiveSide());
//TConstruct.logger.info("Calculating HP on side " + FMLCommonHandler.instance().getEffectiveSide());
if (meta == 2)
{
int prevHealth = stats.bonusHealth;
@@ -173,7 +173,7 @@ public class ArmorExtended implements IInventory
stats.bonusHealth = bonusHP;
int healthChange = bonusHP - prevHealth;
//System.out.println("healthChange: "+healthChange+" on side "+FMLCommonHandler.instance().getEffectiveSide());
//TConstruct.logger.info("healthChange: "+healthChange+" on side "+FMLCommonHandler.instance().getEffectiveSide());
if (healthChange != 0)
{
AttributeInstance attributeinstance = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
@@ -4,7 +4,7 @@ public class ArmorExtendedClient extends ArmorExtended
{
/*public void recalculateSkills(EntityPlayer player, TPlayerStats stats)
{
System.out.println("Client skills");
TConstruct.logger.info("Client skills");
if (inventory[1] != null && inventory[1].getItem() == TContent.glove)
{
if (TProxyClient.skillList.size() < 1)
@@ -33,7 +33,7 @@ public class TPlayerHandler implements IPlayerTracker
@Override
public void onPlayerLogin (EntityPlayer entityplayer)
{
//System.out.println("Player: "+entityplayer);
//TConstruct.logger.info("Player: "+entityplayer);
//Lookup player
NBTTagCompound tags = entityplayer.getEntityData();
if (!tags.hasKey("TConstruct"))
@@ -189,7 +189,7 @@ public class TPlayerHandler implements IPlayerTracker
stats.prevOnGround = player.onGround;
//if ()
//System.out.println("Fall: "+player.fallDistance);
//TConstruct.logger.info("Fall: "+player.fallDistance);
}
}
}*/
@@ -211,7 +211,7 @@ public class TPlayerHandler implements IPlayerTracker
public TPlayerStats getPlayerStats (String username)
{
TPlayerStats stats = playerStats.get(username);
//System.out.println("Stats: "+stats);
//TConstruct.logger.info("Stats: "+stats);
if (stats == null)
{
stats = new TPlayerStats();
@@ -243,7 +243,7 @@ public class TPlayerHandler implements IPlayerTracker
public static void setEntitySize (float width, float height, Entity entity)
{
//System.out.println("Size: " + height);
//TConstruct.logger.info("Size: " + height);
if (width != entity.width || height != entity.height)
{
entity.width = width;
@@ -117,7 +117,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Iron: "+coord.toString());*/
TConstruct.logger.info("Iron: "+coord.toString());*/
ironBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -133,7 +133,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Gold: "+coord.toString());*/
TConstruct.logger.info("Gold: "+coord.toString());*/
goldBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -149,7 +149,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Copper: "+coord.toString());*/
TConstruct.logger.info("Copper: "+coord.toString());*/
copperBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -165,7 +165,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Tin: "+coord.toString());*/
TConstruct.logger.info("Tin: "+coord.toString());*/
tinBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -181,7 +181,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Aluminum: "+coord.toString());*/
TConstruct.logger.info("Aluminum: "+coord.toString());*/
aluminumBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -197,7 +197,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
System.out.println("Silver: "+coord.toString());*/
TConstruct.logger.info("Silver: "+coord.toString());*/
silverBush.generate(world, random, xPos, yPos, zPos);
}
}
@@ -3,6 +3,7 @@ package tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
import tconstruct.TConstruct;
import tconstruct.common.TContent;
import net.minecraft.block.Block;
@@ -91,7 +92,7 @@ public class ComponentSmeltery extends ComponentVillage
int remapDirection (int direction)
{
System.out.println("Direction: " + direction);
TConstruct.logger.info("Direction: " + direction);
switch (direction)
{
case 0:
@@ -103,7 +104,7 @@ public class ComponentSmeltery extends ComponentVillage
case 3:
return 0;
}
System.out.println("This shouldn't happen");
TConstruct.logger.severe("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
return -1;
}