diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java | 183 |
1 files changed, 11 insertions, 172 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java index 2f48be57ec..329177a4a4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java @@ -206,7 +206,7 @@ public abstract class GregtechMetaTileEntity_Cyclotron extends GT_MetaTileEntity } public int getCasingMeta() { - return 8; + return 0; } public Block getCyclotronCoil() { @@ -214,19 +214,18 @@ public abstract class GregtechMetaTileEntity_Cyclotron extends GT_MetaTileEntity } public int getCyclotronCoilMeta() { - return 7; + return 0; } @Override public String[] getDescription() { return new String[]{ - "A SUN DOWN ON EARTH", - "Cyclotron Machine Casings MK II around Cyclotron Coil Blocks", + "Super Magnetic Speed Shooter", + "Cyclotron Machine Casings around Cyclotron Coil Blocks", "2-16 Input Hatches", "1-16 Output Hatches", "1-16 Energy Hatches", - "All Hatches must be UV or better", - "8192EU/t and 40mio EU Cap per Energy Hatch"}; + "All Hatches must be ZPM or better"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -243,192 +242,32 @@ public abstract class GregtechMetaTileEntity_Cyclotron extends GT_MetaTileEntity return sTexture; } - public abstract IIconContainer getIconOverlay(); + public IIconContainer getIconOverlay() { + return Textures.BlockIcons.OVERLAY_FUSION3; + } @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - public int overclock(int mStartEnergy) { - if (tierOverclock() == 1) { - return 1; - } - if (tierOverclock() == 2) { - return mStartEnergy < 160000000 ? 2 : 1; - } - return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1; - } - @Override public boolean checkRecipe(ItemStack aStack) { - ArrayList<FluidStack> tFluidList = getStoredFluids(); - int tFluidList_sS=tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { - if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { - tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); - } else { - tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); - break; - } - } - } - } - if (tFluidList.size() > 1) { - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCyclotronRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[]{}); - if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { - turnCasingActive(false); - this.mLastRecipe = null; - return false; - } - if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { - this.mLastRecipe = tRecipe; - this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); - this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); - this.mEfficiencyIncrease = 10000; - this.mOutputFluids = this.mLastRecipe.mFluidOutputs; - turnCasingActive(true); - mRunningOnLoad = false; - return true; - } - } return false; } - public abstract int tierOverclock(); - - public boolean turnCasingActive(boolean status) { - if (this.mEnergyHatches != null) { - for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) { - hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; - } - } - if (this.mOutputHatches != null) { - for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) { - hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; - } - } - if (this.mInputHatches != null) { - for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { - hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; - } - } - return true; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - if (mEfficiency < 0) - mEfficiency = 0; - if (mRunningOnLoad && checkMachine(aBaseMetaTileEntity, mInventory[1])) { - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - checkRecipe(mInventory[1]); - } - if (--mUpdate == 0 || --mStartUpCheck == 0) { - mInputHatches.clear(); - mInputBusses.clear(); - mOutputHatches.clear(); - mOutputBusses.clear(); - mDynamoHatches.clear(); - mEnergyHatches.clear(); - mMufflerHatches.clear(); - mMaintenanceHatches.clear(); - mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]); - } - if (mStartUpCheck < 0) { - if (mMachine) { - if (this.mEnergyHatches != null) { - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { - if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore() - && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048 * tierOverclock(), false)) { - aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true); - } - } - } - if (this.mEUStore <= 0 && mMaxProgresstime > 0) { - stopMachine(); - } - if (getRepairStatus() > 0) { - if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) { - this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true); - if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { - if (mOutputItems != null) - for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); - if (mOutputFluids != null) - for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); - mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); - mOutputItems = null; - mProgresstime = 0; - mMaxProgresstime = 0; - mEfficiencyIncrease = 0; - if (mOutputFluids != null && mOutputFluids.length > 0) { - try { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); - } catch (Exception e) { - } - } - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (aBaseMetaTileEntity.isAllowedToWork()) - checkRecipe(mInventory[1]); - } - } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { - turnCasingActive(mMaxProgresstime > 0); - if (aBaseMetaTileEntity.isAllowedToWork()) { - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (checkRecipe(mInventory[1])) { - if (this.mEUStore < this.mLastRecipe.mSpecialValue) { - mMaxProgresstime = 0; - turnCasingActive(false); - } - aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true); - } - } - if (mMaxProgresstime <= 0) - mEfficiency = Math.max(0, mEfficiency - 1000); - } - } - } else { - this.mLastRecipe = null; - stopMachine(); - } - } else { - turnCasingActive(false); - this.mLastRecipe = null; - stopMachine(); - } - } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) - | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); - aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); + } } @Override public boolean onRunningTick(ItemStack aStack) { - if (mEUt < 0) { - if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) { - this.mLastRecipe = null; - stopMachine(); - return false; - } - } - if (this.mEUStore <= 0) { - this.mLastRecipe = null; - stopMachine(); - return false; - } return true; } - public boolean drainEnergyInput(long aEU) { - return false; - } @Override public int getMaxEfficiency(ItemStack aStack) { @@ -451,7 +290,7 @@ public abstract class GregtechMetaTileEntity_Cyclotron extends GT_MetaTileEntity @Override public String[] getInfoData() { - String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III"; + String tier = tier() == 6 ? "I" : "II"; float plasmaOut = 0; int powerRequired = 0; if (this.mLastRecipe != null) { @@ -462,7 +301,7 @@ public abstract class GregtechMetaTileEntity_Cyclotron extends GT_MetaTileEntity } return new String[]{ - "Cyclotron Reactor MK "+tier, + "COMET - Compact Cyclotron MK "+tier, "EU Required: "+powerRequired+"EU/t", "Stored EU: "+mEUStore+" / "+maxEUStore(), "Plasma Output: "+plasmaOut+"L/t"}; |