mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 05:02:39 +00:00
Upload my Code Changes/Format/imports
This commit is contained in:
1 parent
5bcdb7ca46
commit
5d4e38c0cb
264 files changed
+4014
-3972
No files matched your search
@@ -52,9 +52,15 @@ public class BlockFalling extends Block
|
||||
{
|
||||
if (!p_149830_1_.isRemote)
|
||||
{
|
||||
//EntityFallingBlock entityfallingblock = new EntityFallingBlock(p_149830_1_, (double)((float)p_149830_2_ + 0.5F), (double)((float)p_149830_3_ + 0.5F), (double)((float)p_149830_4_ + 0.5F), this, p_149830_1_.getBlockMetadata(p_149830_2_, p_149830_3_, p_149830_4_));
|
||||
//this.func_149829_a(entityfallingblock);
|
||||
//p_149830_1_.spawnEntityInWorld(entityfallingblock);
|
||||
// EntityFallingBlock entityfallingblock = new
|
||||
// EntityFallingBlock(p_149830_1_,
|
||||
// (double)((float)p_149830_2_ + 0.5F),
|
||||
// (double)((float)p_149830_3_ + 0.5F),
|
||||
// (double)((float)p_149830_4_ + 0.5F), this,
|
||||
// p_149830_1_.getBlockMetadata(p_149830_2_, p_149830_3_,
|
||||
// p_149830_4_));
|
||||
// this.func_149829_a(entityfallingblock);
|
||||
// p_149830_1_.spawnEntityInWorld(entityfallingblock);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -97,9 +103,10 @@ public class BlockFalling extends Block
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: King, take a look here when doing liquids!
|
||||
//Material material = block.blockMaterial;
|
||||
//return material == Material.water ? true : material == Material.lava;
|
||||
// TODO: King, take a look here when doing liquids!
|
||||
// Material material = block.blockMaterial;
|
||||
// return material == Material.water ? true : material ==
|
||||
// Material.lava;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,44 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import java.util.*;
|
||||
import mantle.blocks.BlockUtils;
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockPressurePlate.Sensitivity;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.item.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.*;
|
||||
import tconstruct.blocks.logic.LandmineExplodeLogic;
|
||||
import tconstruct.blocks.logic.TileEntityLandmine;
|
||||
import tconstruct.client.block.RenderLandmine;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.util.landmine.Helper;
|
||||
@@ -33,7 +51,8 @@ import tconstruct.util.landmine.Helper;
|
||||
public class BlockLandmine extends BlockContainer
|
||||
{
|
||||
|
||||
// Should explode when broken instead of dropping items(may not actually work
|
||||
// Should explode when broken instead of dropping items(may not actually
|
||||
// work
|
||||
boolean explodeOnBroken = false;
|
||||
|
||||
public BlockLandmine()
|
||||
@@ -445,7 +464,7 @@ public class BlockLandmine extends BlockContainer
|
||||
TileEntityLandmine te = (TileEntityLandmine) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
Sensitivity triggerType;
|
||||
|
||||
|
||||
// Change to return 1 if you want the landmine to blow up when the block
|
||||
// holding it is broken
|
||||
if (te == null)
|
||||
@@ -509,7 +528,9 @@ public class BlockLandmine extends BlockContainer
|
||||
protected AxisAlignedBB getSensitiveAABB (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
float f = 0.125F;
|
||||
// return AxisAlignedBB.getAABBPool().getAABB((double)((float)par1 + f), (double)par2, (double)((float)par3 + f), (double)((float)(par1 + 1) - f), (double)par2 + 0.25D, (double)((float)(par3 + 1) - f));
|
||||
// return AxisAlignedBB.getAABBPool().getAABB((double)((float)par1 + f),
|
||||
// (double)par2, (double)((float)par3 + f), (double)((float)(par1 + 1) -
|
||||
// f), (double)par2 + 0.25D, (double)((float)(par3 + 1) - f));
|
||||
|
||||
int l = par1World.getBlockMetadata(par2, par3, par4);
|
||||
int i1 = l & 7;
|
||||
@@ -543,7 +564,7 @@ public class BlockLandmine extends BlockContainer
|
||||
TileEntityLandmine te = (TileEntityLandmine) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
Sensitivity triggerType;
|
||||
|
||||
|
||||
// Change to return 1 if you want the landmine to blow up when the
|
||||
// block holding it is broken
|
||||
if (te == null)
|
||||
@@ -639,16 +660,17 @@ public class BlockLandmine extends BlockContainer
|
||||
this.setBlockBounds(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
default:
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
break;
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped (int par1){
|
||||
return par1;
|
||||
public int damageDropped (int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (int par1, Random par2Random, int par3)
|
||||
{
|
||||
|
||||
@@ -41,10 +41,10 @@ public class CastingChannelBlock extends BlockContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
//int amount = 0;
|
||||
//if (tile.getFluid() != null)
|
||||
//amount = tile.getLiquidAmount();
|
||||
//player.addChatMessage("LiquidAmount: " + amount);
|
||||
// int amount = 0;
|
||||
// if (tile.getFluid() != null)
|
||||
// amount = tile.getLiquidAmount();
|
||||
// player.addChatMessage("LiquidAmount: " + amount);
|
||||
tile.setActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class CraftingStationBlock extends InventoryBlock
|
||||
this.stepSound = Block.soundTypeWood;
|
||||
}
|
||||
|
||||
//Block.hasComparatorInputOverride and Block.getComparatorInputOverride
|
||||
// Block.hasComparatorInputOverride and Block.getComparatorInputOverride
|
||||
|
||||
/* Rendering */
|
||||
@Override
|
||||
|
||||
@@ -254,105 +254,50 @@ public class DryingRack extends InventoryBlock
|
||||
return new DryingRackLogic();
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return true;
|
||||
}*/
|
||||
/*
|
||||
* @Override public boolean shouldSideBeRendered (IBlockAccess
|
||||
* par1IBlockAccess, int par2, int par3, int par4, int par5) { return true;
|
||||
* }
|
||||
*/
|
||||
|
||||
/*@Override
|
||||
public void getSubBlocks (int id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int iter = 0; iter < 3; iter++)
|
||||
{
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
* @Override public void getSubBlocks (int id, CreativeTabs tab, List list)
|
||||
* { for (int iter = 0; iter < 3; iter++) { list.add(new ItemStack(id, 1,
|
||||
* iter)); } }
|
||||
*/
|
||||
|
||||
/*@Override
|
||||
public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta != 1)
|
||||
{
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
|
||||
float xMin = 0.25F;
|
||||
float xMax = 0.75F;
|
||||
float zMin = 0.25F;
|
||||
float zMax = 0.75F;
|
||||
/*
|
||||
* @Override public void setBlockBoundsBasedOnState (IBlockAccess world, int
|
||||
* x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); if (meta
|
||||
* != 1) { this.setBlockBounds(0, 0, 0, 1, 1, 1); } else { FaucetLogic logic
|
||||
* = (FaucetLogic) world.getBlockTileEntity(x, y, z); float xMin = 0.25F;
|
||||
* float xMax = 0.75F; float zMin = 0.25F; float zMax = 0.75F;
|
||||
*
|
||||
* switch (logic.getRenderDirection()) { case 2: zMin = 0.625F; zMax = 1.0F;
|
||||
* break; case 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F;
|
||||
* xMax = 1.0F; break; case 5: xMax = 0.375F; xMin = 0F; break; }
|
||||
*
|
||||
* this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax); } }
|
||||
*/
|
||||
|
||||
switch (logic.getRenderDirection())
|
||||
{
|
||||
case 2:
|
||||
zMin = 0.625F;
|
||||
zMax = 1.0F;
|
||||
break;
|
||||
case 3:
|
||||
zMax = 0.375F;
|
||||
zMin = 0F;
|
||||
break;
|
||||
case 4:
|
||||
xMin = 0.625F;
|
||||
xMax = 1.0F;
|
||||
break;
|
||||
case 5:
|
||||
xMax = 0.375F;
|
||||
xMin = 0F;
|
||||
break;
|
||||
}
|
||||
|
||||
this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax);
|
||||
}
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta != 1)
|
||||
{
|
||||
return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1, z + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
|
||||
if (logic != null)
|
||||
{
|
||||
float xMin = 0.25F;
|
||||
float xMax = 0.75F;
|
||||
float zMin = 0.25F;
|
||||
float zMax = 0.75F;
|
||||
|
||||
switch (logic.getRenderDirection())
|
||||
{
|
||||
case 2:
|
||||
zMin = 0.625F;
|
||||
zMax = 1.0F;
|
||||
break;
|
||||
case 3:
|
||||
zMax = 0.375F;
|
||||
zMin = 0F;
|
||||
break;
|
||||
case 4:
|
||||
xMin = 0.625F;
|
||||
xMax = 1.0F;
|
||||
break;
|
||||
case 5:
|
||||
xMax = 0.375F;
|
||||
xMin = 0F;
|
||||
break;
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getAABBPool().getAABB((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax));
|
||||
}
|
||||
}
|
||||
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}*/
|
||||
/*
|
||||
* @Override public AxisAlignedBB getCollisionBoundingBoxFromPool (World
|
||||
* world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z);
|
||||
* if (meta != 1) { return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x +
|
||||
* 1, y + 1, z + 1); } else { FaucetLogic logic = (FaucetLogic)
|
||||
* world.getBlockTileEntity(x, y, z); if (logic != null) { float xMin =
|
||||
* 0.25F; float xMax = 0.75F; float zMin = 0.25F; float zMax = 0.75F;
|
||||
*
|
||||
* switch (logic.getRenderDirection()) { case 2: zMin = 0.625F; zMax = 1.0F;
|
||||
* break; case 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F;
|
||||
* xMax = 1.0F; break; case 5: xMax = 0.375F; xMin = 0F; break; }
|
||||
*
|
||||
* return AxisAlignedBB.getAABBPool().getAABB((double) ((float) x + xMin),
|
||||
* (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x +
|
||||
* xMax), (double) y + 0.625, (double) ((float) z + zMax)); } }
|
||||
*
|
||||
* return super.getCollisionBoundingBoxFromPool(world, x, y, z); }
|
||||
*/
|
||||
|
||||
/* Redstone */
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class EquipBlock extends InventoryBlock
|
||||
super(material);
|
||||
this.setHardness(0.3f);
|
||||
this.setBlockBounds(0, 0, 0, 1, 0.25f, 1);
|
||||
//this.setCreativeTab(ToolConstruct.materialTab);
|
||||
// this.setCreativeTab(ToolConstruct.materialTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,7 +50,8 @@ public class EquipBlock extends InventoryBlock
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister par1IconRegister)
|
||||
{
|
||||
//this.blockIcon = par1iconRegister.registerIcon(Block.blockIron.getUnlocalizedName());
|
||||
// this.blockIcon =
|
||||
// par1iconRegister.registerIcon(Block.blockIron.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,8 @@ import net.minecraft.world.World;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
/** @author fuj1n
|
||||
/**
|
||||
* @author fuj1n
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -32,7 +33,7 @@ public class GlassBlockConnected extends MantleBlock
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
//For FMP support
|
||||
// For FMP support
|
||||
public IIcon[] getIcons ()
|
||||
{
|
||||
return icons;
|
||||
@@ -58,11 +59,18 @@ public class GlassBlockConnected extends MantleBlock
|
||||
|
||||
/**
|
||||
* This is checked to see if the texture should connect to this block
|
||||
* @param par2 x
|
||||
* @param par3 y
|
||||
* @param par4 z
|
||||
* @param par5 ID this block is asking to connect to (may be 0 if there is no block)
|
||||
* @param par6 Metadata of the block this block is trying to connect to
|
||||
*
|
||||
* @param par2
|
||||
* x
|
||||
* @param par3
|
||||
* y
|
||||
* @param par4
|
||||
* z
|
||||
* @param par5
|
||||
* ID this block is asking to connect to (may be 0 if there is no
|
||||
* block)
|
||||
* @param par6
|
||||
* Metadata of the block this block is trying to connect to
|
||||
* @return true if should connect
|
||||
*/
|
||||
public boolean shouldConnectToBlock (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, Block par5, int par6)
|
||||
|
||||
@@ -12,8 +12,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
/** @author fuj1n
|
||||
*
|
||||
/**
|
||||
* @author fuj1n
|
||||
*
|
||||
*/
|
||||
|
||||
public class GlassBlockConnectedMeta extends GlassBlockConnected
|
||||
|
||||
@@ -686,11 +686,11 @@ public class GlassPaneConnected extends GlassBlockConnected
|
||||
@Override
|
||||
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
// if(par5 == 0 || par5 == 1){
|
||||
// return par1IBlockAccess.getBlock(par2, par3, par4) != this.blockID;
|
||||
// }else{
|
||||
// return true;
|
||||
// }
|
||||
// if(par5 == 0 || par5 == 1){
|
||||
// return par1IBlockAccess.getBlock(par2, par3, par4) != this.blockID;
|
||||
// }else{
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ public class GlassPaneStained extends PaneBase
|
||||
public GlassPaneStained()
|
||||
{
|
||||
super(Material.glass, "glass/", assembleBlockTextures());
|
||||
//TODO setHardness
|
||||
// TODO setHardness
|
||||
this.setHardness(0.3F);
|
||||
this.stepSound = soundTypeGlass;
|
||||
this.setBlockName("tconstruct.glasspanestained");
|
||||
|
||||
@@ -22,7 +22,7 @@ public class GravelOre extends BlockFalling
|
||||
super();
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
this.stepSound = soundTypeGravel;
|
||||
//this.blockMaterial = Material.craftedSnow;
|
||||
// this.blockMaterial = Material.craftedSnow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,15 +54,17 @@ public class GravelOre extends BlockFalling
|
||||
@Override
|
||||
public int damageDropped (int meta)
|
||||
{
|
||||
/*if (meta == 1)
|
||||
return 0;*/
|
||||
/*
|
||||
* if (meta == 1) return 0;
|
||||
*/
|
||||
return meta;
|
||||
}
|
||||
|
||||
public Block idDropped (int par1, Random par2Random, int par3)
|
||||
{
|
||||
/*if (par1 == 1)
|
||||
return Item.goldNugget.itemID;*/
|
||||
/*
|
||||
* if (par1 == 1) return Item.goldNugget.itemID;
|
||||
*/
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.LavaTankLogic;
|
||||
import tconstruct.client.block.TankRender;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
@@ -91,11 +90,11 @@ public class LavaTankBlock extends BlockContainer
|
||||
@Override
|
||||
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
//if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
|
||||
//return super.shouldSideBeRendered(world, x, y, z, side);
|
||||
// if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
|
||||
// return super.shouldSideBeRendered(world, x, y, z, side);
|
||||
Block bID = world.getBlock(x, y, z);
|
||||
return bID == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
|
||||
//return true;
|
||||
// return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,11 +106,9 @@ public class LavaTankBlock extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}*/
|
||||
/*
|
||||
* @Override public int getRenderBlockPass() { return 1; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
@@ -159,38 +156,10 @@ public class LavaTankBlock extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated (World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
/**ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
|
||||
LavaTankLogic tank = (LavaTankLogic) world.getTileEntity(i, j, k);
|
||||
|
||||
if (liquid != null)
|
||||
{
|
||||
int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
|
||||
if (qty != 0 && !entityplayer.capabilities.isCreativeMode)
|
||||
{
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
if (current != null)
|
||||
{
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
//FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
TConstruct.logger.error(liquid);
|
||||
LavaTankLogic logic = (LavaTankLogic) world.getTileEntity(i, j, k);
|
||||
if (liquid != null)
|
||||
{
|
||||
@@ -208,7 +177,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
else if (FluidContainerRegistry.isBucket(current))
|
||||
{
|
||||
FluidTankInfo[] tanks = logic.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
FluidStack fillFluid = tanks[0].fluid;//getFluid();
|
||||
FluidStack fillFluid = tanks[0].fluid;// getFluid();
|
||||
ItemStack fillStack = FluidContainerRegistry.fillFluidContainer(fillFluid, current);
|
||||
if (fillStack != null)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MeatBlock extends BlockWood
|
||||
{
|
||||
this.setHardness(1.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
//setBurnProperties(this.blockID, 5, 20);
|
||||
// setBurnProperties(this.blockID, 5, 20);
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MeatBlock extends BlockWood
|
||||
int orientation = metadata / 4;
|
||||
|
||||
switch (orientation)
|
||||
//Ends of logs
|
||||
// Ends of logs
|
||||
{
|
||||
case 0:
|
||||
if (side == 0 || side == 1)
|
||||
@@ -73,7 +73,8 @@ public class MeatBlock extends BlockWood
|
||||
}
|
||||
|
||||
/**
|
||||
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
|
||||
* ejects contained items into the world, and notifies neighbours of an
|
||||
* update, as appropriate
|
||||
*/
|
||||
public void breakBlock (World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
@@ -101,7 +102,8 @@ public class MeatBlock extends BlockWood
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
||||
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
|
||||
* side, hitX, hitY, hitZ, block metadata
|
||||
*/
|
||||
public int onBlockPlaced (World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
|
||||
{
|
||||
@@ -127,7 +129,8 @@ public class MeatBlock extends BlockWood
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the damage on the item the block drops. Used in cloth and wood.
|
||||
* Determines the damage on the item the block drops. Used in cloth and
|
||||
* wood.
|
||||
*/
|
||||
public int damageDropped (int par1)
|
||||
{
|
||||
@@ -152,16 +155,12 @@ public class MeatBlock extends BlockWood
|
||||
return false;
|
||||
}
|
||||
|
||||
/*public void onBlockHarvested (World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
if (meta % 4 == 1)
|
||||
{
|
||||
if (world.difficultySetting > 2)
|
||||
world.createExplosion(null, x, y, z, 1.75f, false);
|
||||
else
|
||||
world.createExplosion(null, x, y, z, 2f, false);
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
* public void onBlockHarvested (World world, int x, int y, int z, int meta,
|
||||
* EntityPlayer player) { if (meta % 4 == 1) { if (world.difficultySetting >
|
||||
* 2) world.createExplosion(null, x, y, z, 1.75f, false); else
|
||||
* world.createExplosion(null, x, y, z, 2f, false); } }
|
||||
*/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -171,17 +170,17 @@ public class MeatBlock extends BlockWood
|
||||
par3List.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean canSustainLeaves (World world, int x, int y, int z)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// @Override
|
||||
// public boolean canSustainLeaves (World world, int x, int y, int z)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isWood (World world, int x, int y, int z)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// @Override
|
||||
// public boolean isWood (World world, int x, int y, int z)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public boolean isBeaconBase (World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MetalOre extends TConstructBlock
|
||||
return 10f;
|
||||
else
|
||||
return 3f;
|
||||
//return this.blockHardness;
|
||||
// return this.blockHardness;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -110,7 +110,7 @@ public class MultiBrick extends TConstructBlock
|
||||
}
|
||||
}
|
||||
|
||||
//TODO getCollisionBoundingBoxFromPool
|
||||
// TODO getCollisionBoundingBoxFromPool
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z)
|
||||
{
|
||||
@@ -120,11 +120,9 @@ public class MultiBrick extends TConstructBlock
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return BrickRender.model;
|
||||
}*/
|
||||
/*
|
||||
* @Override public int getRenderType () { return BrickRender.model; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube (IBlockAccess world, int x, int y, int z)
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MultiBrickFancy extends TConstructBlock
|
||||
super(Material.rock, 3f, blockTextures);
|
||||
}
|
||||
|
||||
//TODO getBlockHardness
|
||||
// TODO getBlockHardness
|
||||
@Override
|
||||
public float getBlockHardness (World world, int x, int y, int z)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ public class MultiBrickFancy extends TConstructBlock
|
||||
}
|
||||
}
|
||||
|
||||
//TODO onEntityCollidedWithBlock
|
||||
// TODO onEntityCollidedWithBlock
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
@@ -126,11 +126,9 @@ public class MultiBrickFancy extends TConstructBlock
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return BrickRender.model;
|
||||
}*/
|
||||
/*
|
||||
* @Override public int getRenderType () { return BrickRender.model; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube (IBlockAccess world, int x, int y, int z)
|
||||
@@ -138,14 +136,14 @@ public class MultiBrickFancy extends TConstructBlock
|
||||
return world.getBlockMetadata(x, y, z) != 8;
|
||||
}
|
||||
|
||||
//TODO canProvidePower
|
||||
// TODO canProvidePower
|
||||
@Override
|
||||
public boolean canProvidePower ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO isProvindingWeakPower
|
||||
// TODO isProvindingWeakPower
|
||||
@Override
|
||||
public int isProvidingWeakPower (IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
|
||||
@@ -199,8 +199,9 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
|
||||
@Override
|
||||
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
/*if (world.isRemote)
|
||||
return false;*/
|
||||
/*
|
||||
* if (world.isRemote) return false;
|
||||
*/
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta >= 12)
|
||||
@@ -258,7 +259,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
|
||||
return;
|
||||
}
|
||||
|
||||
if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8)
|
||||
if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <=
|
||||
// 8)
|
||||
{
|
||||
if (world.getFullBlockLightValue(x, y, z) < 10)
|
||||
{
|
||||
@@ -268,10 +270,10 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
|
||||
world.setBlock(x, y, z, this, meta + 4, 3);
|
||||
}
|
||||
}
|
||||
/*else if (meta < 8)
|
||||
{
|
||||
world.setBlock(x, y, z, blockID, meta + 4, 3);
|
||||
}*/
|
||||
/*
|
||||
* else if (meta < 8) { world.setBlock(x, y, z, blockID, meta + 4,
|
||||
* 3); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +292,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
* returns a list of items with the same ID, but different meta (eg: dye
|
||||
* returns 16 items)
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,8 @@ public class OreberryBushEssence extends OreberryBush implements IPlantable
|
||||
return;
|
||||
}
|
||||
|
||||
if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8)
|
||||
if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <=
|
||||
// 8)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (world.getFullBlockLightValue(x, y, z) < 10 || meta % 4 == 1)
|
||||
@@ -33,18 +34,19 @@ public class OreberryBushEssence extends OreberryBush implements IPlantable
|
||||
world.setBlock(x, y, z, (Block) this, meta + 4, 3);
|
||||
}
|
||||
}
|
||||
/*else if (meta < 8)
|
||||
{
|
||||
world.setBlock(x, y, z, blockID, meta + 4, 3);
|
||||
}*/
|
||||
/*
|
||||
* else if (meta < 8) { world.setBlock(x, y, z, blockID, meta + 4,
|
||||
* 3); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt (World world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
/*if (world.getFullBlockLightValue(x, y, z) < 13)
|
||||
return super.canPlaceBlockAt(world, x, y, z);
|
||||
return false;*/
|
||||
/*
|
||||
* if (world.getFullBlockLightValue(x, y, z) < 13) return
|
||||
* super.canPlaceBlockAt(world, x, y, z); return false;
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -182,12 +182,12 @@ public class SearedBlock extends InventoryBlock
|
||||
public void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack)
|
||||
{
|
||||
AbilityHelper.spawnItemAtPlayer(player, stack);
|
||||
/*if (!world.isRemote)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack);
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
}*/
|
||||
/*
|
||||
* if (!world.isRemote) { EntityItem entityitem = new EntityItem(world,
|
||||
* (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack);
|
||||
* world.spawnEntityInWorld(entityitem);
|
||||
* entityitem.onCollideWithPlayer(player); }
|
||||
*/
|
||||
}
|
||||
|
||||
/* Rendering */
|
||||
@@ -211,7 +211,7 @@ public class SearedBlock extends InventoryBlock
|
||||
return textureNames;
|
||||
}
|
||||
|
||||
//TODO getIcon
|
||||
// TODO getIcon
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SearedSlab extends SlabBase
|
||||
{
|
||||
public SearedSlab()
|
||||
{
|
||||
//TODO material.rock
|
||||
// TODO material.rock
|
||||
super(Material.rock);
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
setHardness(12F);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 0) //Smeltery
|
||||
if (meta == 0) // Smeltery
|
||||
{
|
||||
if (side == direction)
|
||||
{
|
||||
@@ -114,7 +114,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
return icons[0];
|
||||
}
|
||||
}
|
||||
if (meta == 1) //Drain
|
||||
if (meta == 1) // Drain
|
||||
{
|
||||
if (side == direction)
|
||||
return icons[5];
|
||||
@@ -136,11 +136,9 @@ public class SmelteryBlock extends InventoryBlock
|
||||
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}*/
|
||||
/*
|
||||
* @Override public int getRenderBlockPass() { return 1; }
|
||||
*/
|
||||
|
||||
public int damageDropped (int meta)
|
||||
{
|
||||
@@ -155,7 +153,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
//return -1;
|
||||
// return -1;
|
||||
return TConstruct.proxy.smelteryGuiID;
|
||||
}
|
||||
|
||||
@@ -221,7 +219,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
}
|
||||
else
|
||||
{
|
||||
//world.markBlockForUpdate(x, y, z);
|
||||
// world.markBlockForUpdate(x, y, z);
|
||||
player.openGui(getModInstance(), integer, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@@ -244,7 +242,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
else
|
||||
return new SmelteryDrainLogic();
|
||||
case 3:
|
||||
return null; //Furnace
|
||||
return null; // Furnace
|
||||
}
|
||||
return new MultiServantLogic();
|
||||
}
|
||||
@@ -263,11 +261,11 @@ public class SmelteryBlock extends InventoryBlock
|
||||
logic.checkValidPlacement();
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void breakBlock (World world, int x, int y, int z, int par5, int par6) //Don't drop inventory
|
||||
{
|
||||
world.removeBlockTileEntity(x, y, z);
|
||||
}*/
|
||||
/*
|
||||
* @Override public void breakBlock (World world, int x, int y, int z, int
|
||||
* par5, int par6) //Don't drop inventory { world.removeBlockTileEntity(x,
|
||||
* y, z); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item id, CreativeTabs tab, List list)
|
||||
@@ -283,7 +281,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
@Override
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block nBlockID)
|
||||
{
|
||||
//System.out.println("Neighbor changed");
|
||||
// System.out.println("Neighbor changed");
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
if (logic instanceof IServantLogic)
|
||||
{
|
||||
|
||||
@@ -61,12 +61,10 @@ public class SoilBlock extends TConstructBlock
|
||||
return Blocks.soul_sand.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
/*public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
if (world.getBlockMetadata(x, y, z) >= 3)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.875F, 1.0F);
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
* public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y,
|
||||
* int z) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); if
|
||||
* (world.getBlockMetadata(x, y, z) >= 3) { this.setBlockBounds(0.0F, 0.0F,
|
||||
* 0.0F, 1.0F, 0.875F, 1.0F); } }
|
||||
*/
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class SoilSlab extends SlabBase
|
||||
switch (meta % 8)
|
||||
{
|
||||
case 0:
|
||||
return this.blockIcon;//Block.grass.getIcon(1, 0);
|
||||
return this.blockIcon;// Block.grass.getIcon(1, 0);
|
||||
case 1:
|
||||
return Blocks.dirt.getIcon(side, 0);
|
||||
case 2:
|
||||
@@ -70,9 +70,9 @@ public class SoilSlab extends SlabBase
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor (int par1)
|
||||
{
|
||||
//if (par1 % 8 == 0)
|
||||
// if (par1 % 8 == 0)
|
||||
return this.getBlockColor();
|
||||
//return 0xFFFFFF;
|
||||
// return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SpeedBlock extends TConstructBlock
|
||||
public SpeedBlock()
|
||||
{
|
||||
super(Material.rock, 3.0f, textureNames);
|
||||
//this.setBlockBounds(0f, 0f, 0f, 1.0f, 0.5f, 1.0f);
|
||||
// this.setBlockBounds(0f, 0f, 0f, 1.0f, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,8 +30,8 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||
* cleared to be reused)
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this
|
||||
* box can change after the pool has been cleared to be reused)
|
||||
*/
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -39,8 +39,9 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether
|
||||
* or not to render the shared face of two adjacent blocks and also whether
|
||||
* the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube ()
|
||||
{
|
||||
@@ -48,7 +49,8 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
* If this block doesn't render as an ordinary block it will return False
|
||||
* (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock ()
|
||||
{
|
||||
@@ -80,7 +82,8 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
||||
* Checks to see if its valid to put this block at the specified
|
||||
* coordinates. Args: world, x, y, z
|
||||
*/
|
||||
public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -89,7 +92,8 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
||||
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
|
||||
* side, hitX, hitY, hitZ, block metadata
|
||||
*/
|
||||
public int onBlockPlaced (World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
|
||||
{
|
||||
@@ -154,8 +158,9 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor blockID
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
||||
* neighbor changed (coordinates passed are their own) Args: x, y, z,
|
||||
* neighbor blockID
|
||||
*/
|
||||
public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
@@ -211,8 +216,9 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns
|
||||
* True if it can stay and False if it drops. Args: world, x, y, z
|
||||
* Tests if the block can remain at its current location and will drop as an
|
||||
* item if it is unable to stay. Returns True if it can stay and False if it
|
||||
* drops. Args: world, x, y, z
|
||||
*/
|
||||
protected boolean dropTorchIfCantStay (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -233,8 +239,8 @@ public class StoneTorch extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
|
||||
* x, y, z, startVec, endVec
|
||||
* Ray traces through the blocks collision from start vector to end vector
|
||||
* returning a ray trace hit. Args: world, x, y, z, startVec, endVec
|
||||
*/
|
||||
public MovingObjectPosition collisionRayTrace (World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TConstructBlock extends MantleBlock
|
||||
return 1;
|
||||
}
|
||||
|
||||
//TODO getSubBlocks
|
||||
// TODO getSubBlocks
|
||||
@Override
|
||||
public void getSubBlocks (Item block, CreativeTabs tab, List list)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
{
|
||||
super(fluid, material);
|
||||
this.texture = texture;
|
||||
//TODO setCreativeTab()
|
||||
// TODO setCreativeTab()
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
return alpha ? 1 : 0;
|
||||
}
|
||||
|
||||
//TODO registerBlockIcons
|
||||
// TODO registerBlockIcons
|
||||
@Override
|
||||
public void registerBlockIcons (IIconRegister iconRegister)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
flowIcon = iconRegister.registerIcon("tinker:" + texture + "_flow");
|
||||
}
|
||||
|
||||
//TODO getIcon()
|
||||
// TODO getIcon()
|
||||
@Override
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
|
||||
@@ -2,16 +2,6 @@ package tconstruct.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.PartBuilderLogic;
|
||||
import tconstruct.blocks.logic.PatternChestLogic;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import tconstruct.client.block.TableRender;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import mantle.blocks.abstracts.InventoryBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -26,6 +16,15 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.PartBuilderLogic;
|
||||
import tconstruct.blocks.logic.PatternChestLogic;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import tconstruct.client.block.TableRender;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class ToolStationBlock extends InventoryBlock
|
||||
{
|
||||
@@ -37,7 +36,7 @@ public class ToolStationBlock extends InventoryBlock
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
//Block.hasComparatorInputOverride and Block.getComparatorInputOverride
|
||||
// Block.hasComparatorInputOverride and Block.getComparatorInputOverride
|
||||
|
||||
/* Rendering */
|
||||
@Override
|
||||
@@ -151,8 +150,9 @@ public class ToolStationBlock extends InventoryBlock
|
||||
return new StencilTableLogic();
|
||||
case 13:
|
||||
return new StencilTableLogic();
|
||||
/*case 14:
|
||||
return new CastingTableLogic();*/
|
||||
/*
|
||||
* case 14: return new CastingTableLogic();
|
||||
*/
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class ToolStationBlock extends InventoryBlock
|
||||
else
|
||||
return 3;
|
||||
|
||||
//return -1;
|
||||
// return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,8 +43,9 @@ public class SmelteryComponent extends LogicComponent
|
||||
|
||||
public void update ()
|
||||
{
|
||||
/*if (useTime > 0 && inUse)
|
||||
useTime -= 3;*/
|
||||
/*
|
||||
* if (useTime > 0 && inUse) useTime -= 3;
|
||||
*/
|
||||
if (activeTemps.length == 0)
|
||||
inUse = false;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class SmelteryScan extends TankLayerScan
|
||||
}
|
||||
}
|
||||
|
||||
//Sync lava tanks for fuel values
|
||||
// Sync lava tanks for fuel values
|
||||
@Override
|
||||
public void readNetworkNBT (NBTTagCompound tags)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandler, IFacingLogic//, ISwitchableMaster
|
||||
public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandler, IFacingLogic// , ISwitchableMaster
|
||||
{
|
||||
byte direction;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
|
||||
// TConstruct.logger.info("Found master");
|
||||
// TConstruct.logger.info("Found master");
|
||||
return smeltery.drain(from, maxDrain, doDrain);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -138,7 +138,8 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
//System.out.println("Notifying of change from "+new CoordTuple(x, y, z));
|
||||
// System.out.println("Notifying of change from "+new CoordTuple(x,
|
||||
// y, z));
|
||||
recheckStructure = true;
|
||||
}
|
||||
}
|
||||
@@ -294,21 +295,22 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
|
||||
static final int pixelLayer = 162;
|
||||
|
||||
//Do the Monster Mash~
|
||||
// Do the Monster Mash~
|
||||
public void distributeFluids ()
|
||||
{
|
||||
//Calculate liquids in each block
|
||||
// Calculate liquids in each block
|
||||
int size = structure.getAirLayerSize();
|
||||
//HashMap<CoordTuple, LiquidDataInstance> blocks = new HashMap<CoordTuple, LiquidDataInstance>();
|
||||
// HashMap<CoordTuple, LiquidDataInstance> blocks = new
|
||||
// HashMap<CoordTuple, LiquidDataInstance>();
|
||||
|
||||
for (FluidStack fluid : multitank.fluidlist)
|
||||
{
|
||||
//Base calculations per liquid
|
||||
// Base calculations per liquid
|
||||
LiquidData data = new LiquidData(fluid.amount, size);
|
||||
int baseY = structure.airCoords.get(0).y;
|
||||
int layerSize = structure.getAirLayerSize();
|
||||
|
||||
//Calculate where to distribute liquids
|
||||
// Calculate where to distribute liquids
|
||||
for (int i = 0; i < structure.airCoords.size(); i++)
|
||||
{
|
||||
LiquidDataInstance instance;
|
||||
@@ -326,32 +328,35 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
instance = airUpdates.get(coord);
|
||||
}
|
||||
|
||||
if (instance.openLayers() > 0) //This is capable of sending negative liquid sizes to blocks without the stopgap check
|
||||
if (instance.openLayers() > 0) // This is capable of sending
|
||||
// negative liquid sizes to
|
||||
// blocks without the stopgap
|
||||
// check
|
||||
{
|
||||
if (position > data.blocksWithExtra)
|
||||
{
|
||||
//Calculate open layers
|
||||
// Calculate open layers
|
||||
int open = data.layers - height + 1;
|
||||
if (open < 1) //Temporary stopgap check
|
||||
if (open < 1) // Temporary stopgap check
|
||||
continue;
|
||||
if (open > instance.openLayers())
|
||||
open = instance.openLayers();
|
||||
|
||||
//Copy fluid
|
||||
// Copy fluid
|
||||
FluidStack newFluid = fluid.copy();
|
||||
newFluid.amount = pixelLayer * open;
|
||||
instance.addFluid(open, newFluid);
|
||||
|
||||
//Subtract from total
|
||||
// Subtract from total
|
||||
data.totalAmount -= newFluid.amount;
|
||||
if (data.totalAmount <= 0)
|
||||
break;
|
||||
}
|
||||
else if (position == data.blocksWithExtra && data.leftovers > 0)
|
||||
{
|
||||
//Calculate open layers
|
||||
// Calculate open layers
|
||||
int open = data.layers - height + 1;
|
||||
if (open < 1) //Temporary stopgap check
|
||||
if (open < 1) // Temporary stopgap check
|
||||
continue;
|
||||
boolean full = false;
|
||||
if (open > instance.openLayers())
|
||||
@@ -360,33 +365,33 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
full = true;
|
||||
}
|
||||
|
||||
//Copy fluid
|
||||
// Copy fluid
|
||||
FluidStack newFluid = fluid.copy();
|
||||
newFluid.amount = pixelLayer * open;
|
||||
if (!full)
|
||||
newFluid.amount += data.leftovers;
|
||||
instance.addFluid(open, newFluid);
|
||||
|
||||
//Subtract from total
|
||||
// Subtract from total
|
||||
data.totalAmount -= newFluid.amount;
|
||||
if (data.totalAmount <= 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Calculate open layers
|
||||
// Calculate open layers
|
||||
int open = data.layers - height;
|
||||
if (open < 1) //Temporary stopgap check
|
||||
if (open < 1) // Temporary stopgap check
|
||||
continue;
|
||||
if (open > instance.openLayers())
|
||||
open = instance.openLayers();
|
||||
|
||||
//Copy fluid
|
||||
// Copy fluid
|
||||
FluidStack newFluid = fluid.copy();
|
||||
newFluid.amount = pixelLayer * open;
|
||||
instance.addFluid(open, newFluid);
|
||||
|
||||
//Subtract from total
|
||||
// Subtract from total
|
||||
data.totalAmount -= newFluid.amount;
|
||||
if (data.totalAmount <= 0)
|
||||
break;
|
||||
@@ -395,7 +400,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
}
|
||||
}
|
||||
|
||||
//Distribute liquids to each block
|
||||
// Distribute liquids to each block
|
||||
}
|
||||
|
||||
protected void updateFluidBlocks ()
|
||||
|
||||
@@ -2,43 +2,27 @@ package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class AqueductLogic extends TileEntity //implements ITankContainer
|
||||
public class AqueductLogic extends TileEntity // implements ITankContainer
|
||||
{
|
||||
|
||||
/*@Override
|
||||
public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill (int tankIndex, FluidStack resource, boolean doFill)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain (int tankIndex, int maxDrain, boolean doDrain)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILiquidTank[] getTanks (ForgeDirection direction)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILiquidTank getTank (ForgeDirection direction, FluidStack type)
|
||||
{
|
||||
return null;
|
||||
}*/
|
||||
/*
|
||||
* @Override public int fill (ForgeDirection from, FluidStack resource,
|
||||
* boolean doFill) { return 0; }
|
||||
*
|
||||
* @Override public int fill (int tankIndex, FluidStack resource, boolean
|
||||
* doFill) { return 0; }
|
||||
*
|
||||
* @Override public FluidStack drain (ForgeDirection from, int maxDrain,
|
||||
* boolean doDrain) { return null; }
|
||||
*
|
||||
* @Override public FluidStack drain (int tankIndex, int maxDrain, boolean
|
||||
* doDrain) { return null; }
|
||||
*
|
||||
* @Override public ILiquidTank[] getTanks (ForgeDirection direction) {
|
||||
* return null; }
|
||||
*
|
||||
* @Override public ILiquidTank getTank (ForgeDirection direction,
|
||||
* FluidStack type) { return null; }
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -43,19 +43,19 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName () //Not a gui block
|
||||
public String getInvName () // Not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultName () //Still not a gui block
|
||||
public String getDefaultName () // Still not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) //Definitely not a gui block
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) // Definitely not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
return this.capacity;
|
||||
}
|
||||
|
||||
public int updateCapacity () //Only used to initialize
|
||||
public int updateCapacity () // Only used to initialize
|
||||
{
|
||||
int ret = TConstruct.ingotLiquidValue;
|
||||
|
||||
@@ -156,7 +156,9 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
else if (resource.isFluidEqual(this.liquid))
|
||||
{
|
||||
if (resource.amount + this.liquid.amount >= this.capacity) //Start timer here
|
||||
if (resource.amount + this.liquid.amount >= this.capacity) // Start
|
||||
// timer
|
||||
// here
|
||||
{
|
||||
int roomInTank = this.capacity - liquid.amount;
|
||||
if (doFill && roomInTank > 0)
|
||||
@@ -189,7 +191,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty () //Isn't actually called?
|
||||
public void markDirty () // Isn't actually called?
|
||||
{
|
||||
super.markDirty();
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
@@ -220,7 +222,8 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
liquid.amount -= used;
|
||||
}
|
||||
|
||||
FluidStack drained = liquid.copy();//new FluidStack(liquid.itemID, used, liquid.itemMeta);
|
||||
FluidStack drained = liquid.copy();// new FluidStack(liquid.itemID,
|
||||
// used, liquid.itemMeta);
|
||||
drained.amount = used;
|
||||
|
||||
// Reset liquid if emptied
|
||||
@@ -238,9 +241,9 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
@Override
|
||||
public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
//if (from == ForgeDirection.UP)
|
||||
// if (from == ForgeDirection.UP)
|
||||
return fill(resource, doFill);
|
||||
//return 0;
|
||||
// return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,7 +306,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
{
|
||||
if (castingDelay > 0)
|
||||
{
|
||||
//TConstruct.logger.info("Casting");
|
||||
// TConstruct.logger.info("Casting");
|
||||
castingDelay--;
|
||||
if (castingDelay == 0)
|
||||
castLiquid();
|
||||
@@ -351,8 +354,9 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
{
|
||||
this.liquid = FluidStack.loadFluidStackFromNBT(tags.getCompoundTag("Fluid"));
|
||||
}
|
||||
//FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt);
|
||||
//this.liquid = new FluidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta"));
|
||||
// FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt);
|
||||
// this.liquid = new FluidStack(tags.getInteger("itemID"),
|
||||
// tags.getInteger("amount"), tags.getInteger("itemMeta"));
|
||||
else
|
||||
this.liquid = null;
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
if (this.pullingLiquids)
|
||||
pullLiquids();
|
||||
}
|
||||
//this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
// this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||
// this.zCoord);
|
||||
if (ticks == 20)
|
||||
{
|
||||
if (recentlyFilledDelay != 0)
|
||||
@@ -122,7 +123,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
HashMap tankMap = this.getOutputs();
|
||||
if (tankMap.size() <= 0)
|
||||
{
|
||||
//TConstruct.logger.info("Nope, no connections to go to");
|
||||
// TConstruct.logger.info("Nope, no connections to go to");
|
||||
return;
|
||||
}
|
||||
boolean yFilled = false;
|
||||
@@ -212,7 +213,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
HashMap tankMap = this.getOutputs();
|
||||
if (tankMap.size() <= 0)
|
||||
{
|
||||
//TConstruct.logger.info("Nope, no connections to go to");
|
||||
// TConstruct.logger.info("Nope, no connections to go to");
|
||||
return;
|
||||
}
|
||||
boolean yFilled = false;
|
||||
@@ -628,7 +629,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
@Override
|
||||
public void setActive (boolean flag)
|
||||
{
|
||||
//pullingLiquids = flag;
|
||||
// pullingLiquids = flag;
|
||||
pullingLiquids = !pullingLiquids;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -20,6 +17,9 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFluidHandler, ISidedInventory
|
||||
{
|
||||
@@ -43,19 +43,19 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName () //Not a gui block
|
||||
public String getInvName () // Not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultName () //Still not a gui block
|
||||
protected String getDefaultName () // Still not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) //Definitely not a gui block
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) // Definitely not a gui block
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
return this.capacity;
|
||||
}
|
||||
|
||||
public int updateCapacity () //Only used to initialize
|
||||
public int updateCapacity () // Only used to initialize
|
||||
{
|
||||
int ret = TConstruct.ingotLiquidValue;
|
||||
|
||||
@@ -156,7 +156,9 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
else if (resource.isFluidEqual(this.liquid))
|
||||
{
|
||||
if (resource.amount + this.liquid.amount >= this.capacity) //Start timer here
|
||||
if (resource.amount + this.liquid.amount >= this.capacity) // Start
|
||||
// timer
|
||||
// here
|
||||
{
|
||||
int roomInTank = this.capacity - liquid.amount;
|
||||
if (doFill && roomInTank > 0)
|
||||
@@ -189,7 +191,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty () //Isn't actually called?
|
||||
public void markDirty () // Isn't actually called?
|
||||
{
|
||||
super.markDirty();
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
@@ -220,7 +222,8 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
liquid.amount -= used;
|
||||
}
|
||||
|
||||
FluidStack drained = liquid.copy();//new FluidStack(liquid.itemID, used, liquid.itemMeta);
|
||||
FluidStack drained = liquid.copy();// new FluidStack(liquid.itemID,
|
||||
// used, liquid.itemMeta);
|
||||
drained.amount = used;
|
||||
|
||||
// Reset liquid if emptied
|
||||
@@ -238,9 +241,9 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
@Override
|
||||
public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
//if (from == ForgeDirection.UP)
|
||||
// if (from == ForgeDirection.UP)
|
||||
return fill(resource, doFill);
|
||||
//return 0;
|
||||
// return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,7 +307,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
{
|
||||
if (castingDelay > 0)
|
||||
{
|
||||
//TConstruct.logger.info("Casting");
|
||||
// TConstruct.logger.info("Casting");
|
||||
castingDelay--;
|
||||
if (castingDelay == 0)
|
||||
castLiquid();
|
||||
@@ -425,7 +428,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ import tconstruct.inventory.CraftingStationContainer;
|
||||
|
||||
public class CraftingStationLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
public WeakReference<IInventory> chest; //TODO: These are prototypes
|
||||
public WeakReference<IInventory> chest; // TODO: These are prototypes
|
||||
public WeakReference<IInventory> doubleChest;
|
||||
public WeakReference<IInventory> patternChest;
|
||||
public WeakReference<IInventory> furnace;
|
||||
@@ -25,7 +25,8 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
|
||||
public CraftingStationLogic()
|
||||
{
|
||||
super(17); //9 for crafting, 1 for output, 6 for extensions, 1 for plans
|
||||
super(17); // 9 for crafting, 1 for output, 6 for extensions, 1 for
|
||||
// plans
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +61,7 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new CraftingStationContainer(inventoryplayer, this, x, y, z);
|
||||
}
|
||||
|
||||
@@ -101,7 +102,7 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
@Override
|
||||
public void setDirection (int side)
|
||||
{
|
||||
//direction = (byte) side;
|
||||
// direction = (byte) side;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -88,7 +88,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
fuel = fuelGague = (int) (getItemBurnTime(inventory[1]) * 2.5);
|
||||
if (fuel > 0)
|
||||
{
|
||||
if (inventory[1].getItem().hasContainerItem()) //Fuel slot
|
||||
if (inventory[1].getItem().hasContainerItem()) // Fuel slot
|
||||
{
|
||||
inventory[1] = new ItemStack(inventory[1].getItem().getContainerItem());
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
if (!canCook())
|
||||
return;
|
||||
|
||||
for (int id = 2; id < 10; id++) //Check every slot
|
||||
for (int id = 2; id < 10; id++) // Check every slot
|
||||
{
|
||||
if (canCook())
|
||||
{
|
||||
@@ -146,7 +146,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
{
|
||||
int ids = 2;
|
||||
boolean placed = false;
|
||||
while (ids < 10 && !placed) //Try to merge stacks first
|
||||
while (ids < 10 && !placed) // Try to merge stacks first
|
||||
{
|
||||
if (inventory[ids] != null && inventory[ids].isItemEqual(result) && inventory[ids].stackSize < inventory[ids].getMaxStackSize())
|
||||
{
|
||||
@@ -166,7 +166,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
}
|
||||
|
||||
ids = 2;
|
||||
while (!placed && ids < 10) //Place remaining in slot
|
||||
while (!placed && ids < 10) // Place remaining in slot
|
||||
{
|
||||
if (inventory[ids] == null)
|
||||
{
|
||||
@@ -187,11 +187,11 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
{
|
||||
for (int id = 2; id < 10; id++)
|
||||
{
|
||||
if (inventory[id] == null) //Nothing here!
|
||||
if (inventory[id] == null) // Nothing here!
|
||||
continue;
|
||||
|
||||
ItemStack result = getResultFor(inventory[id]);
|
||||
if (result == null) //Doesn't cook into anything
|
||||
if (result == null) // Doesn't cook into anything
|
||||
continue;
|
||||
|
||||
for (int slotid = 2; slotid < 10; slotid++)
|
||||
@@ -214,7 +214,9 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
public ItemStack getResultFor (ItemStack stack)
|
||||
{
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack);
|
||||
if (result != null && result.getItem() instanceof ItemFood) //Only valid for food
|
||||
if (result != null && result.getItem() instanceof ItemFood) // Only
|
||||
// valid for
|
||||
// food
|
||||
return result.copy();
|
||||
|
||||
return null;
|
||||
@@ -304,14 +306,10 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
return true;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean canDropInventorySlot(int slot)
|
||||
{
|
||||
if (slot == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}*/
|
||||
/*
|
||||
* @Override public boolean canDropInventorySlot(int slot) { if (slot == 0)
|
||||
* return false; else return true; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void openInventory ()
|
||||
|
||||
@@ -98,7 +98,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
fuel = fuelGague = (int) (getItemBurnTime(inventory[1]));
|
||||
if (fuel > 0)
|
||||
{
|
||||
if (inventory[1].getItem().hasContainerItem()) //Fuel slot
|
||||
if (inventory[1].getItem().hasContainerItem()) // Fuel slot
|
||||
{
|
||||
inventory[1] = new ItemStack(inventory[1].getItem().getContainerItem());
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
|
||||
public boolean canSmelt ()
|
||||
{
|
||||
if (inventory[0] == null) //Nothing here!
|
||||
if (inventory[0] == null) // Nothing here!
|
||||
return false;
|
||||
else
|
||||
{
|
||||
@@ -193,7 +193,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
public ItemStack getResultFor (ItemStack stack)
|
||||
{
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack);
|
||||
if (result != null) //Only valid for food
|
||||
if (result != null) // Only valid for food
|
||||
return result.copy();
|
||||
|
||||
return null;
|
||||
@@ -321,7 +321,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
@Deprecated
|
||||
public void setDirection (int side)
|
||||
{
|
||||
//Nope!
|
||||
// Nope!
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
@Override
|
||||
public boolean canFill (ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
//return tank.fill(fluid, false) > 0;
|
||||
// return tank.fill(fluid, false) > 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -78,17 +78,13 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
return new FluidTankInfo[] { new FluidTankInfo(fluid, tank.getCapacity()) };
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public IFluidTank[] getTanks (ForgeDirection direction)
|
||||
{
|
||||
return new IFluidTank[] { tank };
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidTank getTank (ForgeDirection direction, FluidStack type)
|
||||
{
|
||||
return tank;
|
||||
}*/
|
||||
/*
|
||||
* @Override public IFluidTank[] getTanks (ForgeDirection direction) {
|
||||
* return new IFluidTank[] { tank }; }
|
||||
*
|
||||
* @Override public IFluidTank getTank (ForgeDirection direction, FluidStack
|
||||
* type) { return tank; }
|
||||
*/
|
||||
|
||||
public float getFluidAmountScaled ()
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.PartCrafterChestContainer;
|
||||
import tconstruct.inventory.PartCrafterContainer;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -12,6 +8,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.PartCrafterChestContainer;
|
||||
import tconstruct.inventory.PartCrafterContainer;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
@@ -49,7 +49,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
return new PartCrafterContainer(inventoryplayer, this);
|
||||
}
|
||||
|
||||
//Called when emptying a slot, not when another item is placed in it
|
||||
// Called when emptying a slot, not when another item is placed in it
|
||||
public ItemStack decrStackSize (int slotID, int quantity)
|
||||
{
|
||||
ItemStack returnStack = super.decrStackSize(slotID, quantity);
|
||||
@@ -71,7 +71,8 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
int decrease = cost / value;
|
||||
if (cost % value != 0)
|
||||
decrease++;
|
||||
super.decrStackSize(2, decrease); //Call super to avoid crafting again
|
||||
super.decrStackSize(2, decrease); // Call super to avoid
|
||||
// crafting again
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +97,8 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
int decrease = cost / value;
|
||||
if (cost % value != 0)
|
||||
decrease++;
|
||||
super.decrStackSize(3, decrease); //Call super to avoid crafting again
|
||||
super.decrStackSize(3, decrease); // Call super to avoid
|
||||
// crafting again
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
buildBottomPart();
|
||||
}
|
||||
|
||||
//Called when a slot has something placed into it.
|
||||
// Called when a slot has something placed into it.
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
super.setInventorySlotContents(slot, itemstack);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.PatternChestContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.PatternChestContainer;
|
||||
|
||||
public class PatternChestLogic extends InventoryLogic
|
||||
{
|
||||
@@ -29,7 +29,7 @@ public class PatternChestLogic extends InventoryLogic
|
||||
{
|
||||
return new PatternChestContainer(inventoryplayer, this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
|
||||
@@ -15,29 +15,24 @@ public class RedwireLogic extends TileEntity
|
||||
|
||||
public void readCustomNBT (NBTTagCompound tags)
|
||||
{
|
||||
/*hasMaster = tags.getBoolean("HasMaster");
|
||||
if (hasMaster)
|
||||
{
|
||||
int xCenter = tags.getInteger("xCenter");
|
||||
int yCenter = tags.getInteger("yCenter");
|
||||
int zCenter = tags.getInteger("zCenter");
|
||||
master = new CoordTuple(xCenter, yCenter, zCenter);
|
||||
masterID = tags.getShort("MasterID");
|
||||
masterMeat = tags.getByte("masterMeat");
|
||||
}*/
|
||||
/*
|
||||
* hasMaster = tags.getBoolean("HasMaster"); if (hasMaster) { int
|
||||
* xCenter = tags.getInteger("xCenter"); int yCenter =
|
||||
* tags.getInteger("yCenter"); int zCenter = tags.getInteger("zCenter");
|
||||
* master = new CoordTuple(xCenter, yCenter, zCenter); masterID =
|
||||
* tags.getShort("MasterID"); masterMeat = tags.getByte("masterMeat"); }
|
||||
*/
|
||||
}
|
||||
|
||||
public void writeCustomNBT (NBTTagCompound tags)
|
||||
{
|
||||
/*tags.setBoolean("HasMaster", hasMaster);
|
||||
if (hasMaster)
|
||||
{
|
||||
tags.setInteger("xCenter", master.x);
|
||||
tags.setInteger("yCenter", master.y);
|
||||
tags.setInteger("zCenter", master.z);
|
||||
tags.setShort("MasterID", masterID);
|
||||
tags.setByte("masterMeat", masterMeat);
|
||||
}*/
|
||||
/*
|
||||
* tags.setBoolean("HasMaster", hasMaster); if (hasMaster) {
|
||||
* tags.setInteger("xCenter", master.x); tags.setInteger("yCenter",
|
||||
* master.y); tags.setInteger("zCenter", master.z);
|
||||
* tags.setShort("MasterID", masterID); tags.setByte("masterMeat",
|
||||
* masterMeat); }
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -69,13 +69,13 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
public boolean canFill (ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return true;
|
||||
//return from == getForgeDirection();//.getOpposite();
|
||||
// return from == getForgeDirection();//.getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain (ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
// Check that the drain is coming from the from the front of the block
|
||||
// Check that the drain is coming from the from the front of the block
|
||||
// and that the fluid to be drained is in the smeltery.
|
||||
boolean containsFluid = fluid == null;
|
||||
if (fluid != null)
|
||||
@@ -90,7 +90,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
}
|
||||
}
|
||||
}
|
||||
//return from == getForgeDirection().getOpposite() && containsFluid;
|
||||
// return from == getForgeDirection().getOpposite() && containsFluid;
|
||||
return containsFluid;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
|
||||
return smeltery.getMultiTankInfo();
|
||||
//return new FluidTankInfo[] { smeltery.getInfo() };
|
||||
// return new FluidTankInfo[] { smeltery.getInfo() };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -270,8 +270,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
/* Updating */
|
||||
public void updateEntity ()
|
||||
{
|
||||
/*if (worldObj.isRemote)
|
||||
return;*/
|
||||
/*
|
||||
* if (worldObj.isRemote) return;
|
||||
*/
|
||||
|
||||
tick++;
|
||||
if (tick % 4 == 0)
|
||||
@@ -381,13 +382,15 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
|
||||
private void handleItemEntity (EntityItem item)
|
||||
{
|
||||
// Clients like to play merry hell with this and cause breakage (we update their inv on syncs)
|
||||
// Clients like to play merry hell with this and cause breakage (we
|
||||
// update their inv on syncs)
|
||||
if (worldObj.isRemote)
|
||||
return;
|
||||
|
||||
item.age = 0;
|
||||
ItemStack istack = item.getEntityItem();
|
||||
if (istack == null || istack.stackSize <= 0) //Probably most definitely not necessary
|
||||
if (istack == null || istack.stackSize <= 0) // Probably most definitely
|
||||
// not necessary
|
||||
return;
|
||||
|
||||
int maxSlot = this.getSizeInventory();
|
||||
@@ -481,12 +484,13 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
return false;
|
||||
|
||||
currentLiquid += liquid.amount;
|
||||
//TConstruct.logger.info("Current liquid: "+currentLiquid);
|
||||
// TConstruct.logger.info("Current liquid: "+currentLiquid);
|
||||
boolean added = false;
|
||||
for (int i = 0; i < moltenMetal.size(); i++)
|
||||
{
|
||||
FluidStack l = moltenMetal.get(i);
|
||||
//if (l.itemID == liquid.itemID && l.itemMeta == liquid.itemMeta)
|
||||
// if (l.itemID == liquid.itemID && l.itemMeta ==
|
||||
// liquid.itemMeta)
|
||||
if (l.isFluidEqual(liquid))
|
||||
{
|
||||
l.amount += liquid.amount;
|
||||
@@ -559,7 +563,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
|
||||
void updateFuelGague () //TODO: Call this method when the GUI is opened
|
||||
void updateFuelGague () // TODO: Call this method when the GUI is opened
|
||||
{
|
||||
if (activeLavaTank == null || useTime > 0)
|
||||
return;
|
||||
@@ -611,18 +615,21 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
TileEntity newTankContainer = worldObj.getTileEntity(possibleTank.x, possibleTank.y, possibleTank.z);
|
||||
if (newTankContainer instanceof IFluidHandler)
|
||||
{
|
||||
//TConstruct.logger.info("Tank: "+possibleTank.toString());
|
||||
// TConstruct.logger.info("Tank: "+possibleTank.toString());
|
||||
FluidStack newliquid = ((IFluidHandler) newTankContainer).drain(ForgeDirection.UNKNOWN, 150, false);
|
||||
if (newliquid != null && newliquid.getFluid().getBlock() == Blocks.lava && newliquid.amount > 0)
|
||||
{
|
||||
//TConstruct.logger.info("Tank: "+possibleTank.toString());
|
||||
// TConstruct.logger.info("Tank: "+possibleTank.toString());
|
||||
foundTank = true;
|
||||
activeLavaTank = possibleTank;
|
||||
iter = lavaTanks.size();
|
||||
|
||||
/*IFluidTank newTank = ((IFluidHandler) newTankContainer).getTank(ForgeDirection.UNKNOWN, liquid);
|
||||
liquid = newTank.getFluid();
|
||||
int capacity = newTank.getCapacity();*/
|
||||
/*
|
||||
* IFluidTank newTank = ((IFluidHandler)
|
||||
* newTankContainer).getTank(ForgeDirection.UNKNOWN,
|
||||
* liquid); liquid = newTank.getFluid(); int
|
||||
* capacity = newTank.getCapacity();
|
||||
*/
|
||||
FluidTankInfo[] info = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN);
|
||||
liquid = info[0].fluid;
|
||||
int capacity = info[0].capacity;
|
||||
@@ -642,7 +649,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (iter >= lavaTanks.size())
|
||||
foundTank = true;
|
||||
}
|
||||
//TConstruct.logger.info("Searching for tank, size: "+lavaTanks.size());
|
||||
// TConstruct.logger.info("Searching for tank, size: "+lavaTanks.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -653,13 +660,11 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
|
||||
/* Inventory */
|
||||
/*public int getMaxStackStackSize (ItemStack stack)
|
||||
{
|
||||
FluidStack liquid = getResultFor(stack);
|
||||
if (liquid == null)
|
||||
return 0;
|
||||
return liquid.amount;
|
||||
}*/
|
||||
/*
|
||||
* public int getMaxStackStackSize (ItemStack stack) { FluidStack liquid =
|
||||
* getResultFor(stack); if (liquid == null) return 0; return liquid.amount;
|
||||
* }
|
||||
*/
|
||||
|
||||
public int getInventoryStackLimit ()
|
||||
{
|
||||
@@ -672,15 +677,16 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
updateEntity();
|
||||
super.markDirty();
|
||||
needsUpdate = true;
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
//worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
// worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
inventory[slot] = itemstack != null ? itemstack.splitStack(1) : null; //May include unintended side effects. Possible fix for max stack size of 1?
|
||||
}*/
|
||||
/*
|
||||
* @Override public void setInventorySlotContents (int slot, ItemStack
|
||||
* itemstack) { inventory[slot] = itemstack != null ?
|
||||
* itemstack.splitStack(1) : null; //May include unintended side effects.
|
||||
* Possible fix for max stack size of 1? }
|
||||
*/
|
||||
|
||||
/* Multiblock */
|
||||
@Override
|
||||
@@ -745,7 +751,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
checkValidStructure(x + 1, y, z);
|
||||
}
|
||||
|
||||
//Not valid, sorry
|
||||
// Not valid, sorry
|
||||
}
|
||||
|
||||
public void checkValidStructure (int x, int y, int z)
|
||||
@@ -759,7 +765,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
checkLayers += recurseStructureDown(x, y - 1, z, 0);
|
||||
}
|
||||
|
||||
//maxLiquid = capacity * 20000;
|
||||
// maxLiquid = capacity * 20000;
|
||||
|
||||
if (tempValidStructure != validStructure || checkLayers != this.layers)
|
||||
{
|
||||
@@ -785,7 +791,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
lavaTanks.clear();
|
||||
Block block;
|
||||
|
||||
//Check inside
|
||||
// Check inside
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
@@ -796,7 +802,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
|
||||
//Check outer layer
|
||||
// Check outer layer
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
numBricks += checkBricks(xPos, y, z - 2);
|
||||
@@ -818,7 +824,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
public int recurseStructureUp (int x, int y, int z, int count)
|
||||
{
|
||||
numBricks = 0;
|
||||
//Check inside
|
||||
// Check inside
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
@@ -829,7 +835,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
|
||||
//Check outer layer
|
||||
// Check outer layer
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
numBricks += checkBricks(xPos, y, z - 2);
|
||||
@@ -852,7 +858,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
public int recurseStructureDown (int x, int y, int z, int count)
|
||||
{
|
||||
numBricks = 0;
|
||||
//Check inside
|
||||
// Check inside
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
@@ -868,7 +874,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
|
||||
//Check outer layer
|
||||
// Check outer layer
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
numBricks += checkBricks(xPos, y, z - 2);
|
||||
@@ -908,8 +914,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Returns whether the brick is a lava tank or not.
|
||||
* Increments bricks, sets them as part of the structure, and adds tanks to the list.
|
||||
/*
|
||||
* Returns whether the brick is a lava tank or not. Increments bricks, sets
|
||||
* them as part of the structure, and adds tanks to the list.
|
||||
*/
|
||||
int checkBricks (int x, int y, int z)
|
||||
{
|
||||
@@ -978,7 +985,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
FluidStack liq = liquid.copy();
|
||||
if (doDrain)
|
||||
{
|
||||
//liquid = null;
|
||||
// liquid = null;
|
||||
moltenMetal.remove(liquid);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
currentLiquid = 0;
|
||||
@@ -1007,7 +1014,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
@Override
|
||||
public int fill (FluidStack resource, boolean doFill)
|
||||
{
|
||||
if (resource != null && currentLiquid < maxLiquid)//resource.amount + currentLiquid < maxLiquid)
|
||||
if (resource != null && currentLiquid < maxLiquid)// resource.amount +
|
||||
// currentLiquid <
|
||||
// maxLiquid)
|
||||
{
|
||||
if (resource.amount + currentLiquid > maxLiquid)
|
||||
resource.amount = maxLiquid - currentLiquid;
|
||||
@@ -1074,7 +1083,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
inventory = new ItemStack[layers * 9];
|
||||
super.readFromNBT(tags);
|
||||
|
||||
//validStructure = tags.getBoolean("ValidStructure");
|
||||
// validStructure = tags.getBoolean("ValidStructure");
|
||||
internalTemp = tags.getInteger("InternalTemp");
|
||||
inUse = tags.getBoolean("InUse");
|
||||
|
||||
@@ -1101,8 +1110,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (fluid != null)
|
||||
moltenMetal.add(fluid);
|
||||
}
|
||||
//adjustLayers(layers, true);
|
||||
//checkValidPlacement();
|
||||
// adjustLayers(layers, true);
|
||||
// checkValidPlacement();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1110,7 +1119,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
{
|
||||
super.writeToNBT(tags);
|
||||
|
||||
//tags.setBoolean("ValidStructure", validStructure);
|
||||
// tags.setBoolean("ValidStructure", validStructure);
|
||||
tags.setInteger("InternalTemp", internalTemp);
|
||||
tags.setBoolean("InUse", inUse);
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -10,6 +7,8 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
|
||||
public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
@@ -35,24 +34,25 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
return new PatternShaperContainer(inventoryplayer, this);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void markDirty()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
inventory[1] = null;
|
||||
super.markDirty();
|
||||
}*/
|
||||
/*
|
||||
* @Override public void markDirty() { if (inventory[0] == null)
|
||||
* inventory[1] = null; super.markDirty(); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
super.setInventorySlotContents(slot, itemstack);
|
||||
if (slot == 0 && itemstack != null && itemstack.getItem() == TRepo.blankPattern)//instanceof tconstruct.items.Pattern)
|
||||
if (slot == 0 && itemstack != null && itemstack.getItem() == TRepo.blankPattern)// instanceof
|
||||
// tconstruct.items.Pattern)
|
||||
{
|
||||
if (itemstack.getItemDamage() == 0)
|
||||
setInventorySlotContents(1, new ItemStack(TRepo.woodPattern, 1, 1));
|
||||
/*else if (itemstack.getItemDamage() == 1)
|
||||
setInventorySlotContents(1, new ItemStack(TContent.metalPattern, 1, 0));*/
|
||||
/*
|
||||
* else if (itemstack.getItemDamage() == 1)
|
||||
* setInventorySlotContents(1, new ItemStack(TContent.metalPattern,
|
||||
* 1, 0));
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
|
||||
@@ -32,8 +32,10 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
|
||||
public void overrideFluids (ArrayList<FluidStack> fluids)
|
||||
{
|
||||
/*multitank.overrideFluids(fluids);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);*/
|
||||
/*
|
||||
* multitank.overrideFluids(fluids); worldObj.markBlockForUpdate(xCoord,
|
||||
* yCoord, zCoord);
|
||||
*/
|
||||
}
|
||||
|
||||
public boolean hasItem ()
|
||||
@@ -54,25 +56,26 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
@Override
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
/*inventory[slot] = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, itemstack.getItemDamage(), 3);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}*/
|
||||
/*
|
||||
* inventory[slot] = itemstack; if (itemstack != null &&
|
||||
* itemstack.stackSize > getInventoryStackLimit()) { itemstack.stackSize
|
||||
* = getInventoryStackLimit();
|
||||
* worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord,
|
||||
* itemstack.getItemDamage(), 3); worldObj.markBlockForUpdate(xCoord,
|
||||
* yCoord, zCoord); }
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
|
||||
{
|
||||
return null; //Not a gui block
|
||||
return null; // Not a gui block
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultName ()
|
||||
{
|
||||
return null; //Not a gui block
|
||||
return null; // Not a gui block
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,20 +87,21 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
@Override
|
||||
public void notifyMasterOfChange ()
|
||||
{
|
||||
//Probably not useful here
|
||||
// Probably not useful here
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setPotentialMaster (IMasterLogic master, World world, int xMaster, int yMaster, int zMaster)
|
||||
{
|
||||
return false; //Master should be verified right after placement
|
||||
return false; // Master should be verified right after placement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyMaster (IMasterLogic logic, World world, int xMaster, int yMaster, int zMaster)
|
||||
{
|
||||
/*if (master != null) //Is this even needed?
|
||||
return false;*/
|
||||
/*
|
||||
* if (master != null) //Is this even needed? return false;
|
||||
*/
|
||||
|
||||
master = new CoordTuple(xMaster, yMaster, zMaster);
|
||||
return true;
|
||||
@@ -127,19 +131,17 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
return false;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
/*
|
||||
* @Override public boolean canUpdate() { return false; }
|
||||
*/
|
||||
|
||||
//DELETE
|
||||
// DELETE
|
||||
public void updateEntity ()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
//Keep TE regardless of metadata
|
||||
// Keep TE regardless of metadata
|
||||
public boolean shouldRefresh (int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z)
|
||||
{
|
||||
return oldID != newID;
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
/**
|
||||
*
|
||||
* @author fuj1n
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
{
|
||||
@@ -232,15 +232,16 @@ public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
@Override
|
||||
public boolean isItemValidForSlot (int i, ItemStack itemstack)
|
||||
{
|
||||
//Should automatic camo insertion be allowed.
|
||||
// Should automatic camo insertion be allowed.
|
||||
if (i == 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Here for mDiyo to decide if he wants automation for insertion/extraction of the items to be an option.
|
||||
//Would be useful for building automated mine laying machines.
|
||||
// Here for mDiyo to decide if he wants automation for
|
||||
// insertion/extraction of the items to be an option.
|
||||
// Would be useful for building automated mine laying machines.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.ToolStationContainer;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -9,6 +7,8 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.ToolStationContainer;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
|
||||
/* Simple class for storing items in the block
|
||||
*/
|
||||
|
||||
@@ -73,7 +73,7 @@ public class SlimeGel extends TConstructBlock
|
||||
{
|
||||
par3List.add(new ItemStack(b, 1, 0));
|
||||
par3List.add(new ItemStack(b, 1, 1));
|
||||
//par3List.add(new ItemStack(par1, 1, 2));
|
||||
// par3List.add(new ItemStack(par1, 1, 2));
|
||||
}
|
||||
|
||||
public boolean canSustainLeaves (World world, int x, int y, int z)
|
||||
|
||||
@@ -24,7 +24,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SlimeGrass extends MantleBlock
|
||||
{
|
||||
public String[] textureNames = { "slimegrass_green_top", "slimedirt_blue", "slimegrass_green_blue_side", "slimegrass_green_dirt_side" };//green, purple
|
||||
public String[] textureNames = { "slimegrass_green_top", "slimedirt_blue", "slimegrass_green_blue_side", "slimegrass_green_dirt_side" };// green,
|
||||
// purple
|
||||
public IIcon[] icons;
|
||||
|
||||
public SlimeGrass()
|
||||
@@ -38,11 +39,11 @@ public class SlimeGrass extends MantleBlock
|
||||
@Override
|
||||
public int damageDropped (int meta)
|
||||
{
|
||||
if (meta == 1) //dirt
|
||||
if (meta == 1) // dirt
|
||||
return 0;
|
||||
|
||||
else
|
||||
//slime dirt
|
||||
// slime dirt
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ public class SlimeLeaves extends BlockLeaves
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the block items with a specified chance of dropping the specified items
|
||||
* Drops the block items with a specified chance of dropping the specified
|
||||
* items
|
||||
*/
|
||||
public void dropBlockAsItemWithChance (World world, int x, int y, int z, int meta, float chance, int fortune)
|
||||
{
|
||||
@@ -111,10 +112,9 @@ public class SlimeLeaves extends BlockLeaves
|
||||
{
|
||||
int dropChance = 35;
|
||||
|
||||
/*if ((meta & 3) == 3)
|
||||
{
|
||||
j1 = 40;
|
||||
}*/
|
||||
/*
|
||||
* if ((meta & 3) == 3) { j1 = 40; }
|
||||
*/
|
||||
|
||||
if (fortune > 0)
|
||||
{
|
||||
|
||||
@@ -39,10 +39,9 @@ public class SlimeTallGrass extends BlockBush implements IShearable
|
||||
*/
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
/*if (meta >= this.iconArray.length)
|
||||
{
|
||||
meta = 0;
|
||||
}*/
|
||||
/*
|
||||
* if (meta >= this.iconArray.length) { meta = 0; }
|
||||
*/
|
||||
|
||||
return this.iconArray[meta];
|
||||
}
|
||||
@@ -56,7 +55,8 @@ public class SlimeTallGrass extends BlockBush implements IShearable
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
|
||||
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i'
|
||||
* (inclusive).
|
||||
*/
|
||||
public int quantityDroppedWithBonus (int par1, Random par2Random)
|
||||
{
|
||||
|
||||
@@ -64,8 +64,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||
* cleared to be reused)
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this
|
||||
* box can change after the pool has been cleared to be reused)
|
||||
*/
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -73,8 +73,9 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether
|
||||
* or not to render the shared face of two adjacent blocks and also whether
|
||||
* the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube ()
|
||||
{
|
||||
@@ -82,7 +83,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
* If this block doesn't render as an ordinary block it will return False
|
||||
* (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock ()
|
||||
{
|
||||
@@ -95,7 +97,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
||||
* Checks to see if its valid to put this block at the specified
|
||||
* coordinates. Args: world, x, y, z
|
||||
*/
|
||||
public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -103,8 +106,9 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor blockID
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
||||
* neighbor changed (coordinates passed are their own) Args: x, y, z,
|
||||
* neighbor blockID
|
||||
*/
|
||||
public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
@@ -118,7 +122,7 @@ public class Landmine extends MantleBlock
|
||||
if (var6)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
//par1World.setBlock(par2, par3, par4, 0);
|
||||
// par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +141,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
||||
* Triggered whenever an entity collides with this block (enters into the
|
||||
* block). Args: world, x, y, z, entity
|
||||
*/
|
||||
public void onEntityCollidedWithBlock (World par1World, int par2, int par3, int par4, Entity par5Entity)
|
||||
{
|
||||
@@ -151,7 +156,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa.
|
||||
* Checks if there are mobs on the plate. If a mob is on the plate and it is
|
||||
* off, it turns it on, and vice versa.
|
||||
*/
|
||||
private void setStateIfMobInteractsWithPlate (World world, int posX, int posY, int posZ)
|
||||
{
|
||||
@@ -176,13 +182,14 @@ public class Landmine extends MantleBlock
|
||||
(double) ((float) (posZ + 1) - var7)));
|
||||
}
|
||||
|
||||
/*if (this.triggerMobType == EnumCreatureType.players)
|
||||
{
|
||||
var8 = world.getEntitiesWithinAABB(
|
||||
EntityPlayer.class,
|
||||
AxisAlignedBB.getAABBPool().getAABB((double) ((float) posX + var7), (double) posY, (double) ((float) posZ + var7), (double) ((float) (posX + 1) - var7), (double) posY + 0.25D,
|
||||
(double) ((float) (posZ + 1) - var7)));
|
||||
}*/
|
||||
/*
|
||||
* if (this.triggerMobType == EnumCreatureType.players) { var8 =
|
||||
* world.getEntitiesWithinAABB( EntityPlayer.class,
|
||||
* AxisAlignedBB.getAABBPool().getAABB((double) ((float) posX + var7),
|
||||
* (double) posY, (double) ((float) posZ + var7), (double) ((float)
|
||||
* (posX + 1) - var7), (double) posY + 0.25D, (double) ((float) (posZ +
|
||||
* 1) - var7))); }
|
||||
*/
|
||||
|
||||
if (!var8.isEmpty())
|
||||
{
|
||||
@@ -204,30 +211,35 @@ public class Landmine extends MantleBlock
|
||||
{
|
||||
WorldHelper.setBlockToAir(world, posX, posY, posZ);
|
||||
world.createExplosion((Entity) null, posX, posY, posZ, 2.0F, true);
|
||||
/*par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
|
||||
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
|
||||
par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID);
|
||||
par1World.markBlockRangeForRenderUpdate(posX, posY, posZ, posX, posY, posZ);
|
||||
par1World.playSoundEffect((double)posX + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F, 0.6F);*/
|
||||
/*
|
||||
* par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
|
||||
* par1World.notifyBlocksOfNeighborChange(posX, posY, posZ,
|
||||
* this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY
|
||||
* - 1, posZ, this.blockID);
|
||||
* par1World.markBlockRangeForRenderUpdate(posX, posY, posZ, posX,
|
||||
* posY, posZ); par1World.playSoundEffect((double)posX + 0.5D,
|
||||
* (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F,
|
||||
* 0.6F);
|
||||
*/
|
||||
}
|
||||
|
||||
/*if (!var6 && var5)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(posX, posY, posZ, 0);
|
||||
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
|
||||
par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID);
|
||||
par1World.markBlockRangeForRenderUpdate(posX, posY, posZ, posX, posY, posZ);
|
||||
par1World.playSoundEffect((double)posX + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F, 0.5F);
|
||||
}
|
||||
|
||||
if (var6)
|
||||
{
|
||||
par1World.scheduleBlockUpdate(posX, posY, posZ, this.blockID, this.tickRate());
|
||||
}*/
|
||||
/*
|
||||
* if (!var6 && var5) { par1World.setBlockMetadataWithNotify(posX, posY,
|
||||
* posZ, 0); par1World.notifyBlocksOfNeighborChange(posX, posY, posZ,
|
||||
* this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY - 1,
|
||||
* posZ, this.blockID); par1World.markBlockRangeForRenderUpdate(posX,
|
||||
* posY, posZ, posX, posY, posZ); par1World.playSoundEffect((double)posX
|
||||
* + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click",
|
||||
* 0.3F, 0.5F); }
|
||||
*
|
||||
* if (var6) { par1World.scheduleBlockUpdate(posX, posY, posZ,
|
||||
* this.blockID, this.tickRate()); }
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
|
||||
* ejects contained items into the world, and notifies neighbours of an
|
||||
* update, as appropriate
|
||||
*/
|
||||
public void breakBlock (World par1World, int par2, int par3, int par4, Block par5, int par6)
|
||||
{
|
||||
@@ -241,7 +253,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
||||
* Updates the blocks bounds based on its current state. Args: world, x, y,
|
||||
* z
|
||||
*/
|
||||
public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
@@ -270,8 +283,8 @@ public class Landmine extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
|
||||
* and stop pistons
|
||||
* Returns the mobility information of the block, 0 = free, 1 = can't push
|
||||
* but can move over, 2 = total immobility and stop pistons
|
||||
*/
|
||||
public int getMobilityFlag ()
|
||||
{
|
||||
|
||||
@@ -50,8 +50,9 @@ public class Punji extends MantleBlock
|
||||
@Override
|
||||
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
/*if (world.isRemote)
|
||||
return false;*/
|
||||
/*
|
||||
* if (world.isRemote) return false;
|
||||
*/
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta < 4)
|
||||
@@ -81,8 +82,9 @@ public class Punji extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether
|
||||
* or not to render the shared face of two adjacent blocks and also whether
|
||||
* the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube ()
|
||||
{
|
||||
@@ -90,7 +92,8 @@ public class Punji extends MantleBlock
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
* If this block doesn't render as an ordinary block it will return False
|
||||
* (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock ()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user