Bugfixes 2
This commit is contained in:
parent
349510f2da
commit
8cdba03c0a
11 changed files with 46 additions and 41 deletions
|
@ -103,6 +103,7 @@ public class GT_Mod
|
|||
|
||||
@Mod.EventHandler
|
||||
public void onPreLoad(FMLPreInitializationEvent aEvent) {
|
||||
Locale.setDefault(Locale.ENGLISH);
|
||||
if (GregTech_API.sPreloadStarted) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
if (tStats[3] == -2 && tCharge <= 0) {
|
||||
aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY);
|
||||
} else {
|
||||
aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
|
||||
aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharfge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -425,10 +425,10 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
return;
|
||||
}
|
||||
if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) {
|
||||
try {
|
||||
//try {
|
||||
GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
//} catch (Exception e) {
|
||||
//}
|
||||
doEnergyExplosion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,14 +17,16 @@ public class ElementStack implements Cloneable {
|
|||
|
||||
@Override
|
||||
public ElementStack clone() {
|
||||
return new ElementStack(mElement, mAmount);
|
||||
try { Object cloneES = super.clone();
|
||||
//return new ElementStack(mElement, mAmount);
|
||||
return (ElementStack) cloneES; } catch (Exception e) { return new ElementStack(mElement, mAmount); }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object aObject) {
|
||||
if (aObject == this) return true;
|
||||
if (aObject == null) return false;
|
||||
if (aObject instanceof Element) return aObject == mElement;
|
||||
if (aObject instanceof Element) {return aObject == mElement;}
|
||||
if (aObject instanceof ElementStack)
|
||||
return ((ElementStack) aObject).mElement == mElement && (mAmount < 0 || ((ElementStack) aObject).mAmount < 0 || ((ElementStack) aObject).mAmount == mAmount);
|
||||
return false;
|
||||
|
|
|
@ -17,7 +17,9 @@ public class MaterialStack implements Cloneable {
|
|||
|
||||
@Override
|
||||
public MaterialStack clone() {
|
||||
return new MaterialStack(mMaterial, mAmount);
|
||||
try { Object cloneMS = super.clone();
|
||||
//return new MaterialStack(mMaterial, mAmount);
|
||||
return (MaterialStack) cloneMS;} catch (Exception e) { return new MaterialStack(mMaterial, mAmount); }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -259,7 +259,7 @@ public class GT_OreDictUnificator {
|
|||
|
||||
public static ItemStack getGem(Materials aMaterial, long aMaterialAmount) {
|
||||
ItemStack rStack = null;
|
||||
if (((aMaterialAmount >= M) || aMaterialAmount >= M * 32))
|
||||
if (((aMaterialAmount >= M)/* || aMaterialAmount >= M * 32*/))
|
||||
rStack = get(OrePrefixes.gem, aMaterial, aMaterialAmount / M);
|
||||
if (rStack == null && (((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16))
|
||||
rStack = get(OrePrefixes.gemFlawed, aMaterial, (aMaterialAmount * 2) / M);
|
||||
|
|
|
@ -176,7 +176,7 @@ public class GT_RecipeRegistrator {
|
|||
}
|
||||
|
||||
public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) {
|
||||
registerReverseArcSmelting(aStack, new ItemData(aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03));
|
||||
registerReverseArcSmelting(aStack, new ItemData(/*aMaterial == null ? null : */new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03));
|
||||
}
|
||||
|
||||
public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) {
|
||||
|
@ -234,7 +234,7 @@ public class GT_RecipeRegistrator {
|
|||
}
|
||||
|
||||
public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) {
|
||||
registerReverseMacerating(aStack, new ItemData(aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer);
|
||||
registerReverseMacerating(aStack, new ItemData(/*aMaterial == null ? null : */new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer);
|
||||
}
|
||||
|
||||
public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) {
|
||||
|
|
|
@ -1410,7 +1410,7 @@ public class GT_Utility {
|
|||
Collections.sort(tEntrySet, new Comparator<Map.Entry<X, Y>>() {
|
||||
@Override
|
||||
public int compare(Entry<X, Y> aValue1, Entry<X, Y> aValue2) {
|
||||
return -aValue1.getValue().compareTo(aValue2.getValue());
|
||||
return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO
|
||||
}
|
||||
});
|
||||
LinkedHashMap<X, Y> rMap = new LinkedHashMap<X, Y>();
|
||||
|
|
|
@ -9,15 +9,12 @@ import codechicken.lib.vec.Rotation;
|
|||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import gregtech.GT_Mod;
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.ConfigCategories;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.interfaces.tileentity.ICoverable;
|
||||
import gregtech.api.interfaces.tileentity.ITurnable;
|
||||
import gregtech.api.metatileentity.BaseMetaPipeEntity;
|
||||
import gregtech.api.objects.GT_FluidStack;
|
||||
import gregtech.api.util.GT_Log;
|
||||
import gregtech.api.util.GT_PlayedSound;
|
||||
import gregtech.api.util.GT_Utility;
|
||||
|
@ -31,12 +28,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
// Referenced classes of package gregtech.common:
|
||||
|
@ -231,45 +226,47 @@ public class GT_Client extends GT_Proxy
|
|||
}
|
||||
|
||||
public void run() {
|
||||
//skip - dead code, rly, txt files on server is now empty
|
||||
try {
|
||||
GT_Log.out.println("GT_Mod: Downloading Cape List.");
|
||||
@SuppressWarnings("resource")
|
||||
Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
|
||||
while (tScanner.hasNextLine()) {
|
||||
String tName = tScanner.nextLine();
|
||||
if (!this.mCapeList.contains(tName.toLowerCase())) {
|
||||
this.mCapeList.add(tName.toLowerCase());
|
||||
}
|
||||
}
|
||||
GT_Log.out.println("Skip: GT_Mod: Downloading Cape List.");
|
||||
/*@*//*SuppressWarnings("resource")*/
|
||||
//Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
|
||||
//while (tScanner.hasNextLine()) {
|
||||
//String tName = tScanner.nextLine();
|
||||
//if (!this.mCapeList.contains(tName.toLowerCase())) {
|
||||
//this.mCapeList.add(tName.toLowerCase());
|
||||
//}
|
||||
//}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
try {
|
||||
GT_Log.out.println("GT_Mod: Downloading News.");
|
||||
@SuppressWarnings("resource")
|
||||
Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
|
||||
while (tScanner.hasNextLine()) {
|
||||
this.mMessage = (this.mMessage + tScanner.nextLine() + " ");
|
||||
}
|
||||
GT_Log.out.println("Skip: GT_Mod: Downloading News.");
|
||||
/*@*//*SuppressWarnings("resource")*/
|
||||
//Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
|
||||
//while (tScanner.hasNextLine()) {
|
||||
//this.mMessage = (this.mMessage + tScanner.nextLine() + " ");
|
||||
//}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) {
|
||||
if ((!aEvent.player.isDead) && (aEvent.phase == TickEvent.Phase.END) && (aEvent.side.isClient())) {
|
||||
if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
|
||||
ArrayList<GT_PlayedSound> tList = new ArrayList();
|
||||
for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) {
|
||||
if (((Integer) tEntry.getValue()).intValue() < 0) {
|
||||
if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix
|
||||
tList.add(tEntry.getKey());
|
||||
} else {
|
||||
tEntry.setValue(Integer.valueOf(((Integer) tEntry.getValue()).intValue() - 1));
|
||||
tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1));
|
||||
}
|
||||
}
|
||||
GT_PlayedSound tKey;
|
||||
for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) {
|
||||
tKey = (GT_PlayedSound) i$.next();
|
||||
}
|
||||
if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) {
|
||||
//wut, every tick? baaad, not need (and other) -> dead code
|
||||
/*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) {
|
||||
this.isFirstClientPlayerTick = false;
|
||||
GT_FluidStack.fixAllThoseFuckingFluidIDs();
|
||||
if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) {
|
||||
|
@ -291,7 +288,7 @@ public class GT_Client extends GT_Proxy
|
|||
aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:"));
|
||||
aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,17 +325,19 @@ public class GT_Client extends GT_Proxy
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
//dead event
|
||||
/*@*//*SubscribeEvent*/
|
||||
/*@SubscribeEvent
|
||||
public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
|
||||
mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
|
||||
}
|
||||
}*/
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
|
||||
if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
|
||||
mAnimationTick++;
|
||||
if (mAnimationTick % 50L == 0L)
|
||||
mAnimationDirection = !mAnimationDirection;
|
||||
{mAnimationDirection = !mAnimationDirection;}
|
||||
int tDirection = mAnimationDirection ? 1 : -1;
|
||||
for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) {
|
||||
Materials tMaterial = (Materials) i$.next();
|
||||
|
|
|
@ -132,6 +132,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
|
|||
return false;
|
||||
}
|
||||
|
||||
//FindBugs
|
||||
@Deprecated
|
||||
private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) {
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
|
|
@ -289,8 +289,7 @@ public class GT_NEI_DefaultHandler
|
|||
}
|
||||
}
|
||||
|
||||
public class FixedPositionedStack
|
||||
extends PositionedStack {
|
||||
public static class FixedPositionedStack extends PositionedStack {
|
||||
public final int mChance;
|
||||
public boolean permutated = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue