Skip to content

Commit

Permalink
added config options to disable capes, and disable exo armor crafting…
Browse files Browse the repository at this point in the history
…, partbuilder now scans all 3 axes

UNTESTED
  • Loading branch information
progwml6 committed Feb 1, 2014
1 parent 69e1d3b commit cbfb5f2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 50 deletions.
9 changes: 6 additions & 3 deletions src/main/java/tconstruct/blocks/logic/PartBuilderLogic.java
Expand Up @@ -38,9 +38,12 @@ public Container getGuiContainer (InventoryPlayer inventoryplayer, World world,
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
TileEntity tile = world.getBlockTileEntity(xPos, y, zPos);
if (tile != null && tile instanceof PatternChestLogic)
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile);
for (int yPos = y - 1; zPos <= y + 1; zPos++)
{
TileEntity tile = world.getBlockTileEntity(xPos, yPos, zPos);
if (tile != null && tile instanceof PatternChestLogic)
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile);
}
}
}
return new PartCrafterContainer(inventoryplayer, this);
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/tconstruct/client/event/EventCloakRender.java
@@ -1,12 +1,16 @@
package tconstruct.client.event;

import cpw.mods.fml.common.Loader;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.*;
import java.util.*;

import javax.swing.ImageIcon;

import tconstruct.util.config.PHConstruct;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.event.ForgeSubscribe;
Expand All @@ -32,7 +36,7 @@ public EventCloakRender()
@ForgeSubscribe
public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event)
{
if (Loader.isModLoaded("shadersmod"))
if (Loader.isModLoaded("shadersmod")|| !PHConstruct.capesEnabled)
{
return;
}
Expand All @@ -48,12 +52,11 @@ public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event)
{
return;
}
capePlayers.add(abstractClientPlayer);
abstractClientPlayer.getTextureCape().textureUploaded = false;
new Thread(new CloakThread(abstractClientPlayer, cloakURL)).start();
event.renderCape = true;

capePlayers.add(abstractClientPlayer);

abstractClientPlayer.getTextureCape().textureUploaded = false;
new Thread(new CloakThread(abstractClientPlayer, cloakURL)).start();
event.renderCape = true;
}
}
}
Expand Down
31 changes: 17 additions & 14 deletions src/main/java/tconstruct/common/TContent.java
Expand Up @@ -1260,14 +1260,17 @@ private void addRecipesForCraftingTable ()
ItemStack exoChestStack = new ItemStack(exoChest);
ItemStack exoPantsStack = new ItemStack(exoPants);
ItemStack exoShoesStack = new ItemStack(exoShoes);
ToolBuilder.instance.addArmorTag(exoGoggleStack);
ToolBuilder.instance.addArmorTag(exoChestStack);
ToolBuilder.instance.addArmorTag(exoPantsStack);
ToolBuilder.instance.addArmorTag(exoShoesStack);
GameRegistry.addShapedRecipe(exoGoggleStack, helm, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoChestStack, chest, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoPantsStack, pants, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoShoesStack, shoes, 'w', new ItemStack(largePlate, 1, 14));
if (!PHConstruct.exoCraftingEnabled)
{
ToolBuilder.instance.addArmorTag(exoGoggleStack);
ToolBuilder.instance.addArmorTag(exoChestStack);
ToolBuilder.instance.addArmorTag(exoPantsStack);
ToolBuilder.instance.addArmorTag(exoShoesStack);
GameRegistry.addShapedRecipe(exoGoggleStack, helm, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoChestStack, chest, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoPantsStack, pants, 'w', new ItemStack(largePlate, 1, 14));
GameRegistry.addShapedRecipe(exoShoesStack, shoes, 'w', new ItemStack(largePlate, 1, 14));
}

// Metal conversion Recipes
GameRegistry.addRecipe(new ItemStack(metalBlock, 1, 3), patBlock, '#', new ItemStack(materials, 1, 9)); // Copper
Expand Down Expand Up @@ -2318,23 +2321,23 @@ public void modIntegration ()
TConstructClientRegistry.registerManualModifier("fluxmod2", ironpick.copy(), (ItemStack) basicCell);

/* Thaumcraft */
TConstructClientRegistry.addMaterialRenderMapping(31, "tinker", "thaumium", true);
TConstructRegistry.addToolMaterial(31, "Thaumium", 3, 400, 700, 2, 1.3F, 0, 0f, "\u00A75", "Thaumic");
TConstructRegistry.addBowMaterial(31, 576, 40, 1.2f);
TConstructRegistry.addArrowMaterial(31, 1.8F, 0.5F, 100F);

