mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 06:52:58 +00:00
Fix some bugs,and add diyos BattleSigns
This commit is contained in:
1 parent
1124d54a7b
commit
42a5af5566
27 files changed
+500
-92
No files matched your search
@@ -9,10 +9,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidFinite;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LiquidMetalFinite extends BlockFluidFinite
|
||||
{
|
||||
@@ -41,7 +40,6 @@ public class LiquidMetalFinite extends BlockFluidFinite
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
if (side == 0 || side == 1)
|
||||
@@ -59,7 +57,7 @@ public class LiquidMetalFinite extends BlockFluidFinite
|
||||
}
|
||||
if (!(entity instanceof EntityItem) && !entity.isImmuneToFire())
|
||||
{
|
||||
entity.attackEntityFrom(DamageSource.lava, 4);
|
||||
entity.attackEntityFrom(DamageSource.lava, 4.0F);
|
||||
entity.setFire(15);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package tconstruct.blocks;
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.InventoryBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -360,7 +361,8 @@ public class SearedBlock extends InventoryBlock
|
||||
return world.getBlockMetadata(x, y, z) == 1;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, int neighborBlockID)
|
||||
@Override
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block neighborBlock)
|
||||
{
|
||||
if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
|
||||
@@ -295,9 +295,9 @@ public class SmelteryBlock extends InventoryBlock
|
||||
|
||||
/* Updating */
|
||||
@Override
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block nBlockID)
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block block)
|
||||
{
|
||||
// System.out.println("Neighbor changed");
|
||||
//System.out.println("Neighbor changed");
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
if (logic instanceof IServantLogic)
|
||||
{
|
||||
|
||||
@@ -89,11 +89,14 @@ public class StoneTorch extends MantleBlock
|
||||
* Checks to see if its valid to put this block at the specified
|
||||
* coordinates. Args: world, x, y, z
|
||||
*/
|
||||
@Override
|
||||
public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4)
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) || par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) || par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true)
|
||||
|| par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) || canPlaceTorchOn(par1World, par2, par3 - 1, par4);
|
||||
return par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) ||
|
||||
par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) ||
|
||||
par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true) ||
|
||||
par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) ||
|
||||
canPlaceTorchOn(par1World, par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,34 +104,10 @@ public class StoneTorch extends MantleBlock
|
||||
* side, hitX, hitY, hitZ, block metadata
|
||||
*/
|
||||
@Override
|
||||
public int onBlockPlaced (World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
|
||||
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
|
||||
{
|
||||
int j1 = par9;
|
||||
|
||||
if (par5 == 0)
|
||||
{
|
||||
if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
|
||||
{
|
||||
j1 = 5;
|
||||
}
|
||||
else if (par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
else if (par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
else if (par1World.isSideSolid(par2 + 1, par3, par4, WEST, true))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
else if (par1World.isSideSolid(par2 - 1, par3, par4, EAST, true))
|
||||
{
|
||||
j1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
|
||||
{
|
||||
j1 = 5;
|
||||
@@ -156,6 +135,46 @@ public class StoneTorch extends MantleBlock
|
||||
|
||||
return j1;
|
||||
}
|
||||
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random random)
|
||||
{
|
||||
super.updateTick(par1World, par2, par3, par4, random);
|
||||
|
||||
if (par1World.getBlockMetadata(par2, par3, par4) == 0)
|
||||
{
|
||||
this.onBlockAdded(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
// JAVADOC METHOD $$ func_149726_b
|
||||
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
|
||||
{
|
||||
if (p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_) == 0)
|
||||
{
|
||||
if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true))
|
||||
{
|
||||
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2);
|
||||
}
|
||||
else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true))
|
||||
{
|
||||
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2);
|
||||
}
|
||||
else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true))
|
||||
{
|
||||
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2);
|
||||
}
|
||||
else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true))
|
||||
{
|
||||
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2);
|
||||
}
|
||||
else if (this.canPlaceTorchOn(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_))
|
||||
{
|
||||
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 5, 2);
|
||||
}
|
||||
}
|
||||
|
||||
this.dropTorchIfCantStay(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -169,12 +188,13 @@ public class StoneTorch extends MantleBlock
|
||||
* 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)
|
||||
@Override
|
||||
public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, Block par5)
|
||||
{
|
||||
this.func_94397_d(par1World, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
protected boolean func_94397_d (World par1World, int par2, int par3, int par4, int par5)
|
||||
|
||||
protected boolean func_94397_d(World par1World, int par2, int par3, int par4, Block par5)
|
||||
{
|
||||
if (this.dropTorchIfCantStay(par1World, par2, par3, par4))
|
||||
{
|
||||
@@ -209,6 +229,7 @@ public class StoneTorch extends MantleBlock
|
||||
if (flag)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -234,7 +255,8 @@ public class StoneTorch extends MantleBlock
|
||||
if (par1World.getBlock(par2, par3, par4) == (Block) this)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
WorldHelper.setBlockToAir(par1World, par2, par3, par4);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
//WorldHelper.setBlockToAir(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -6,8 +6,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TConstructFluid extends BlockFluidClassic
|
||||
{
|
||||
@@ -20,7 +18,6 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
{
|
||||
super(fluid, material);
|
||||
this.texture = texture;
|
||||
// TODO setCreativeTab()
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
@@ -36,7 +33,6 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
return alpha ? 1 : 0;
|
||||
}
|
||||
|
||||
// TODO registerBlockIcons
|
||||
@Override
|
||||
public void registerBlockIcons (IIconRegister iconRegister)
|
||||
{
|
||||
@@ -44,13 +40,11 @@ public class TConstructFluid extends BlockFluidClassic
|
||||
flowIcon = iconRegister.registerIcon("tinker:" + texture + "_flow");
|
||||
}
|
||||
|
||||
// TODO getIcon()
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
if (side == 0 || side == 1)
|
||||
return stillIcon;
|
||||
return flowIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import tconstruct.blocks.logic.TankAirLogic;
|
||||
import tconstruct.client.block.TankAirRender;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -29,7 +30,7 @@ public class TankAirBlock extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World world, int i)
|
||||
public TileEntity createNewTileEntity (World world, int var2)
|
||||
{
|
||||
return new TankAirLogic();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
@@ -20,7 +22,6 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
byte direction;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate ()
|
||||
{
|
||||
return false;
|
||||
@@ -51,7 +52,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;
|
||||
@@ -150,7 +151,6 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.readFromNBT(tags);
|
||||
@@ -176,7 +176,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
readFromNBT(packet.func_148857_g());
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.FrypanContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
/* Slots
|
||||
* 0: Battlesign item
|
||||
*/
|
||||
|
||||
public class BattlesignLogic extends EquipLogic
|
||||
{
|
||||
|
||||
public BattlesignLogic()
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultName ()
|
||||
{
|
||||
return "decoration.battlesign";
|
||||
}
|
||||
|
||||
/* NBT */
|
||||
public void readFromNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.readFromNBT(tags);
|
||||
}
|
||||
|
||||
public void writeToNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.writeToNBT(tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
|
||||
{
|
||||
return null; //Not a normal gui block
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -14,7 +15,6 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogic, IFluidHandler
|
||||
{
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user