mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 19:39:12 +00:00
TContent refactor Part 1
This commit is contained in:
1 parent
241bfcf0d5
commit
1a74c0768f
77 files changed
+1884
-5647
No files matched your search
@@ -3,7 +3,7 @@ package tconstruct.util;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -21,7 +21,7 @@ public class TCraftingHandler implements ICraftingHandler
|
||||
int itemID = item.getItem().itemID;
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
if (itemID == TContent.toolStationWood.blockID)
|
||||
if (itemID == TRepo.toolStationWood.blockID)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
|
||||
@@ -29,10 +29,10 @@ public class TCraftingHandler implements ICraftingHandler
|
||||
{
|
||||
stats.materialManual = true;
|
||||
tags.setBoolean("materialManual", true);
|
||||
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1));
|
||||
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.manualBook, 1, 1));
|
||||
}
|
||||
}
|
||||
if (itemID == TContent.smeltery.blockID || itemID == TContent.lavaTank.blockID)
|
||||
if (itemID == TRepo.smeltery.blockID || itemID == TRepo.lavaTank.blockID)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
|
||||
@@ -40,7 +40,7 @@ public class TCraftingHandler implements ICraftingHandler
|
||||
{
|
||||
stats.smelteryManual = true;
|
||||
tags.setBoolean("smelteryManual", true);
|
||||
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
|
||||
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.manualBook, 1, 2));
|
||||
}
|
||||
player.addStat(TAchievements.achievements.get("tconstruct.smelteryMaker"), 1);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.blocks.LiquidMetalFinite;
|
||||
import tconstruct.blocks.TankAirBlock;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.items.tools.FryingPan;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
@@ -70,7 +70,7 @@ public class TEventHandler
|
||||
public void craftTool (ToolCraftEvent.NormalTool event)
|
||||
{
|
||||
NBTTagCompound toolTag = event.toolTag.getCompoundTag("InfiTool");
|
||||
if (PHConstruct.denyMattock && event.tool == TContent.mattock)
|
||||
if (PHConstruct.denyMattock && event.tool == TRepo.mattock)
|
||||
{
|
||||
int head = toolTag.getInteger("Head");
|
||||
int handle = toolTag.getInteger("Handle");
|
||||
@@ -106,7 +106,7 @@ public class TEventHandler
|
||||
toolTag.setInteger("Modifiers", modifiers);
|
||||
}
|
||||
|
||||
if (event.tool == TContent.shortbow)
|
||||
if (event.tool == TRepo.shortbow)
|
||||
{
|
||||
BowMaterial top = TConstructRegistry.getBowMaterial(toolTag.getInteger("Head"));
|
||||
BowMaterial bottom = TConstructRegistry.getBowMaterial(toolTag.getInteger("Accessory"));
|
||||
@@ -134,7 +134,7 @@ public class TEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (event.tool == TContent.arrow)
|
||||
if (event.tool == TRepo.arrow)
|
||||
{
|
||||
ArrowMaterial head = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Head"));
|
||||
ArrowMaterial shaft = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Handle"));
|
||||
@@ -172,7 +172,7 @@ public class TEventHandler
|
||||
@ForgeSubscribe
|
||||
public void craftPart (PartBuilderEvent.NormalPart event)
|
||||
{
|
||||
if (event.pattern.getItem() == TContent.woodPattern && event.pattern.getItemDamage() == 23)
|
||||
if (event.pattern.getItem() == TRepo.woodPattern && event.pattern.getItemDamage() == 23)
|
||||
{
|
||||
ItemStack result = craftBowString(event.material);
|
||||
if (result != null)
|
||||
@@ -181,7 +181,7 @@ public class TEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (event.pattern.getItem() == TContent.woodPattern && event.pattern.getItemDamage() == 24)
|
||||
if (event.pattern.getItem() == TRepo.woodPattern && event.pattern.getItemDamage() == 24)
|
||||
{
|
||||
ItemStack result = craftFletching(event.material);
|
||||
if (result != null)
|
||||
@@ -239,7 +239,7 @@ public class TEventHandler
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
//Cutlass
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() == TContent.cutlass && player.isUsingItem())
|
||||
if (stack != null && stack.getItem() == TRepo.cutlass && player.isUsingItem())
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 3 * 20, 1));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class TEventHandler
|
||||
|
||||
if (random.nextInt(500) == 0 && event.entityLiving instanceof IMob && event.entityLiving.dimension == 0)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TContent.heartCanister, 1, 1);
|
||||
ItemStack dropStack = new ItemStack(TRepo.heartCanister, 1, 1);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
@@ -285,7 +285,7 @@ public class TEventHandler
|
||||
|
||||
if (event.entityLiving instanceof EntityWither && random.nextInt(5) == 0)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TContent.heartCanister, 1, 1);
|
||||
ItemStack dropStack = new ItemStack(TRepo.heartCanister, 1, 1);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
@@ -329,7 +329,7 @@ public class TEventHandler
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
|
||||
{
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TContent.cleaver)
|
||||
if (stack.getItem() == TRepo.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 10)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ public class TEventHandler
|
||||
}
|
||||
if (enemy.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)
|
||||
{
|
||||
addDrops(event, new ItemStack(TContent.materials, 1, 8));
|
||||
addDrops(event, new ItemStack(TRepo.materials, 1, 8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,14 +355,14 @@ public class TEventHandler
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
|
||||
{
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TContent.cleaver)
|
||||
if (stack.getItem() == TRepo.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 10)
|
||||
{
|
||||
addDrops(event, new ItemStack(Item.skull.itemID, 1, 2));
|
||||
}
|
||||
}
|
||||
/*if (stack.getItem() == TContent.breakerBlade && random.nextInt(100) < 10) //Swap out for real beheading
|
||||
/*if (stack.getItem() == TRepo.breakerBlade && random.nextInt(100) < 10) //Swap out for real beheading
|
||||
{
|
||||
addDrops(event, new ItemStack(Item.skull.itemID, 1, 2));
|
||||
}*/
|
||||
@@ -380,7 +380,7 @@ public class TEventHandler
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
|
||||
{
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TContent.cleaver)
|
||||
if (stack.getItem() == TRepo.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 5)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ public class TEventHandler
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
|
||||
{
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TContent.cleaver)
|
||||
if (stack.getItem() == TRepo.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 50)
|
||||
{
|
||||
@@ -520,9 +520,9 @@ public class TEventHandler
|
||||
{
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if (event.ID == TContent.slimeSapling.blockID)
|
||||
if (event.ID == TRepo.slimeSapling.blockID)
|
||||
{
|
||||
if (TContent.slimeSapling.boneFertilize(event.world, event.X, event.Y, event.Z, event.world.rand, event.entityPlayer))
|
||||
if (TRepo.slimeSapling.boneFertilize(event.world, event.X, event.Y, event.Z, event.world.rand, event.entityPlayer))
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
@@ -559,9 +559,9 @@ public class TEventHandler
|
||||
}
|
||||
|
||||
int bID = evt.world.getBlockId(hitX, hitY, hitZ);
|
||||
for (int id = 0; id < TContent.fluidBlocks.length; id++)
|
||||
for (int id = 0; id < TRepo.fluidBlocks.length; id++)
|
||||
{
|
||||
if (bID == TContent.fluidBlocks[id].blockID)
|
||||
if (bID == TRepo.fluidBlocks[id].blockID)
|
||||
{
|
||||
if (evt.entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
@@ -569,7 +569,7 @@ public class TEventHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TContent.fluidBlocks[id] instanceof LiquidMetalFinite)
|
||||
if (TRepo.fluidBlocks[id] instanceof LiquidMetalFinite)
|
||||
{
|
||||
evt.world.setBlockToAir(hitX, hitY, hitZ);
|
||||
/*int quanta = 0;
|
||||
@@ -614,7 +614,7 @@ public class TEventHandler
|
||||
}
|
||||
|
||||
evt.setResult(Result.ALLOW);
|
||||
evt.result = new ItemStack(TContent.buckets, 1, id);
|
||||
evt.result = new ItemStack(TRepo.buckets, 1, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package tconstruct.util.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class AEImcHandler
|
||||
{
|
||||
private static List<String> spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AdvancedDrawbridgeLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic",
|
||||
"CraftingStationLogic", "DrawbridgeLogic", "DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FirestarterLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic",
|
||||
"PartBuilderLogic", "PatternChestLogic", "RedwireLogic", "SmelteryDrainLogic", "SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic",
|
||||
"ToolStationLogic", "TowerFurnaceLogic", "MultiServantLogic");
|
||||
|
||||
public static void registerForSpatialIO ()
|
||||
{
|
||||
for (String s : spatialIOLogics)
|
||||
{
|
||||
FMLInterModComms.sendMessage("AppliedEnergistics", "movabletile", "tconstruct.blocks.logic." + s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package tconstruct.util.config;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import tconstruct.common.TContent;
|
||||
|
||||
public class BCImcHandler
|
||||
{
|
||||
public static void registerFacades ()
|
||||
{
|
||||
// Smeltery Blocks
|
||||
addFacade(TContent.smeltery.blockID, 2);
|
||||
for (int sc = 4; sc < 11; sc++)
|
||||
{
|
||||
addFacade(TContent.smeltery.blockID, sc);
|
||||
}
|
||||
// Multi Brick + Fancy
|
||||
for (int sc = 0; sc < 13; sc++)
|
||||
{
|
||||
addFacade(TContent.multiBrick.blockID, sc);
|
||||
}
|
||||
for (int sc = 0; sc < 16; sc++)
|
||||
{
|
||||
addFacade(TContent.multiBrickFancy.blockID, sc);
|
||||
}
|
||||
// Special Soil
|
||||
for (int sc = 0; sc < 6; sc++)
|
||||
{
|
||||
addFacade(TContent.craftedSoil.blockID, sc);
|
||||
}
|
||||
// Metal Storage
|
||||
for (int sc = 0; sc < 11; sc++)
|
||||
{
|
||||
addFacade(TContent.metalBlock.blockID, sc);
|
||||
}
|
||||
// Speed Block
|
||||
for (int sc = 0; sc < 7; sc++)
|
||||
{
|
||||
addFacade(TContent.speedBlock.blockID, sc);
|
||||
}
|
||||
// Hambone
|
||||
addFacade(TContent.meatBlock.blockID, 4);
|
||||
addFacade(TContent.meatBlock.blockID, 8);
|
||||
|
||||
// Slime Gel
|
||||
addFacade(TContent.slimeGel.blockID, 0);
|
||||
addFacade(TContent.slimeGel.blockID, 1);
|
||||
}
|
||||
|
||||
private static void addFacade (int blockId, int meta)
|
||||
{
|
||||
FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", String.format("%d@%d", blockId, meta));
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package tconstruct.util.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.common.TContent;
|
||||
|
||||
public class MystImcHandler
|
||||
{
|
||||
private static String[] FluidBlackList = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten",
|
||||
"moltenArdite", "ender", "steel.molten", "platinum.molten" };// = new String[]();
|
||||
private static ArrayList<String> additionalFluids = new ArrayList<String>();
|
||||
|
||||
public static void addFluidToBlacklist (String fluidName)
|
||||
{
|
||||
additionalFluids.add(fluidName);
|
||||
}
|
||||
|
||||
public static void blacklistFluids ()
|
||||
{
|
||||
for (String nm : additionalFluids)
|
||||
{
|
||||
// check if exists??
|
||||
SendFluidIMCBLMsg(nm);
|
||||
}
|
||||
for (String nm : FluidBlackList)
|
||||
{
|
||||
// check if exists??
|
||||
SendFluidIMCBLMsg(nm);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendFluidIMCBLMsg (String FluidName)
|
||||
{
|
||||
NBTTagCompound NBTMsg = new NBTTagCompound();
|
||||
NBTMsg.setCompoundTag("fluidsymbol", new NBTTagCompound());
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("rarity", 0.0F);
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("grammarweight", 0.0F);
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("instabilityPerBlock", 10000F);// renders creative symbol useless
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setString("fluidname", FluidName);
|
||||
FMLInterModComms.sendMessage("Mystcraft", "fluidsymbol", NBTMsg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -128,7 +128,7 @@ public class ArmorExtended implements IInventory
|
||||
|
||||
/*public void recalculateSkills(EntityPlayer player, TPlayerStats stats)
|
||||
{
|
||||
if (inventory[1] != null && inventory[1].getItem() == TContent.glove)
|
||||
if (inventory[1] != null && inventory[1].getItem() == TRepo.glove)
|
||||
{
|
||||
if (stats.skillList.size() < 1)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ public class ArmorExtended implements IInventory
|
||||
{
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
|
||||
if (inventory[6] != null && inventory[6].getItem() == TContent.heartCanister)
|
||||
if (inventory[6] != null && inventory[6].getItem() == TRepo.heartCanister)
|
||||
{
|
||||
ItemStack stack = inventory[6];
|
||||
int meta = stack.getItemDamage();
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -67,7 +67,7 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true);
|
||||
if (PHConstruct.beginnerBook)
|
||||
{
|
||||
ItemStack diary = new ItemStack(TContent.manualBook);
|
||||
ItemStack diary = new ItemStack(TRepo.manualBook);
|
||||
if (!entityplayer.inventory.addItemStackToInventory(diary))
|
||||
{
|
||||
AbilityHelper.spawnItemAtPlayer(entityplayer, diary);
|
||||
@@ -76,7 +76,7 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
|
||||
if (entityplayer.username.toLowerCase().equals("fudgy_fetus"))
|
||||
{
|
||||
ItemStack pattern = new ItemStack(TContent.woodPattern, 1, 22);
|
||||
ItemStack pattern = new ItemStack(TRepo.woodPattern, 1, 22);
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setCompoundTag("display", new NBTTagCompound());
|
||||
|
||||
Reference in new issue
Block a user