aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java162
1 files changed, 78 insertions, 84 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index 891c46fd92..b6eb9ec3ad 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -1732,8 +1732,7 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler {
}
}
String tModToName = aMod + " -> " + aEvent.Name;
- if ((this.mOreDictActivated) || (GregTech_API.sPostloadStarted)
- || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
+ if (this.mOreDictActivated || GregTech_API.sPostloadStarted || GregTech_API.sLoadFinished) {
tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
}
if (((aEvent.Ore.getItem() instanceof ItemBlock))
@@ -2313,113 +2312,108 @@ public abstract class GT_Proxy implements IGT_Mod, IFuelHandler {
}
public static void registerRecipes(GT_Proxy.OreDictEventContainer aOre) {
- if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
+ if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)
+ || (aOre.mPrefix == null)
+ || (aOre.mPrefix.isIgnored(aOre.mMaterial))) {
return;
}
if (aOre.mEvent.Ore.stackSize != 1) {
aOre.mEvent.Ore.stackSize = 1;
}
- if (aOre.mPrefix != null) {
- if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) {
- aOre.mPrefix.processOre(
- aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial,
- aOre.mEvent.Name,
- aOre.mModID,
- GT_Utility.copyAmount(1, aOre.mEvent.Ore));
- }
- } else {
- // GT_FML_LOGGER.info("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This
- // Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please
- // report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag
- // Source, it is just an Information, which you should pass to me.");
- }
+
+ aOre.mPrefix.processOre(
+ aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial,
+ aOre.mEvent.Name,
+ aOre.mModID,
+ GT_Utility.copyAmount(1, aOre.mEvent.Ore));
}
@SubscribeEvent
public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) {
- if ((aEvent.side.isServer()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
- if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit)
- && (!aEvent.player.capabilities.isCreativeMode)
- && (this.mSurvivalIntoAdventure)) {
- aEvent.player.setGameType(GameType.ADVENTURE);
- aEvent.player.capabilities.allowEdit = false;
- if (this.mAxeWhenAdventure) {
- GT_Utility.sendChatToPlayer(
- aEvent.player,
- GT_LanguageManager.addStringLocalization(
- "Interaction_DESCRIPTION_Index_097",
- "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(ID_MetaTool_01.AXE.ID, 1, Materials.Flint, Materials.Wood, null)));
- }
- }
- final boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200);
+ if ((!aEvent.side.isServer()) || (aEvent.phase == TickEvent.Phase.END) || (aEvent.player.isDead)) {
+ return;
+ }
- if (aEvent.player.ticksExisted % 120 != 0) {
- return;
+ if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit)
+ && (!aEvent.player.capabilities.isCreativeMode)
+ && (this.mSurvivalIntoAdventure)) {
+ aEvent.player.setGameType(GameType.ADVENTURE);
+ aEvent.player.capabilities.allowEdit = false;
+ if (this.mAxeWhenAdventure) {
+ GT_Utility.sendChatToPlayer(
+ aEvent.player,
+ GT_LanguageManager.addStringLocalization(
+ "Interaction_DESCRIPTION_Index_097",
+ "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(ID_MetaTool_01.AXE.ID, 1, Materials.Flint, Materials.Wood, null)));
}
+ }
+ final boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200);
- int tCount = 64;
- for (int i = 0; i < 36; i++) {
- final ItemStack tStack = aEvent.player.inventory.getStackInSlot(i);
- if (tStack == null) {
- continue;
- }
+ if (aEvent.player.ticksExisted % 120 != 0) {
+ return;
+ }
- if (!aEvent.player.capabilities.isCreativeMode) {
- GT_Utility
- .applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
- final float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
- if (tHeat != 0.0F) {
- if (tHeat > 0.0F) {
- GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack);
- } else {
- GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
- }
+ int tCount = 64;
+ for (int i = 0; i < 36; i++) {
+ final ItemStack tStack = aEvent.player.inventory.getStackInSlot(i);
+ if (tStack == null) {
+ continue;
+ }
+
+ if (!aEvent.player.capabilities.isCreativeMode) {
+ GT_Utility
+ .applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
+ final float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
+ if (tHeat != 0.0F) {
+ if (tHeat > 0.0F) {
+ GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack);
+ } else {
+ GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
}
}
- if (tHungerEffect) {
- tCount += tStack.stackSize * 64 / Math.max(1, tStack.getMaxStackSize());
- }
- if (this.mInventoryUnification) {
- GT_OreDictUnificator.setStack(true, tStack);
- }
+ }
+ if (tHungerEffect) {
+ tCount += tStack.stackSize * 64 / Math.max(1, tStack.getMaxStackSize());
+ }
+ if (this.mInventoryUnification) {
+ GT_OreDictUnificator.setStack(true, tStack);
+ }
+ }
+ for (int i = 0; i < 4; i++) {
+ final ItemStack tStack = aEvent.player.inventory.armorInventory[i];
+ if (tStack == null) {
+ continue;
}
- for (int i = 0; i < 4; i++) {
- final ItemStack tStack = aEvent.player.inventory.armorInventory[i];
- if (tStack == null) {
- continue;
- }
- if (!aEvent.player.capabilities.isCreativeMode) {
- GT_Utility
- .applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
- final float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
- if (tHeat != 0.0F) {
- if (tHeat > 0.0F) {
- GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack);
- } else {
- GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
- }
+ if (!aEvent.player.capabilities.isCreativeMode) {
+ GT_Utility
+ .applyRadioactivity(aEvent.player, GT_Utility.getRadioactivityLevel(tStack), tStack.stackSize);
+ final float tHeat = GT_Utility.getHeatDamageFromItem(tStack);
+ if (tHeat != 0.0F) {
+ if (tHeat > 0.0F) {
+ GT_Utility.applyHeatDamageFromItem(aEvent.player, tHeat, tStack);
+ } else {
+ GT_Utility.applyFrostDamage(aEvent.player, -tHeat);
}
}
- if (tHungerEffect) {
- tCount += 256;
- }
-
}
if (tHungerEffect) {
- aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F));
+ tCount += 256;
}
}
+ if (tHungerEffect) {
+ aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F));
+ }
}
public GT_ClientPreference getClientPreference(UUID aPlayerID) {