Object obj = getStaticItem("itemResource", "thaumcraft.common.config.ConfigItems");
if (obj != null)
{
TConstruct.logger.info("Thaumcraft detected. Adding thaumium tools.");
thaumcraftAvailable = true;
TConstructClientRegistry.addMaterialRenderMapping(31, "tinker", "thaumium", true);
TConstructRegistry.addToolMaterial(31, "Thaumium", 3, 400, 700, 2, 1.3F, 0, 0f, "\u00A75", "Thaumic");
PatternBuilder.instance.registerFullMaterial(new ItemStack((Item) obj, 1, 2), 2, "Thaumium", new ItemStack(toolShard, 1, 31), new ItemStack(toolRod, 1, 31), 31);
TConstructRegistry.addBowstringMaterial(1, 2, new ItemStack((Item) obj, 1, 7), new ItemStack(bowstring, 1, 1), 1F, 1F, 0.9f);
for (int meta = 0; meta < patternOutputs.length; meta++)
{
if (patternOutputs[meta] != null)
TConstructRegistry.addPartMapping(woodPattern.itemID, meta + 1, 31, new ItemStack(patternOutputs[meta], 1, 31));
}

TConstructRegistry.addBowstringMaterial(1, 2, new ItemStack((Item) obj, 1, 7), new ItemStack(bowstring, 1, 1), 1F, 1F, 0.9f);
TConstructRegistry.addBowMaterial(31, 576, 40, 1.2f);
TConstructRegistry.addArrowMaterial(31, 1.8F, 0.5F, 100F);
}
else
{
Expand Down
57 changes: 30 additions & 27 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Expand Up @@ -40,9 +40,9 @@ public static void initProps (File location)
/* Define the mod's IDs.
* Avoid values below 4096 for items and in the 250-450 range for blocks
*/
superfunWorld = config.get("Superfun", "All the world is Superfun", false).getBoolean(false);
forceToolLogsOff = config.get("Logging", "Disable tool build messages", false).getBoolean(false);

superfunWorld = config.get("Superfun", "All the world is Superfun", false).getBoolean(false);
forceToolLogsOff = config.get("Logging", "Disable tool build messages", false).getBoolean(false);

keepHunger = config.get("Difficulty Changes", "Keep hunger on death", true).getBoolean(true);
keepLevels = config.get("Difficulty Changes", "Keep levels on death", true).getBoolean(true);
Expand All @@ -66,14 +66,14 @@ public static void initProps (File location)
miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true).getBoolean(true);
denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false);
craftEndstone = config.get("Difficulty Changes", "Allow creation of endstone", true).getBoolean(true);
ingotsPerOre = config.get("Smeltery Output Modification", "Ingots per ore", 2, "Number of ingots returned from smelting ores in the smeltery").getInt(2);
ingotsBronzeAlloy = config.get("Smeltery Output Modification", "Bronze ingot return", 4, "Number of ingots returned from smelting Bronze in the smeltery").getInt(4);
ingotsAluminumBrassAlloy = config.get("Smeltery Output Modification", "Aluminum Brass ingot return", 4, "Number of ingots returned from smelting Aluminum Brass in the smeltery").getInt(4);
ingotsAlumiteAlloy = config.get("Smeltery Output Modification", "Alumite ingot return", 3, "Number of ingots returned from smelting Alumite in the smeltery").getInt(3);
ingotsManyullynAlloy = config.get("Smeltery Output Modification", "Manyullyn ingot return", 1, "Number of ingots returned from smelting Manyullyn in the smeltery").getInt(1);
ingotsPigironAlloy = config.get("Smeltery Output Modification", "Pig Iron ingot return", 1, "Number of ingots returned from smelting Pig Iron in the smeltery").getInt(1);

ingotsPerOre = config.get("Smeltery Output Modification", "Ingots per ore", 2, "Number of ingots returned from smelting ores in the smeltery").getInt(2);
ingotsBronzeAlloy = config.get("Smeltery Output Modification", "Bronze ingot return", 4, "Number of ingots returned from smelting Bronze in the smeltery").getInt(4);
ingotsAluminumBrassAlloy = config.get("Smeltery Output Modification", "Aluminum Brass ingot return", 4, "Number of ingots returned from smelting Aluminum Brass in the smeltery").getInt(4);
ingotsAlumiteAlloy = config.get("Smeltery Output Modification", "Alumite ingot return", 3, "Number of ingots returned from smelting Alumite in the smeltery").getInt(3);
ingotsManyullynAlloy = config.get("Smeltery Output Modification", "Manyullyn ingot return", 1, "Number of ingots returned from smelting Manyullyn in the smeltery").getInt(1);
ingotsPigironAlloy = config.get("Smeltery Output Modification", "Pig Iron ingot return", 1, "Number of ingots returned from smelting Pig Iron in the smeltery").getInt(1);

