aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_Proxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java46
1 files changed, 44 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index 00bc5ab0c1..6161e98d82 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -4,6 +4,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
+import cpw.mods.fml.common.ProgressManager;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
@@ -29,6 +30,11 @@ import gregtech.api.util.*;
import gregtech.common.entities.GT_Entity_Arrow;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gregtech.common.items.armor.*;
+import gregtech.common.items.armor.gui.ContainerBasicArmor;
+import gregtech.common.items.armor.gui.ContainerElectricArmor1;
+import gregtech.common.items.armor.gui.GuiElectricArmor1;
+import gregtech.common.items.armor.gui.GuiModularArmor;
+import gregtech.common.items.armor.gui.InventoryArmor;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
@@ -173,6 +179,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public int mPollutionPoisonLimit = 750000;
public int mPollutionVegetationLimit = 1000000;
public int mPollutionSourRainLimit = 2000000;
+ public int mTicksUntilNextCraftSound = 0;
public double mMagneticraftBonusOutputPercent = 100.0d;
private World mUniverse = null;
private final String aTextThermalExpansion = "ThermalExpansion";
@@ -815,6 +822,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
return;
}
+ }else if(this.mIgnoredNames.contains(aEvent.Name)){
GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
return;
}
@@ -1186,10 +1194,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
@SubscribeEvent
public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) {
+ if(aEvent.world.provider.dimensionId == 0)
+ mTicksUntilNextCraftSound--;
if (aEvent.side.isServer()) {
if (this.mUniverse == null) {
this.mUniverse = aEvent.world;
- }
+ }
if (this.isFirstServerWorldTick) {
File tSaveDiretory = getSaveDirectory();
if (tSaveDiretory != null) {
@@ -1244,7 +1254,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
if (this.mAxeWhenAdventure) {
GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this.");
aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY,
- aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(6, 1, Materials.Flint, Materials.Wood, null)));
+ aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null)));
}
}
boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200);
@@ -1312,6 +1322,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
return getRightItem(aPlayer, ID);
}
}
+ if(aID>=100){
+ int tSlot = aID / 100;
+ int ID = aID%100;
+ switch(ID){
+ case 0:
+ return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ case 1:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ case 2:
+ return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot)));
+ default:
+ return getRightItem(aPlayer, ID);
+ }
+ }
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IGregTechTileEntity)) {
IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
@@ -1352,6 +1376,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
return getRightItemGui(aPlayer, ID);
}
}
+ if(aID>=100){
+ int tSlot = aID / 100;
+ int ID = aID%100;
+ switch(ID){
+ case 0:
+ return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ case 1:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ case 2:
+ return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer);
+ default:
+ return getRightItem(aPlayer, ID);
+ }
+ }
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IGregTechTileEntity)) {
IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
@@ -1645,10 +1683,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public void activateOreDictHandler() {
this.mOreDictActivated = true;
+ ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size());
OreDictEventContainer tEvent;
for (Iterator i$ = this.mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
tEvent = (OreDictEventContainer) i$.next();
+
+ progressBar.step(tEvent.mMaterial == null ? "" : tEvent.mMaterial.toString());
}
+ ProgressManager.pop(progressBar);
}
public static final HashMap<ChunkPosition, int[]> chunkData = new HashMap<ChunkPosition, int[]>(5000);