aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2016-10-07 18:44:18 +0200
committerTechnus <daniel112092@gmail.com>2016-10-07 18:44:18 +0200
commitba9b32d131c7b2999125a064a448d56bc0f3cc46 (patch)
tree973931241309f2ab1260f3b46554bdddde2dc8a6 /src/main
parentaa453431681d51f8e0175612e0ede67158c3e8cf (diff)
downloadGT5-Unofficial-ba9b32d131c7b2999125a064a448d56bc0f3cc46.tar.gz
GT5-Unofficial-ba9b32d131c7b2999125a064a448d56bc0f3cc46.tar.bz2
GT5-Unofficial-ba9b32d131c7b2999125a064a448d56bc0f3cc46.zip
HARD CHANGES
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gregtech/GT_Mod.java29
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java168
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java587
3 files changed, 360 insertions, 424 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index 31aebe6f1d..589e7f88aa 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -58,7 +58,8 @@ import java.util.*;
import java.util.Map.Entry;
@Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = "required-after:IC2; after:Forestry; after:PFAAGeologica; after:Thaumcraft; after:Railcraft; after:appliedenergistics2; after:ThermalExpansion; after:TwilightForest; after:harvestcraft; after:magicalcrops; after:BuildCraft|Transport; after:BuildCraft|Silicon; after:BuildCraft|Factory; after:BuildCraft|Energy; after:BuildCraft|Core; after:BuildCraft|Builders; after:GalacticraftCore; after:GalacticraftMars; after:GalacticraftPlanets; after:ThermalExpansion|Transport; after:ThermalExpansion|Energy; after:ThermalExpansion|Factory; after:RedPowerCore; after:RedPowerBase; after:RedPowerMachine; after:RedPowerCompat; after:RedPowerWiring; after:RedPowerLogic; after:RedPowerLighting; after:RedPowerWorld; after:RedPowerControl; after:UndergroundBiomes;")
-public class GT_Mod implements IGT_Mod {
+public class GT_Mod
+ implements IGT_Mod {
public static final int VERSION = 509;
public static final int REQUIRED_IC2 = 624;
@Mod.Instance("gregtech")
@@ -250,13 +251,13 @@ public class GT_Mod implements IGT_Mod {
gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get("havestLevel", "activateHarvestLevelChange", false);
if(gregtechproxy.mChangeHarvestLevels){
- gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3);
- gregtechproxy.mMaxHarvestLevel=(int) Math.min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel",7));
- for(Materials tMaterial : Materials.values()){
- if(tMaterial!=null&&tMaterial.mToolQuality>0&&tMaterial.mMetaItemSubID<gregtechproxy.mHarvestLevel.length&&tMaterial.mMetaItemSubID>=0){
- gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get("materialHavestLevel", tMaterial.mDefaultLocalName,tMaterial.mToolQuality);
- }
- }}
+ gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3);
+ gregtechproxy.mMaxHarvestLevel=(int) Math.min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel",7));
+ for(Materials tMaterial : Materials.values()){
+ if(tMaterial!=null&&tMaterial.mToolQuality>0&&tMaterial.mMetaItemSubID<gregtechproxy.mHarvestLevel.length&&tMaterial.mMetaItemSubID>=0){
+ gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get("materialHavestLevel", tMaterial.mDefaultLocalName,tMaterial.mToolQuality);
+ }
+ }}
if (tMainConfig.get(aTextGeneral, "hardermobspawners", true).getBoolean(true)) {
Blocks.mob_spawner.setHardness(500.0F).setResistance(6000000.0F);
@@ -394,7 +395,7 @@ public class GT_Mod implements IGT_Mod {
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
new GT_Bees();
-
+
gregtechproxy.onLoad();
if (gregtechproxy.mSortToTheEnd) {
new GT_ItemIterator().run();
@@ -684,11 +685,11 @@ public class GT_Mod implements IGT_Mod {
}
if(GregTech_API.mOutputRF||GregTech_API.mInputRF){
- GT_Utility.checkAvailabilities();
- if(!GT_Utility.RF_CHECK){
- GregTech_API.mOutputRF = false;
- GregTech_API.mInputRF = false;
- }
+ GT_Utility.checkAvailabilities();
+ if(!GT_Utility.RF_CHECK){
+ GregTech_API.mOutputRF = false;
+ GregTech_API.mInputRF = false;
+ }
}
achievements = new GT_Achievements();
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index 247530d822..96c27e5b84 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -159,13 +159,11 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
} else {
- if (aID != 0) {
- if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
- GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
- mTickTimer = 0;
- mID = aID;
- return true;
- }
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
+ GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
+ mTickTimer = 0;
+ mID = aID;
+ return true;
}
return false;
}
@@ -180,8 +178,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
}
long tTime = System.currentTimeMillis();
+ int tCode = 0;
- try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
+ try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
switch (tCode) {
case 0:
tCode++;
@@ -205,77 +204,77 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
issueTextureUpdate();
}
- if (mNeedsUpdate) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- //worldObj.func_147479_m(xCoord, yCoord, zCoord);
- mNeedsUpdate = false;
+ if (mNeedsUpdate) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ //worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ mNeedsUpdate = false;
+ }
}
- }
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- if (isServerSide() && mTickTimer > 10) {
- for (byte i = (byte) (tCode - 2); i < 6; i++)
- if (getCoverIDAtSide(i) != 0) {
- tCode++;
- GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
- int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
- if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
- mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (isServerSide() && mTickTimer > 10) {
+ for (byte i = (byte) (tCode - 2); i < 6; i++)
+ if (getCoverIDAtSide(i) != 0) {
+ tCode++;
+ GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
+ int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
+ if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
+ mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ }
}
+ mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
+ if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
+ mConnections = (byte) ((mConnections & ~64) | -128);
}
- mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
- if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
- mConnections = (byte) ((mConnections & ~64) | -128);
- }
- }
- case 8:
- tCode = 9;
- mMetaTileEntity.onPreTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 9:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer == 10) {
- for (byte i = 0; i < 6; i++)
- mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- issueBlockUpdate();
}
+ case 8:
+ tCode = 9;
+ mMetaTileEntity.onPreTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 9:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer == 10) {
+ for (byte i = 0; i < 6; i++)
+ mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ issueBlockUpdate();
+ }
- if (xCoord != oX || yCoord != oY || zCoord != oZ) {
- oX = xCoord;
- oY = yCoord;
- oZ = zCoord;
- issueClientUpdate();
- clearTileEntityBuffer();
- }
- }
- case 10:
- tCode++;
- mMetaTileEntity.onPostTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 11:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer % 10 == 0) {
- if (mSendClientData) {
- NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
- mSendClientData = false;
+ if (xCoord != oX || yCoord != oY || zCoord != oZ) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ issueClientUpdate();
+ clearTileEntityBuffer();
}
}
+ case 10:
+ tCode++;
+ mMetaTileEntity.onPostTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 11:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer % 10 == 0) {
+ if (mSendClientData) {
+ NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
+ mSendClientData = false;
+ }
+ }
- if (mTickTimer > 10) {
- if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
- byte tData = mMetaTileEntity.getUpdateData();
- if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
- if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
- tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
- if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
- }
+ if (mTickTimer > 10) {
+ if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
+ byte tData = mMetaTileEntity.getUpdateData();
+ if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
+ if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
+ tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
+ if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
+ }
if (mNeedsBlockUpdate) {
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
@@ -286,8 +285,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
tCode = -1;
break;
}
- }} catch (Throwable e) {
- //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ }
+ } catch (Throwable e) {
+ //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
e.printStackTrace(GT_Log.err);
}
@@ -296,7 +296,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
if (mTimeStatistics.length > 0)
mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
- System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass());
+ FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ms caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass());
}
mWorkUpdate = mInventoryChanged = false;
@@ -310,7 +310,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) {
issueTextureUpdate();
- if (mID != aID && aID > 0) {
+ if (aID > 0 && mID != aID) {
mID = aID;
createNewMetatileEntity(mID);
}
@@ -357,12 +357,12 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
mColor = (byte) aValue;
break;
case 3:
- mSidedRedstone[0] = (byte) ((aValue & 1) > 0 ? 15 : 0);
- mSidedRedstone[1] = (byte) ((aValue & 2) > 0 ? 15 : 0);
- mSidedRedstone[2] = (byte) ((aValue & 4) > 0 ? 15 : 0);
- mSidedRedstone[3] = (byte) ((aValue & 8) > 0 ? 15 : 0);
- mSidedRedstone[4] = (byte) ((aValue & 16) > 0 ? 15 : 0);
- mSidedRedstone[5] = (byte) ((aValue & 32) > 0 ? 15 : 0);
+ mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
+ mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
+ mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
+ mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0);
+ mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0);
+ mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0);
break;
case 4:
if (hasValidMetaTileEntity() && mTickTimer > 20)
@@ -384,7 +384,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
ArrayList<String> tList = new ArrayList<String>();
if (aLogLevel > 2) {
- tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (canAccessData() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
+ tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
}
if (aLogLevel > 1) {
if (mTimeStatistics.length > 0) {
@@ -705,7 +705,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
}
@Override
- public ITexture[] getTexture(Block block, byte aSide) {
+ public ITexture[] getTexture(Block aBlock, byte aSide) {
ITexture rIcon = getCoverTexture(aSide);
if (rIcon != null) return new ITexture[]{rIcon};
return getTextureUncovered(aSide);
@@ -730,7 +730,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
}
protected boolean canAccessData() {
- return !isDead && hasValidMetaTileEntity();
+ return hasValidMetaTileEntity() && !isDead;
}
@Override
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index af2531c4b1..e45ddfa228 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -188,12 +188,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
}
- for (String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- tOreStack = (ItemStack) i$.next();
+ try {
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ tOreStack = (ItemStack) i$.next();
+ }
}
- }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
}
private static final void registerRecipes(OreDictEventContainer aOre) {
@@ -646,6 +648,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
default:
GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, aMaterial, 1L), tBits,
new Object[]{" S ", "hPx"," S ", Character.valueOf('S'), OrePrefixes.stick.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial)});
+ //new Object[]{"P ", aMaterial.contains(SubTag.WOOD) ? " s" : " h", Character.valueOf('P'), OrePrefixes.plate.get(aMaterial)});
+ //TODO CHECK
}
switch (aMaterial) {
@@ -844,7 +848,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
aEvent.bow.damageItem(1, aEvent.entityPlayer);
aEvent.bow.getItem();
- aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 1.0F / (new Random().nextFloat() * 0.4F + 1.2F) + tSpeed
+ aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed
* 0.5F);
tArrowEntity.canBePickedUp = 1;
@@ -900,7 +904,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
if ((aEvent.entityPlayer == null) || (aEvent.entityPlayer.worldObj == null) || (aEvent.action == null) || (aEvent.world.provider == null)) {
return;
}
- if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != null) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
+ if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
&& (GT_Log.pal != null)) {
this.mBufferedPlayerActivity.add(getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:"
+ aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";"
@@ -937,14 +941,16 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
aEvent.z, (byte) aEvent.blockMetadata, aEvent.fortuneLevel, aEvent.isSilkTouching, aEvent);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, aStack) > 2) {
- for (ItemStack tDrop : aEvent.drops) {
- ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null);
- if (tSmeltingOutput != null) {
- tDrop.stackSize *= tSmeltingOutput.stackSize;
- tSmeltingOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tSmeltingOutput);
+ try {
+ for (ItemStack tDrop : aEvent.drops) {
+ ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null);
+ if (tSmeltingOutput != null) {
+ tDrop.stackSize *= tSmeltingOutput.stackSize;
+ tSmeltingOutput.stackSize = tDrop.stackSize;
+ GT_Utility.setStack(tDrop, tSmeltingOutput);
+ }
}
- }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
}
}
}
@@ -975,8 +981,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
try {
aEvent.Ore.stackSize = 1;
if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) {
- if ((aOriginalMod.toLowerCase().contains("xycraft")) || (aOriginalMod.toLowerCase().contains("tconstruct"))
- || ((aOriginalMod.toLowerCase().contains("natura")) && (!aOriginalMod.toLowerCase().contains("natural")))) {
+ if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct"))
+ || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) {
if (GT_Values.D1) {
GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P");
}
@@ -991,89 +997,90 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
}
this.mRegisteredOres.add(aEvent.Ore);
- if ((aEvent.Name.startsWith("item")) && (this.mIgnoredItems.contains(aEvent.Name))) {
- GT_Log.ore.println(tModToName);
- if (aEvent.Name.equals("itemCopperWire")) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aEvent.Name.equals("itemRubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore);
+ if (this.mIgnoredItems.contains(aEvent.Name)) {
+ if ((aEvent.Name.startsWith("item"))) {
+ GT_Log.ore.println(tModToName);
+ if (aEvent.Name.equals("itemCopperWire")) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
+ }
+ if (aEvent.Name.equals("itemRubber")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore);
+ }
+ return;
}
- return;
- }
- if (this.mIgnoredNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
return;
}
- if (aEvent.Name.equals("stone")) {
+ else if (aEvent.Name.equals("stone")) {
GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore);
return;
}
- if (aEvent.Name.equals("cobblestone")) {
+ else if (aEvent.Name.equals("cobblestone")) {
GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore);
return;
}
- if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
+ else if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
|| (aEvent.Name.contains("$"))) {
GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
return;
}
- if (aEvent.Name.equals("copperWire")) {
+ else if (aEvent.Name.equals("copperWire")) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
}
- if (aEvent.Name.equals("oreHeeEndrium")) {
+ else if (aEvent.Name.equals("oreHeeEndrium")) {
GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.HeeEndium, aEvent.Ore);
}
- if (aEvent.Name.equals("sheetPlastic")) {
+ else if (aEvent.Name.equals("sheetPlastic")) {
GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
}
- if (aEvent.Name.equals("shardAir")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardWater")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardFire")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardEarth")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardOrder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardEntropy")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("fieryIngot")) {
+ else if (aEvent.Name.startsWith("shard")) {
+ if (aEvent.Name.equals("shardAir")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardWater")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardFire")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardEarth")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardOrder")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore);
+ return;
+ }
+ else if (aEvent.Name.equals("shardEntropy")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore);
+ return;
+ }
+ } else if (aEvent.Name.equals("fieryIngot")) {
GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore);
return;
}
- if (aEvent.Name.equals("ironwood")) {
+ else if (aEvent.Name.equals("ironwood")) {
GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore);
return;
}
- if (aEvent.Name.equals("steeleaf")) {
+ else if (aEvent.Name.equals("steeleaf")) {
GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore);
return;
}
- if (aEvent.Name.equals("knightmetal")) {
+ else if (aEvent.Name.equals("knightmetal")) {
GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore);
return;
}
- if (aEvent.Name.contains(" ")) {
+ else if (aEvent.Name.contains(" ")) {
GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
return;
}
- if (this.mInvalidNames.contains(aEvent.Name)) {
+ else if (this.mInvalidNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
return;
@@ -1087,12 +1094,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
if (aEvent.Name.toLowerCase().equals(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased.");
return;
- }
- if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
+ }else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased.");
return;
- }
- if (Character.isUpperCase(aEvent.Name.charAt(0))) {
+ } else if (Character.isUpperCase(aEvent.Name.charAt(0))) {
GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
}
} else {
@@ -1132,12 +1137,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) {
- List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects);
- if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects);
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name);
- }
+ if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) {
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects);
+ if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects);
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name);
+ }
switch (aPrefix) {
case crystal:
@@ -1180,14 +1185,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
case cableGt01:
if (aMaterial == Materials.Tin) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyCopper) {
+ } else if (aMaterial == Materials.AnyCopper) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aMaterial == Materials.Gold) {
+ } else if (aMaterial == Materials.Gold) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyIron) {
+ } else if (aMaterial == Materials.AnyIron) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
}
break;
@@ -1199,11 +1201,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
case plate:
if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) {
GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Silicon) {
+ } else if (aMaterial == Materials.Silicon) {
GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
+ } else if (aMaterial == Materials.Wood) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
}
@@ -1219,64 +1219,48 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
case stick:
if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
- }
- if (aMaterial == Materials.Wood) {
+ } else if (aMaterial == Materials.Wood) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
+ } else if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore);
}
break;
case dust:
if (aMaterial == Materials.Salt) {
GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
+ } else if (aMaterial == Materials.Wood) {
GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
- }
- if (aMaterial == Materials.Wheat) {
+ } else if (aMaterial == Materials.Wheat) {
GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
- }
- if (aMaterial == Materials.Lapis) {
+ } else if (aMaterial == Materials.Lapis) {
GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- }
- if (aMaterial == Materials.Lazurite) {
+ } else if (aMaterial == Materials.Lazurite) {
GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- }
- if (aMaterial == Materials.Sodalite) {
+ } else if (aMaterial