Machine code changes from bloodasp code
This commit is contained in:
parent
f5278e72cd
commit
8b9fdcf4f6
14 changed files with 33 additions and 44 deletions
|
@ -1,7 +1,6 @@
|
|||
package gregtech.api.items;
|
||||
|
||||
|
||||
import gregtech.api.enums.ItemList;
|
||||
import ic2.api.reactor.IReactor;
|
||||
import ic2.api.reactor.IReactorComponent;
|
||||
import ic2.core.IC2Potion;
|
||||
|
@ -54,7 +53,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
|
|||
for (int i = 0; i < pulses; i++) {
|
||||
acceptUraniumPulse(reactor, yourStack, yourStack, x, y, x, y, heatrun);
|
||||
}
|
||||
pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun);
|
||||
checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun);checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun);checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun);checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun);
|
||||
} else {
|
||||
pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static gregtech.api.enums.GT_Values.GT;
|
||||
import static gregtech.api.enums.GT_Values.V;
|
||||
|
@ -83,7 +84,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity {
|
|||
} else {
|
||||
throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
|
||||
}
|
||||
mName = aBasicName.replaceAll(" ", "_").toLowerCase();
|
||||
mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
|
||||
setBaseMetaTileEntity(new BaseMetaPipeEntity());
|
||||
getBaseMetaTileEntity().setMetaTileID((short) aID);
|
||||
GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static gregtech.api.enums.GT_Values.GT;
|
||||
import static gregtech.api.enums.GT_Values.V;
|
||||
|
@ -79,7 +80,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity {
|
|||
} else {
|
||||
throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
|
||||
}
|
||||
mName = aBasicName.replaceAll(" ", "_").toLowerCase();
|
||||
mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
|
||||
setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity());
|
||||
getBaseMetaTileEntity().setMetaTileID((short) aID);
|
||||
GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
|
||||
|
|
|
@ -77,8 +77,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
|||
@Override
|
||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
|
||||
if (!mInsulated)
|
||||
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
|
||||
|
||||
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
|
||||
if (aConnected) {
|
||||
float tThickNess = getThickNess();
|
||||
if (tThickNess < 0.37F)
|
||||
|
@ -289,4 +288,4 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
|||
public void loadNBTData(NBTTagCompound aNBT) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package gregtech.api.metatileentity.implementations;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import gregtech.api.enums.*;
|
||||
import gregtech.api.gui.GT_Container_BasicMachine;
|
||||
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
|
||||
|
@ -19,6 +17,9 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import static gregtech.api.enums.GT_Values.V;
|
||||
import static gregtech.api.enums.GT_Values.W;
|
||||
|
||||
|
@ -35,7 +36,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
private final boolean mSharedTank, mRequiresFluidForFiltering;
|
||||
private final byte mGUIParameterA, mGUIParameterB;
|
||||
public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) {
|
||||
super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))});
|
||||
super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))});
|
||||
mSharedTank = aSharedTank;
|
||||
mTankCapacity = aTankCapacity;
|
||||
mSpecialEffect = aSpecialEffect;
|
||||
|
|
|
@ -379,7 +379,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
|
|||
public abstract int getMaxEfficiency(ItemStack aStack);
|
||||
|
||||
/**
|
||||
* Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pollution Block)
|
||||
* Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block)
|
||||
*/
|
||||
public abstract int getPollutionPerTick(ItemStack aStack);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package gregtech.common.items.behaviors;
|
||||
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.IItemBehaviour;
|
||||
import gregtech.api.items.GT_MetaBase_Item;
|
||||
|
@ -98,8 +97,6 @@ public class Behaviour_Sonictron
|
|||
}
|
||||
|
||||
public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
|
||||
if ((!aWorld.isRemote) && (aWorld.getBlock(aX, aY, aZ) == GregTech_API.sBlockMachines) && (aWorld.getBlockMetadata(aX, aY, aZ) == 6)) {
|
||||
}
|
||||
setCurrentIndex(aStack, -1);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import thaumcraft.api.aspects.IEssentiaContainerItem;
|
|||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import static gregtech.api.enums.GT_Values.V;
|
||||
|
||||
|
@ -163,7 +164,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
|
|||
if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) {
|
||||
if (isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem) {
|
||||
AspectList tAspect = ((IEssentiaContainerItem) this.mInventory[0].getItem()).getAspects(this.mInventory[0]);
|
||||
TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase());
|
||||
TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase(Locale.ENGLISH));
|
||||
int tEU = (tValue.mValue * tAspect.getAmount((Aspect) tValue.mAspect) * 100);
|
||||
getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU * getEfficiency() / 100, true);
|
||||
ItemStack tStack = this.mInventory[0].copy();
|
||||
|
|
|
@ -154,6 +154,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
|
|||
&& (!consumeFluid(((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosX,
|
||||
((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosY,
|
||||
((ChunkPosition) this.mPumpList.remove(this.mPumpList.size() - 1)).chunkPosZ))) {
|
||||
//Should this be empty?
|
||||
}
|
||||
this.mPumpTimer = GT_Utility.safeInt(160 / (long)Math.pow(2, this.mTier) );
|
||||
this.mPumpTimer = mPumpTimer==0 ? 1 : mPumpTimer;
|
||||
|
|
|
@ -91,8 +91,6 @@ public class GT_MetaTileEntity_Replicator
|
|||
Materials tMaterial;
|
||||
for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) tMaterial.getMass())) {
|
||||
tMaterial = (Materials) i$.next();
|
||||
if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return sHeaviestElementMass;
|
||||
|
|
|
@ -32,7 +32,6 @@ import java.util.ArrayList;
|
|||
public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase {
|
||||
|
||||
private final ArrayList<ChunkPosition> mMineList = new ArrayList();
|
||||
private boolean completedCycle = false;
|
||||
|
||||
public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) {
|
||||
super(aID, aName, aNameRegional);
|
||||
|
|
|
@ -205,7 +205,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
|
|||
}
|
||||
}
|
||||
}
|
||||
this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 3);
|
||||
this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,26 +104,20 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
|
|||
&& (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity))
|
||||
&& (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity))
|
||||
&& (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) {
|
||||
if (this.mEnergyHatches != null) {
|
||||
int mEnergyHatches_sS=this.mEnergyHatches.size();
|
||||
for (int i = 0; i < mEnergyHatches_sS; i++) {
|
||||
if (this.mEnergyHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
int mEnergyHatches_sS = this.mEnergyHatches.size();
|
||||
for (int i = 0; i < mEnergyHatches_sS; i++) {
|
||||
if (this.mEnergyHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
if (this.mOutputHatches != null) {
|
||||
int mOutputHatches_sS=this.mOutputHatches.size();
|
||||
for (int i = 0; i < mOutputHatches_sS; i++) {
|
||||
if (this.mOutputHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
int mOutputHatches_sS = this.mOutputHatches.size();
|
||||
for (int i = 0; i < mOutputHatches_sS; i++) {
|
||||
if (this.mOutputHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
if (this.mInputHatches != null) {
|
||||
int mInputHatches_sS=this.mInputHatches.size();
|
||||
for (int i = 0; i < mInputHatches_sS; i++) {
|
||||
if (this.mInputHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
int mInputHatches_sS = this.mInputHatches.size();
|
||||
for (int i = 0; i < mInputHatches_sS; i++) {
|
||||
if (this.mInputHatches.get(i).mTier < tier())
|
||||
return false;
|
||||
}
|
||||
mWrench = true;
|
||||
mScrewdriver = true;
|
||||
|
|
|
@ -288,13 +288,11 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
|||
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
|
||||
List<ItemStack> overStacks = new ArrayList<ItemStack>();
|
||||
for (int f = 0; f < tOut.length; f++) {
|
||||
if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
|
||||
while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
|
||||
ItemStack tmp = tOut[f].copy();
|
||||
tmp.stackSize = tmp.getMaxStackSize();
|
||||
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
|
||||
overStacks.add(tmp);
|
||||
}
|
||||
while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
|
||||
ItemStack tmp = tOut[f].copy();
|
||||
tmp.stackSize = tmp.getMaxStackSize();
|
||||
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
|
||||
overStacks.add(tmp);
|
||||
}
|
||||
}
|
||||
if (overStacks.size() > 0) {
|
||||
|
|
Loading…
Reference in a new issue