TContent refactor Part 1

This commit is contained in:
Progwml6 committed 2013-11-29 23:16:32 -05:00
1 parent 241bfcf0d5
commit 1a74c0768f
77 files changed
+1884 -5647

No files matched your search

@@ -21,6 +21,7 @@ import tconstruct.blocks.logic.ToolForgeLogic;
import tconstruct.blocks.logic.ToolStationLogic;
import tconstruct.common.TContent;
import tconstruct.common.TProxyCommon;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.blocks.InventorySlab;
import tconstruct.util.config.PHConstruct;
@@ -142,9 +143,9 @@ public class CraftingSlab extends InventorySlab
PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(x, y, z);
for (int i = 1; i <= 13; i++)
{
logic.setInventorySlotContents(i - 1, new ItemStack(TContent.woodPattern, 1, i));
logic.setInventorySlotContents(i - 1, new ItemStack(TRepo.woodPattern, 1, i));
}
logic.setInventorySlotContents(13, new ItemStack(TContent.woodPattern, 1, 22));
logic.setInventorySlotContents(13, new ItemStack(TRepo.woodPattern, 1, 22));
}
}
super.onBlockPlacedBy(world, x, y, z, entityliving, stack);
@@ -10,6 +10,7 @@ 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;
public class LiquidMetalFinite extends BlockFluidFinite
@@ -20,7 +21,7 @@ public class LiquidMetalFinite extends BlockFluidFinite
public LiquidMetalFinite(int id, Fluid fluid, String texture)
{
super(id, fluid, TContent.liquidMetal);
super(id, fluid, TRepo.liquidMetal);
this.texture = texture;
this.setCreativeTab(TConstructRegistry.blockTab);
}
@@ -5,9 +5,9 @@ import java.util.Random;
import tconstruct.client.block.OreberryRender;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.AbilityHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeavesBase;
import net.minecraft.block.material.Material;
@@ -187,7 +187,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
if (meta >= 12)
{
world.setBlock(x, y, z, blockID, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat));
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, 1, meta % 4 + itemMeat));
}
}
}
@@ -206,7 +206,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
return true;
world.setBlock(x, y, z, blockID, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
return true;
}
@@ -3,8 +3,8 @@ package tconstruct.blocks;
import java.util.List;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -34,11 +34,11 @@ public class SearedSlab extends SlabBase
{
meta = meta % 8;
if (meta == 0)
return TContent.smeltery.getIcon(side, 2);
return TRepo.smeltery.getIcon(side, 2);
if (meta <= 3)
return TContent.smeltery.getIcon(side, meta + 3);
return TRepo.smeltery.getIcon(side, meta + 3);
return TContent.smeltery.getIcon(side, meta + 4);
return TRepo.smeltery.getIcon(side, meta + 4);
}
@Override
@@ -13,6 +13,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import tconstruct.client.block.SlimePadRender;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -131,16 +132,16 @@ public class SlimePad extends Block
@SideOnly(Side.CLIENT)
public Icon getIcon (int side, int meta)
{
return TContent.slimeGel.getIcon(side, 1);
return TRepo.slimeGel.getIcon(side, 1);
}
public Icon getFluidIcon (int meta)
{
return TContent.slimeChannel.getIcon(2, 0);
return TRepo.slimeChannel.getIcon(2, 0);
}
public Icon getNubIcon (int meta)
{
return TContent.slimeGel.getIcon(0, 0);
return TRepo.slimeGel.getIcon(0, 0);
}
}
@@ -11,6 +11,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -43,7 +44,7 @@ public class SoilSlab extends SlabBase
case 2:
return Block.mycelium.getIcon(1, 0);
default:
return TContent.craftedSoil.getIcon(side, meta - 3);
return TRepo.craftedSoil.getIcon(side, meta - 3);
}
}
@@ -3,8 +3,8 @@ package tconstruct.blocks;
import java.util.List;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -35,7 +35,7 @@ public class SpeedSlab extends SlabBase
public Icon getIcon (int side, int meta)
{
meta = meta % 8;
return TContent.speedBlock.getIcon(side, meta);
return TRepo.speedBlock.getIcon(side, meta);
}
@Override
@@ -10,9 +10,9 @@ import tconstruct.blocks.logic.ToolForgeLogic;
import tconstruct.client.block.TableForgeRender;
import tconstruct.common.TContent;
import tconstruct.common.TProxyCommon;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.blocks.InventoryBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFarmland;
import net.minecraft.block.BlockHalfSlab;
@@ -81,7 +81,7 @@ public class ToolForgeBlock extends InventoryBlock
case 3:
return Block.blockEmerald.getIcon(side, 0);
default:
return TContent.metalBlock.getIcon(side, meta - 4);
return TRepo.metalBlock.getIcon(side, meta - 4);
}
}
@@ -9,10 +9,10 @@ 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.library.blocks.InventoryBlock;
import tconstruct.util.config.PHConstruct;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -204,9 +204,9 @@ public class ToolStationBlock extends InventoryBlock
PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(x, y, z);
for (int i = 1; i <= 13; i++)
{
logic.setInventorySlotContents(i - 1, new ItemStack(TContent.woodPattern, 1, i));
logic.setInventorySlotContents(i - 1, new ItemStack(TRepo.woodPattern, 1, i));
}
logic.setInventorySlotContents(13, new ItemStack(TContent.woodPattern, 1, 22));
logic.setInventorySlotContents(13, new ItemStack(TRepo.woodPattern, 1, 22));
}
}
super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, par6ItemStack);
@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.component.TankLayerScan;
import tconstruct.library.util.CoordTuple;
import tconstruct.library.util.IServantLogic;
@@ -32,7 +33,7 @@ public class SmelteryScan extends TankLayerScan
protected boolean checkAir (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || block.isAirBlock(world, x, y, z) || block == TContent.tankAir)
if (block == null || block.isAirBlock(world, x, y, z) || block == TRepo.tankAir)
return true;
return false;
@@ -52,7 +53,7 @@ public class SmelteryScan extends TankLayerScan
if (be instanceof IServantLogic)
{
boolean ret = ((IServantLogic) be).setPotentialMaster(this.imaster, this.world, x, y, z);
if (ret && block == TContent.lavaTank)
if (ret && block == TRepo.lavaTank)
lavaTanks.add(new CoordTuple(x, y, z));
return ret;
}
@@ -70,9 +71,9 @@ public class SmelteryScan extends TankLayerScan
{
for (CoordTuple coord : airCoords)
{
if (world.getBlockId(coord.x, coord.y, coord.z) != TContent.tankAir.blockID)
if (world.getBlockId(coord.x, coord.y, coord.z) != TRepo.tankAir.blockID)
{
world.setBlock(coord.x, coord.y, coord.z, TContent.tankAir.blockID);
world.setBlock(coord.x, coord.y, coord.z, TRepo.tankAir.blockID);
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
servant.verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
}
@@ -26,6 +26,7 @@ import tconstruct.TConstruct;
import tconstruct.blocks.component.SmelteryComponent;
import tconstruct.blocks.component.SmelteryScan;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.inventory.AdaptiveSmelteryContainer;
import tconstruct.library.blocks.AdaptiveInventoryLogic;
import tconstruct.library.component.IComponentHolder;
@@ -42,7 +43,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
boolean updateFluids = false;
boolean recheckStructure = false;
boolean updateAir = false;
SmelteryScan structure = new SmelteryScan(this, TContent.smeltery, TContent.lavaTank);
SmelteryScan structure = new SmelteryScan(this, TRepo.smeltery, TRepo.lavaTank);
MultiFluidTank multitank = new MultiFluidTank();
SmelteryComponent smeltery = new SmelteryComponent(this, structure, multitank, 800);
HashMap<CoordTuple, LiquidDataInstance> airUpdates = new HashMap<CoordTuple, LiquidDataInstance>();
@@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.IFluidTank;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.inventory.SmelteryContainer;
import tconstruct.library.blocks.InventoryLogic;
import tconstruct.library.crafting.Smeltery;
@@ -320,7 +321,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
if (currentLiquid + 40 < maxLiquid)
{
int amount = villager.isChild() ? 5 : 40;
this.fill(new FluidStack(TContent.moltenEmeraldFluid, amount), true);
this.fill(new FluidStack(TRepo.moltenEmeraldFluid, amount), true);
}
}
}
@@ -331,7 +332,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
if (currentLiquid + 125 < maxLiquid)
{
this.fill(new FluidStack(TContent.moltenEnderFluid, 125), true);
this.fill(new FluidStack(TRepo.moltenEnderFluid, 125), true);
}
}
}
@@ -342,7 +343,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
if (currentLiquid + 40 < maxLiquid)
{
this.fill(new FluidStack(TContent.moltenIronFluid, 40), true);
this.fill(new FluidStack(TRepo.moltenIronFluid, 40), true);
}
}
}
@@ -353,7 +354,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
if (currentLiquid + 108 < maxLiquid)
{
this.fill(new FluidStack(TContent.glueFluid, 108), true);
this.fill(new FluidStack(TRepo.glueFluid, 108), true);
}
}
}
@@ -365,7 +366,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
if (currentLiquid + 40 < maxLiquid)
{
int amount = (living.isChild() || living instanceof EntityPlayer) ? 5 : 40;
this.fill(new FluidStack(TContent.bloodFluid, amount), true);
this.fill(new FluidStack(TRepo.bloodFluid, amount), true);
}
}
}
@@ -673,7 +674,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
//worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
/*@Override
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
@@ -864,7 +865,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
Block block = Block.blocksList[blockID];
if (block != null && !block.isAirBlock(worldObj, xPos, y, zPos))
{
if (blockID == TContent.smeltery.blockID)
if (blockID == TRepo.smeltery.blockID)
return validateBottom(x, y, z, count);
else
return count;
@@ -899,7 +900,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
if (worldObj.getBlockId(xPos, y, zPos) == TContent.smeltery.blockID && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2))
if (worldObj.getBlockId(xPos, y, zPos) == TRepo.smeltery.blockID && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2))
bottomBricks++;
}
}
@@ -919,7 +920,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
int tempBricks = 0;
int blockID = worldObj.getBlockId(x, y, z);
if (blockID == TContent.smeltery.blockID || blockID == TContent.lavaTank.blockID)
if (blockID == TRepo.smeltery.blockID || blockID == TRepo.lavaTank.blockID)
{
TileEntity te = worldObj.getBlockTileEntity(x, y, z);
if (te == this)
@@ -1,6 +1,7 @@
package tconstruct.blocks.logic;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.inventory.PatternShaperContainer;
import tconstruct.library.blocks.InventoryLogic;
import net.minecraft.entity.player.InventoryPlayer;
@@ -45,10 +46,10 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
super.setInventorySlotContents(slot, itemstack);
if (slot == 0 && itemstack != null && itemstack.getItem() == TContent.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(TContent.woodPattern, 1, 1));
setInventorySlotContents(1, new ItemStack(TRepo.woodPattern, 1, 1));
/*else if (itemstack.getItemDamage() == 1)
setInventorySlotContents(1, new ItemStack(TContent.metalPattern, 1, 0));*/
}
@@ -14,6 +14,7 @@ import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IPlantable;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -93,7 +94,7 @@ public class SlimeGrass extends Block
public void onPlantGrow (World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ)
{
world.setBlock(x, y, z, TContent.craftedSoil.blockID, 5, 3);
world.setBlock(x, y, z, TRepo.craftedSoil.blockID, 5, 3);
}
public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random)
@@ -102,7 +103,7 @@ public class SlimeGrass extends Block
{
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
{
par1World.setBlock(par2, par3, par4, TContent.craftedSoil.blockID, 5, 3);
par1World.setBlock(par2, par3, par4, TRepo.craftedSoil.blockID, 5, 3);
}
else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
@@ -122,7 +123,7 @@ public class SlimeGrass extends Block
return;
}
int blockMeta = par1World.getBlockMetadata(posX, posY, posZ);
if (blockID == TContent.craftedSoil.blockID)
if (blockID == TRepo.craftedSoil.blockID)
{
if (blockMeta == 5)
par1World.setBlock(posX, posY, posZ, this.blockID, 0, 3);
@@ -136,7 +137,7 @@ public class SlimeGrass extends Block
public int idDropped (int metadata, Random random, int fortune)
{
if (metadata == 1)
return TContent.craftedSoil.blockID;
return TRepo.craftedSoil.blockID;
else
return Block.dirt.blockID;
}
@@ -11,6 +11,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -96,7 +97,7 @@ public class SlimeLeaves extends BlockLeaves
*/
public int idDropped (int par1, Random par2Random, int par3)
{
return TContent.slimeSapling.blockID;
return TRepo.slimeSapling.blockID;
}
/**
@@ -143,7 +144,7 @@ public class SlimeLeaves extends BlockLeaves
if ((meta & 3) == 0 && world.rand.nextInt(dropChance) == 0)
{
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(TContent.strangeFood, 1, 0));
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(TRepo.strangeFood, 1, 0));
}
}
}
@@ -13,6 +13,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.worldgen.SlimeTreeGen;
import cpw.mods.fml.relauncher.Side;
@@ -47,7 +48,7 @@ public class SlimeSapling extends BlockSapling
public boolean canThisPlantGrowOnThisBlockID (int id)
{
return id == Block.grass.blockID || id == Block.dirt.blockID || id == TContent.slimeGrass.blockID || id == TContent.craftedSoil.blockID;
return id == Block.grass.blockID || id == Block.dirt.blockID || id == TRepo.slimeGrass.blockID || id == TRepo.craftedSoil.blockID;
}
public void updateTick (World world, int x, int y, int z, Random random)
@@ -19,6 +19,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tconstruct.client.block.PunjiRender;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -59,7 +60,7 @@ public class Punji extends Block
if (meta < 4)
{
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.itemID == TContent.punji.blockID)
if (stack != null && stack.itemID == TRepo.punji.blockID)
{
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.stepSound.getPlaceSound(),