//1467-1489
woodStation = config.getBlock("Wood Tool Station", 1471).getInt(1471);
heldItemBlock = config.getBlock("Held Item Block", 1472).getInt(1472);
Expand Down Expand Up @@ -104,11 +104,11 @@ public static void initProps (File location)
barricadeSpruce = config.getBlock("Spruce Barricade", 1482).getInt(1482);
barricadeBirch = config.getBlock("Birch Barricade", 1483).getInt(1483);
barricadeJungle = config.getBlock("Jungle Barricade", 1487).getInt(1487);

lavaTankNether = config.getBlock("Nether Lava Tank", 3186).getInt(3186);
smelteryNether = config.getBlock("Nether Smeltery", 3187).getInt(3187);
searedTableNether = config.getBlock("Nether Seared Block", 3188).getInt(3188);

bloodChannel = config.getBlock("Blood Channel", 3189).getInt(3189);
slimeChannel = config.getBlock("Slime Channel", 3190).getInt(3190);
slimePad = config.getBlock("Slime Pad", 3191).getInt(3191);
Expand Down Expand Up @@ -140,16 +140,16 @@ public static void initProps (File location)
moltenEmerald = config.getBlock("Molten Emerald", 3216).getInt(3216);
blood = config.getBlock("Liquid Cow", 3217).getInt(3217);
moltenEnder = config.getBlock("Molten Ender", 3218).getInt(3218);

glueBlock = config.getBlock("Glue Block", 3219).getInt(3219);
glueFluidBlock = config.getBlock("Glue Fluid Block", 3220).getInt(3220);

// signalBus = config.getBlock("Signal Bus", 3221).getInt(3221);
// signalTerminal = config.getBlock("Signal Terminal", 3222).getInt(3222);
// signalBus = config.getBlock("Signal Bus", 3221).getInt(3221);
// signalTerminal = config.getBlock("Signal Terminal", 3222).getInt(3222);
glass = config.getBlock("Clear Glass", 3223).getInt(3223);
stainedGlass = config.getBlock("Stained Glass", 3224).getInt(3224);
stainedGlassClear = config.getBlock("Clear Stained Glass", 3225).getInt(3225);
// redstoneMachine = config.getBlock("Redstone Machines", 3226).getInt(3226); // Migrated to TMechworks
// redstoneMachine = config.getBlock("Redstone Machines", 3226).getInt(3226); // Migrated to TMechworks
dryingRack = config.getBlock("Drying Rack", 3227).getInt(3227);
glassPane = config.getBlock("Glass Pane", 3228).getInt(3228);
stainedGlassClearPane = config.getBlock("Clear Stained Glass Pane", 3229).getInt(3229);
Expand Down Expand Up @@ -263,6 +263,8 @@ public static void initProps (File location)
exoChest = config.getItem("Equipables", "Exo-Chestpiece", 14117).getInt(14117);
exoPants = config.getItem("Equipables", "Exo-Legs", 14118).getInt(14118);
exoShoes = config.getItem("Equipables", "Exo-Boots", 14119).getInt(14119);
exoCraftingEnabled = config.get("Equipables", "Exo-Armor-Craftable", true).getBoolean(true);
capesEnabled = config.get("Superfun", "Enable-TCon-Capes", true).getBoolean(true);

boolean ic2 = true;
boolean xycraft = true;
Expand Down Expand Up @@ -379,7 +381,7 @@ public static void initProps (File location)

//Achievement Properties
achievementsEnabled = config.get("Achievement Properties", "AchievementsEnabled", true).getBoolean(true);

/* Save the configuration file */
config.save();

Expand Down Expand Up @@ -589,12 +591,13 @@ public static void initProps (File location)
public static int knapsack;

public static int heartCanister;

public static int exoGoggles;
public static int exoChest;
public static int exoPants;
public static int exoShoes;

public static boolean exoCraftingEnabled;
public static boolean capesEnabled;

//Ore values
public static boolean generateCopper;
Expand Down Expand Up @@ -691,12 +694,12 @@ public static void initProps (File location)
public static boolean miningLevelIncrease;
public static boolean denyMattock;

//Smeltery Output Modification
public static int ingotsPerOre;
public static int ingotsBronzeAlloy;
public static int ingotsAluminumBrassAlloy;
public static int ingotsAlumiteAlloy;
public static int ingotsManyullynAlloy;
//Smeltery Output Modification
public static int ingotsPerOre;
public static int ingotsBronzeAlloy;
public static int ingotsAluminumBrassAlloy;
public static int ingotsAlumiteAlloy;
public static int ingotsManyullynAlloy;
public static int ingotsPigironAlloy;
public static boolean craftEndstone;

Expand Down Expand Up @@ -738,7 +741,7 @@ public static void initProps (File location)
//Addon stuff
public static boolean isCleaverTwoHanded;
public static boolean isHatchetWeapon;

//Achievement options
public static boolean achievementsEnabled;
}

0 comments on commit cbfb5f2

Please sign in to comment.