From bcb325d7d544143fa41a3ae3a49284bc6a3c9c2e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 26 May 2020 19:29:40 +0100 Subject: Update GT_VolumetricFlask.java Made Flask icon handling more flexible. --- src/main/java/gregtech/common/items/GT_VolumetricFlask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index a247b09df9..79519a0ae8 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -32,12 +32,14 @@ import static ic2.core.util.LiquidUtil.*; public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContainerItem { private final int maxCapacity; + private final String unlocalFlaskName; @SideOnly(Side.CLIENT) public IIcon iconWindow; public GT_VolumetricFlask(String unlocalized, String english, int maxCapacity) { super(unlocalized, english, null); this.maxCapacity = maxCapacity; + unlocalFlaskName = unlocalized; setMaxStackSize(16); setNoRepair(); if (Loader.isModLoaded("NotEnoughItems")) { @@ -122,7 +124,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain @Override public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); - iconWindow = aIconRegister.registerIcon(RES_PATH_ITEM + "gt.Volumetric_Flask.window"); + iconWindow = aIconRegister.registerIcon(RES_PATH_ITEM + "gt."+unlocalFlaskName+".window"); } public void setCapacity(ItemStack stack, int capacity) { @@ -287,4 +289,4 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain } return false; } -} \ No newline at end of file +} -- cgit From 2ac85af0eca2352d5fc9d8d21c1b8ce03823bfed Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 27 May 2020 12:14:06 +0200 Subject: Unified Large Chem reactor OC related #294 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../GT_MetaTileEntity_MultiBlockBase.java | 82 +++++++++++----------- .../GT_MetaTileEntity_LargeChemicalReactor.java | 32 ++++----- 2 files changed, 55 insertions(+), 59 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 3efbe0d57b..c6828c707e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -1,10 +1,5 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; - -import java.util.ArrayList; - import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -29,6 +24,11 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.VN; + public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public static boolean disableMaintenance; @@ -538,13 +538,6 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { aFirstVoltageFound = aVoltage; } else { - /** - * Calcualtes overclocked ness using long integers - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? - */ - //Long time calculation if (aFirstVoltageFound != aVoltage) { aFoundMixedDynamos = true; } @@ -559,13 +552,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } long leftToInject; - //Long EUt calculation long aVoltage; - //Isnt too low EUt check? int aAmpsToInject; int aRemainder; int ampsOnCurrentHatch; - //xEUt *= 4;//this is effect of everclocking for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : mDynamoHatches) { if (isValidMetaTileEntity(aDynamo)) { leftToInject = aEU - injected; @@ -594,51 +584,63 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } /** - * Calcualtes overclocked ness using long integers - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? + * Calcualtes the overclockedness using long integers + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + * @param maxInputVoltage - Multiblock Max input voltage + * @param perfectOC - If the Multiblock OCs perfectly, i.e. the large Chemical Reactor */ - protected void calculateOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { - byte mTier=(byte)Math.max(0,GT_Utility.getTier(maxInputVoltage)); - if(mTier==0){ + protected void calculateOverclockedNessMultiInternal(int aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); + if(mTier == 0){ //Long time calculation long xMaxProgresstime = ((long)aDuration)<<1; - if(xMaxProgresstime>Integer.MAX_VALUE-1){ + if(xMaxProgresstime > Integer.MAX_VALUE - 1){ //make impossible if too long - mEUt=Integer.MAX_VALUE-1; - mMaxProgresstime=Integer.MAX_VALUE-1; + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; }else{ - mEUt=aEUt>>2; - mMaxProgresstime=(int)xMaxProgresstime; + mEUt = aEUt >> 2; + mMaxProgresstime= (int) xMaxProgresstime; } }else{ //Long EUt calculation - long xEUt=aEUt; + long xEUt = aEUt; //Isnt too low EUt check? - long tempEUt = xEUt>=1;//this is effect of overclocking - xEUt = mMaxProgresstime==0 ? xEUt>>1 : xEUt<<2;//U know, if the time is less than 1 tick make the machine use less power + mMaxProgresstime >>= ocTimeShift;//this is effect of overclocking + xEUt = mMaxProgresstime==0 ? xEUt >> ocTimeShift : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } - if(xEUt>Integer.MAX_VALUE-1){ - mEUt = Integer.MAX_VALUE-1; - mMaxProgresstime = Integer.MAX_VALUE-1; - }else{ - mEUt = (int)xEUt; - if(mEUt==0) + if(xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if(mEUt == 0) mEUt = 1; - if(mMaxProgresstime==0) + if(mMaxProgresstime == 0) mMaxProgresstime = 1;//set time to 1 tick } } } + protected void calculateOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { + calculateOverclockedNessMultiInternal(aEUt,aDuration,mAmperage,maxInputVoltage,false); + } + + protected void calculatePerfectOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { + calculateOverclockedNessMultiInternal(aEUt,aDuration,mAmperage,maxInputVoltage,true); + } + public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index 42b8a51153..13764b928e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -115,30 +115,24 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu FluidStack[] fluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if (inputs.length > 0 || fluids.length > 0) { - long voltage = getMaxInputVoltage(); - byte tier = (byte) Math.max(1, GT_Utility.getTier(voltage)); - GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, + long tVoltage = getMaxInputVoltage(); + byte tier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, false, gregtech.api.enums.GT_Values.V[tier], fluids, inputs); - if (recipe != null && recipe.isRecipeInputEqual(true, fluids, inputs)) { + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, fluids, inputs)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - int EUt = recipe.mEUt; - int maxProgresstime = recipe.mDuration; - - while (EUt <= gregtech.api.enums.GT_Values.V[tier - 1] && maxProgresstime > 2) { - EUt *= 4; - maxProgresstime /= 4; - } - if (maxProgresstime < 2) { - maxProgresstime = 2; - EUt = recipe.mEUt * recipe.mDuration / 2; + calculatePerfectOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); } - - this.mEUt = -EUt; - this.mMaxProgresstime = maxProgresstime; - this.mOutputItems = recipe.mOutputs; - this.mOutputFluids = recipe.mFluidOutputs; + + this.mOutputItems = tRecipe.mOutputs; + this.mOutputFluids = tRecipe.mFluidOutputs; this.updateSlots(); return true; } -- cgit From 800347180d8124d348332045d1d9f4e7b8a74319 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 27 May 2020 12:26:02 +0100 Subject: Update GT_VolumetricFlask.java Fixed missing annotation, prevents crashing Server Side if class is accessed reflectively. --- src/main/java/gregtech/common/items/GT_VolumetricFlask.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index 79519a0ae8..d0132b1fdd 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -122,6 +122,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain } @Override + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); iconWindow = aIconRegister.registerIcon(RES_PATH_ITEM + "gt."+unlocalFlaskName+".window"); -- cgit From e4bd293915ea20359dc228a623c08f7a1055d843 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Mon, 1 Jun 2020 17:02:56 +0200 Subject: Added gui's for the rest of em covers. --- src/main/java/gregtech/api/gui/GT_GUICover.java | 11 +- .../java/gregtech/api/gui/widgets/GT_GuiIcon.java | 1 + .../gregtech/api/gui/widgets/GT_GuiIconButton.java | 12 +- .../api/gui/widgets/GT_GuiIconCheckButton.java | 31 ++ .../api/gui/widgets/GT_GuiIntegerTextBox.java | 12 + src/main/java/gregtech/api/util/GT_Utility.java | 58 ++++ .../java/gregtech/common/covers/GT_Cover_Arm.java | 360 ++++++++++++++++++++- .../common/covers/GT_Cover_ControlsWork.java | 80 +++++ .../gregtech/common/covers/GT_Cover_Conveyor.java | 126 ++++++++ .../gregtech/common/covers/GT_Cover_DoesWork.java | 123 ++++++- .../gregtech/common/covers/GT_Cover_EUMeter.java | 111 +++++++ .../common/covers/GT_Cover_Fluidfilter.java | 4 +- .../gregtech/common/covers/GT_Cover_ItemMeter.java | 245 +++++++++++++- .../common/covers/GT_Cover_LiquidMeter.java | 88 ++++- .../common/covers/GT_Cover_NeedMaintainance.java | 120 +++++++ .../common/covers/GT_Cover_PlayerDetector.java | 80 +++++ .../java/gregtech/common/covers/GT_Cover_Pump.java | 2 +- .../covers/GT_Cover_RedstoneWirelessBase.java | 119 +++++++ .../gregtech/common/covers/GT_Cover_Shutter.java | 82 +++++ .../assets/gregtech/textures/gui/GuiButtons.png | Bin 9499 -> 9910 bytes 20 files changed, 1625 insertions(+), 40 deletions(-) create mode 100644 src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/gui/GT_GUICover.java b/src/main/java/gregtech/api/gui/GT_GUICover.java index 94346186a8..f1232c9432 100644 --- a/src/main/java/gregtech/api/gui/GT_GUICover.java +++ b/src/main/java/gregtech/api/gui/GT_GUICover.java @@ -157,8 +157,10 @@ public abstract class GT_GUICover extends GuiScreen implements GT_IToolTipRender public void mouseClicked(int x, int y, int button) { for (GT_GuiIntegerTextBox tBox : textBoxes) { boolean hadFocus = tBox.isFocused(); - tBox.mouseClicked(x,y,button); - if (tBox.isFocused() && button == 1) //rightclick -> lcear it + if (tBox.isEnabled() || hadFocus) + tBox.mouseClicked(x,y,button); + + if (tBox.isFocused() && button == 1 && tBox.isEnabled()) //rightclick -> lcear it tBox.setText("0"); else if (hadFocus && !tBox.isFocused()) applyTextBox(tBox); @@ -193,6 +195,9 @@ public abstract class GT_GUICover extends GuiScreen implements GT_IToolTipRender return; } } + if (textBoxes.size() > 0 ) + setFocusedTextBox(textBoxes.get(0)); + return; } if (focusedTextBox != null && focusedTextBox.textboxKeyTyped(c, key)){ @@ -239,7 +244,7 @@ public abstract class GT_GUICover extends GuiScreen implements GT_IToolTipRender */ private void setFocusedTextBox(GT_GuiIntegerTextBox boxToFocus) { for (GT_GuiIntegerTextBox textBox : textBoxes) { - textBox.setFocused(textBox.equals(boxToFocus)); + textBox.setFocused(textBox.equals(boxToFocus) && textBox.isEnabled()); } } public void applyTextBox(GT_GuiIntegerTextBox box) { diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java index 1c31462e62..41e851054d 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java @@ -18,6 +18,7 @@ public enum GT_GuiIcon { CROSS (0, 32*4, 32), WHITELIST (0, 32*5, 32), BLACKLIST (0, 32*6, 32), + PROGRESS (0, 32*7, 32), EXPORT (0, 0, 32*2), IMPORT (0, 32, 32*2), diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java index f68962f58f..e081c4227d 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java @@ -12,7 +12,7 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen protected GT_GuiIcon icon; private int x0, y0; - private IGuiScreen gui; + protected IGuiScreen gui; private String[] tooltipText; private GT_GuiTooltip tooltip; @@ -56,7 +56,7 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen int x = xPosition; int y = yPosition; if(!this.field_146123_n) { - GL11.glColor4f(200F/255F, 210F/255F, 1, 1); + // GL11.glColor4f(200F/255F, 210F/255F, 1, 1); } else GL11.glColor4f(1, 1, 1, 1); @@ -84,13 +84,17 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen return GT_GuiIcon.BUTTON_DISABLED; if (this.equals(this.gui.getSelectedButton())) return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT_DOWN : GT_GuiIcon.BUTTON_DOWN; - else - return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT : GT_GuiIcon.BUTTON_NORMAL; + + return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT : GT_GuiIcon.BUTTON_NORMAL; } public GT_GuiIcon getIcon() { return icon; } + public GT_GuiIconButton setIcon(GT_GuiIcon icon) { + this.icon = icon; + return this; + } public GT_GuiTooltip getTooltip() { return tooltip; diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java new file mode 100644 index 0000000000..4e6fd86f55 --- /dev/null +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java @@ -0,0 +1,31 @@ +package gregtech.api.gui.widgets; + +import gregtech.api.interfaces.IGuiScreen; + +public class GT_GuiIconCheckButton extends GT_GuiIconButton { + private GT_GuiIcon checkedIcon, normalIcon; + private boolean checked = false; + + public GT_GuiIconCheckButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon checkedIcon, GT_GuiIcon normalIcon) { + super(gui, id, x, y, normalIcon); + this.checkedIcon = checkedIcon; + this.normalIcon = normalIcon; + } + + public GT_GuiIcon getButtonTexture(boolean mouseOver) { + if (!enabled) + return GT_GuiIcon.BUTTON_DISABLED; + if (this.equals(super.gui.getSelectedButton())) + return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT_DOWN : GT_GuiIcon.BUTTON_DOWN; + return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT : GT_GuiIcon.BUTTON_NORMAL; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + super.setIcon(checked ? checkedIcon : normalIcon); + this.checked = checked; + } +} diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java index 3f6fe64e73..e2ba53e4c9 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java @@ -10,6 +10,7 @@ public class GT_GuiIntegerTextBox extends GuiTextField implements IGuiScreen.IGu private final int x0, y0; private final IGuiScreen gui; public final int id; + private boolean enabled; public GT_GuiIntegerTextBox(IGuiScreen gui, int id, int x, int y, int width, int height) { super(Minecraft.getMinecraft().fontRenderer, x, y, width, height); @@ -18,6 +19,7 @@ public class GT_GuiIntegerTextBox extends GuiTextField implements IGuiScreen.IGu x0 = x; y0 = y; this.gui = gui; + enabled = true; gui.addElement(this); } @@ -47,4 +49,14 @@ public class GT_GuiIntegerTextBox extends GuiTextField implements IGuiScreen.IGu } return false; } + + @Override + public void setEnabled(boolean p_146184_1_) { + super.setEnabled(p_146184_1_); + enabled = p_146184_1_; + } + + public boolean isEnabled() { + return enabled; + } } diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 8584e849bb..f5dfb42a2c 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -665,6 +665,64 @@ public class GT_Utility { return 0; } + /** + * Moves Stack from Inv-Side to Inv-Slot. + * + * @return the Amount of moved Items + */ + public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + if (fromTile == null || aGrabFrom < 0 || aMinTargetStackSize <= 0 || aMaxMoveAtOnce <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMinMoveAtOnce > aMaxMoveAtOnce) + return 0; + + if (!listContainsItem(aFilter, fromTile.getStackInSlot(aGrabFrom), true, aInvertFilter) || + !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom))) + return 0; + + if (toTile instanceof IInventory) { + int[] tPutSlots = null; + if (toTile instanceof ISidedInventory) + tPutSlots = ((ISidedInventory) toTile).getAccessibleSlotsFromSide(aPutTo); + + if (tPutSlots == null) { + tPutSlots = new int[((IInventory) toTile).getSizeInventory()]; + for (int i = 0; i < tPutSlots.length; i++) tPutSlots[i] = i; + } + + byte tMovedItemCount = 0; + for (int tPutSlot : tPutSlots) { + if (isAllowedToPutIntoSlot((IInventory) toTile, tPutSlot, aPutTo, fromTile.getStackInSlot(aGrabFrom), aMaxTargetStackSize)) { + tMovedItemCount += moveStackFromSlotAToSlotB(fromTile, (IInventory) toTile, aGrabFrom, tPutSlot, aMaxTargetStackSize, aMinTargetStackSize, (byte) (aMaxMoveAtOnce - tMovedItemCount), aMinMoveAtOnce); + if (tMovedItemCount >= aMaxMoveAtOnce) { + return tMovedItemCount; + + } + } + } + if (tMovedItemCount > 0) return tMovedItemCount; + + if (aDoCheckChests && toTile instanceof TileEntityChest) { + TileEntityChest tTileEntity2 = (TileEntityChest) toTile; + if (tTileEntity2.adjacentChestChecked) { + if (tTileEntity2.adjacentChestXNeg != null) { + tMovedItemCount = moveFromSlotToSide(fromTile, tTileEntity2.adjacentChestXNeg, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, false); + } else if (tTileEntity2.adjacentChestZNeg != null) { + tMovedItemCount = moveFromSlotToSide(fromTile, tTileEntity2.adjacentChestZNeg, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, false); + } else if (tTileEntity2.adjacentChestXPos != null) { + tMovedItemCount = moveFromSlotToSide(fromTile, tTileEntity2.adjacentChestXPos, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, false); + } else if (tTileEntity2.adjacentChestZPos != null) { + tMovedItemCount = moveFromSlotToSide(fromTile, tTileEntity2.adjacentChestZPos, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, false); + } + if (tMovedItemCount > 0) return tMovedItemCount; + } + } + } + return moveStackIntoPipe(fromTile, toTile, new int[]{aGrabFrom}, (byte) 6, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, aDoCheckChests); + } + + public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + return moveFromSlotToSide(fromTile, toTile, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, true); + } + public static boolean listContainsItem(Collection aList, ItemStack aStack, boolean aTIfListEmpty, boolean aInvertFilter) { if (aStack == null || aStack.stackSize < 1) return false; if (aList == null) return aTIfListEmpty; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index 70d0340d1f..c86f80e530 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -1,10 +1,19 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiFakeItemButton; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; @@ -12,47 +21,135 @@ public class GT_Cover_Arm extends GT_CoverBehavior { public final int mTickRate; + //msb unused, 2nd : direction (1=export) + //right 15 bits: internalSlot, next 15 bits adjSlot, 0 = all, slot = -1 + protected final static int EXPORT_MASK = 0x40000000; + protected final static int SLOT_ID_MASK = 0x7FFF; + protected final static int SLOT_ID_MIN = 0; + public GT_Cover_Arm(int aTickRate) { this.mTickRate = aTickRate; } public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - if ((aCoverVariable == 0) || (((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress) aTileEntity).isAllowedToWork()))) { + if ((((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress) aTileEntity).isAllowedToWork()))) { return aCoverVariable; } - TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); - //aTileEntity.decreaseStoredEnergyUnits(1L, true); + + boolean usePower = false; if (aTileEntity.getUniversalEnergyCapacity() >= 128L) { if (aTileEntity.isUniversalEnergyStored(256L)) { - aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1), true); + usePower = true; + } else { + return aCoverVariable; } + } + + TileEntity toTile, fromTile; + int toSlot, fromSlot; + + if ((aCoverVariable & EXPORT_MASK) > 0) { + fromTile = (TileEntity) aTileEntity; + toTile = aTileEntity.getTileEntityAtSide(aSide); + fromSlot = aCoverVariable & SLOT_ID_MASK; + toSlot = (aCoverVariable>>15) & SLOT_ID_MASK; } else { - GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + fromTile = aTileEntity.getTileEntityAtSide(aSide); + toTile = (TileEntity) aTileEntity; + fromSlot = (aCoverVariable>>15) & SLOT_ID_MASK; + toSlot = aCoverVariable & SLOT_ID_MASK; } + + byte movedItems = 0; + if(fromSlot > 0 && toSlot > 0) { + if (fromTile instanceof IInventory && toTile instanceof IInventory) + movedItems = GT_Utility.moveFromSlotToSlot((IInventory) fromTile, (IInventory) toTile, fromSlot-1, toSlot-1, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + } else if (toSlot > 0) { + byte side; + if ((aCoverVariable & EXPORT_MASK) > 0) + side = aSide; + else + side = GT_Utility.getOppositeSide(aSide); + movedItems = GT_Utility.moveOneItemStackIntoSlot(fromTile, toTile, side, toSlot-1, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + } else if (fromSlot > 0) { + byte toSide; + if ((aCoverVariable & EXPORT_MASK) > 0) + toSide = aSide; + else + toSide = GT_Utility.getOppositeSide(aSide); + if (fromTile instanceof IInventory) + movedItems = GT_Utility.moveFromSlotToSide((IInventory) fromTile, toTile, fromSlot-1, toSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + } else { + byte fromSide, toSide; + if ((aCoverVariable & EXPORT_MASK) > 0) { + fromSide = aSide; + toSide = GT_Utility.getOppositeSide(aSide); + } else { + fromSide = GT_Utility.getOppositeSide(aSide); + toSide = aSide; + } + movedItems = GT_Utility.moveOneItemStack(fromTile, toTile, fromSide, toSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + } + + if (usePower) + aTileEntity.decreaseStoredEnergyUnits(4*movedItems, true); + return aCoverVariable; } public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + int step = 0; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aPlayer.isSneaking() ? 256 : 16; + step += aPlayer.isSneaking() ? 256 : 16; } else { - aCoverVariable += aPlayer.isSneaking() ? 256 : 16; + step -= aPlayer.isSneaking() ? 256 : 16; } - GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? trans("001","Puts out into adjacent Slot #") : trans("002","Grabs in for own Slot #")) + (Math.abs(aCoverVariable) - 1)); + aCoverVariable = getNewVar(aCoverVariable, step); + sendMessageToPlayer(aPlayer, aCoverVariable); return aCoverVariable; } public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable++; - } else { - aCoverVariable--; - } - GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? trans("001","Puts out into adjacent Slot #") : trans("002","Grabs in for own Slot #")) + (Math.abs(aCoverVariable) - 1)); + int step = (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) ? 1 : -1; + aCoverVariable = getNewVar(aCoverVariable, step); + sendMessageToPlayer(aPlayer, aCoverVariable); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } + private void sendMessageToPlayer(EntityPlayer aPlayer, int var) { + if ((var & EXPORT_MASK) != 0) + GT_Utility.sendChatToPlayer(aPlayer, trans("001","Puts out into adjacent Slot #") + (((var >> 15) & SLOT_ID_MASK) - 1)); + else + GT_Utility.sendChatToPlayer(aPlayer, trans("002","Grabs in for own Slot #") + ((var & SLOT_ID_MASK) - 1)); + } + + private int getNewVar(int var, int step) { + int intSlot = (var & SLOT_ID_MASK); + int adjSlot = (var >> 15) & SLOT_ID_MASK; + if ((var & EXPORT_MASK) == 0) { + int x = (intSlot + step); + if (x > SLOT_ID_MASK ) + return createVar(0, SLOT_ID_MASK, 0); + else if (x < 1) + return createVar(- step - intSlot + 1, 0, 1); + else + return createVar(0, x, 0); + } else { + int x = (adjSlot - step); + if (x > SLOT_ID_MASK ) + return createVar(SLOT_ID_MASK, 0, 1); + else if (x < 1) + return createVar(0, + step - adjSlot + 1, 0); + else + return createVar(x, 0, 1); + } + } + + private int createVar(int adjSlot, int intSlot, int export){ + return ((export & 0x1) << 30) | ((adjSlot & SLOT_ID_MASK) << 15) | (intSlot & SLOT_ID_MASK); + } + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @@ -92,4 +189,239 @@ public class GT_Cover_Arm public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return this.mTickRate; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GT_Cover_Arm.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private GT_GuiIntegerTextBox intSlot, adjSlot; + private GT_GuiFakeItemButton intSlotIcon, adjSlotIcon; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + private final String ANY_TEXT = trans("ANY", "Any"); + + private boolean export; + private int internalSlotID, adjacentSlotID; + + private final int maxIntSlot, maxAdjSlot; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + export = (coverVariable & EXPORT_MASK) > 0; + internalSlotID = (coverVariable & SLOT_ID_MASK); + adjacentSlotID = (coverVariable >> 15) & SLOT_ID_MASK; + + new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT).setTooltipText(trans("006", "Export")); + new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT).setTooltipText(trans("007", "Import")); + + intSlot = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 2+5, 12); + setBoxText(intSlot, internalSlotID-1); + intSlot.setMaxStringLength(6); + + adjSlot = new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 2+5, 12); + setBoxText(adjSlot, adjacentSlotID-1); + adjSlot.setMaxStringLength(6); + + //intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 1, GT_GuiIcon.SLOT_GRAY); + //adjSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 2, GT_GuiIcon.SLOT_GRAY); + + if (super.tile instanceof TileEntity && !super.tile.isDead()) { + maxIntSlot = tile.getSizeInventory()-1; + + TileEntity adj = super.tile.getTileEntityAtSide(side); + if (adj instanceof IInventory) + maxAdjSlot = ((IInventory) adj).getSizeInventory()-1; + else + maxAdjSlot = -1; + } else { + maxIntSlot = -1; + maxAdjSlot = -1; + } + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + if (export) + this.getFontRenderer().drawString(trans("006", "Export"), startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); + else + this.getFontRenderer().drawString(trans("007", "Import"), startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); + + this.getFontRenderer().drawString(trans("254", "Internal slot#"), startX + spaceX*3, 4+startY+spaceY*1, 0xFF555555); + this.getFontRenderer().drawString(trans("255", "Adjacent slot#"), startX + spaceX*3, 4+startY+spaceY*2, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + intSlot.setFocused(true); + updateButtons(); + + //updateInventorySlots(); + } + + @Override + public void buttonClicked(GuiButton btn) { + if (buttonClickable(btn.id)) { + export = btn.id == 0; + coverVariable = getNewCoverVariable(); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons() { + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + b.enabled = buttonClickable(b.id); + } + } + + @Override + public void onMouseWheel(int x, int y, int delta) { + for (GT_GuiIntegerTextBox box : textBoxes) { + if (box.isFocused()) { + int step = Math.max(1, Math.abs(delta / 120)); + step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); + int maxSlot = box.id == 3 ? maxAdjSlot : maxIntSlot; + int val = parseTextBox(box, maxSlot); + if (val < 0) + val = -1; + val = val + step; + + if (maxSlot < val) + if (maxSlot < 0) + val = -1; + else + val = maxSlot; + else if (val < SLOT_ID_MIN) + val = -1; + + setBoxText(box, val); + return; + } + } + } + + @Override + public void applyTextBox(GT_GuiIntegerTextBox box) { + int val = -1; + + if (box.id == 2) { + val = parseTextBox(box, maxIntSlot); + internalSlotID = val+1; + } + else if (box.id == 3) { + val = parseTextBox(box, maxAdjSlot); + adjacentSlotID = val+1; + } + + setBoxText(box, val); + coverVariable = getNewCoverVariable(); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + //updateInventorySlots(); + } + + @Override + public void resetTextBox(GT_GuiIntegerTextBox box) { + int val = 0; + if (box.id == 2) + val = internalSlotID-1; + else if (box.id == 3) + val = adjacentSlotID-1; + setBoxText(box, val); + } + + private void setBoxText(GT_GuiIntegerTextBox box, int val) { + box.setText( val < 0 ? ANY_TEXT : String.valueOf(val)); + } + + private int parseTextBox(GT_GuiIntegerTextBox box, int maxSlot) { + String text = box.getText(); + if (text == null) + return -1; + text = text.trim(); + if (text.startsWith(ANY_TEXT)) + text = text.substring(ANY_TEXT.length()); + + if (text.isEmpty()) + return -1; + + int val; + try { + val = Integer.parseInt(text); + } catch (NumberFormatException e) { + return -1; + } + + if (maxSlot < val) + if (maxSlot < 0) + return -1; + else + return maxSlot; + else if (val < SLOT_ID_MIN) + return SLOT_ID_MIN; + return val; + } + + private int getNewCoverVariable() { + return (export ? EXPORT_MASK : 0) | ((adjacentSlotID & SLOT_ID_MASK) << 15) | (internalSlotID & SLOT_ID_MASK); + } + + private boolean buttonClickable(int id) { + if (id == 0) + return !export; + return export; + } + +// getStackInSlot wasn't available client side.. +// private void updateInventorySlots() { +// updateInventorySlot(intSlotIcon, internalSlotID, true); +// updateInventorySlot(adjSlotIcon, adjacentSlotID, false); +// } +// +// private void updateInventorySlot(GT_GuiFakeItemButton button, int slotID, boolean internal) { +// if (slotID == SLOT_ID_ANY) { +// button.setItem(null); +// return; +// } +// +// if (super.tile instanceof TileEntity && !super.tile.isDead()) { +// TileEntity tile; +// if (internal) +// tile = (TileEntity) super.tile; +// else +// tile = super.tile.getTileEntityAtSide(side); +// +// if (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() >= slotID) { +// ItemStack item = ((IInventory) tile).getStackInSlot(slotID); +// button.setItem(item); +// return; +// } +// } +// button.setItem(null); +// } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index 96a2d4a2b8..9624b68464 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -1,9 +1,15 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; @@ -70,4 +76,78 @@ public class GT_Cover_ControlsWork public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GT_Cover_ControlsWork.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GuiButton b; + b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.REDSTONE_ON); + b = new GT_GuiIconButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF); + b = new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CROSS); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.fontRendererObj.drawString(trans("243", "Enable with Redstone"), 3+startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(trans("244", "Disable with Redstone"),3+startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(trans("245", "Disable machine"), 3+startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn) { + if (getClickable(btn.id)) { + coverVariable = getNewCoverVariable(btn.id); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons() { + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + b.enabled = getClickable(b.id); + } + } + + private int getNewCoverVariable(int id) { + return id; + } + + private boolean getClickable(int id) { + return id != coverVariable; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index d781f10915..303f358a34 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -1,9 +1,15 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; @@ -112,4 +118,124 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return this.mTickRate; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GT_Cover_Conveyor.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GT_GuiIconButton b; + b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(trans("006","Export")); + b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(trans("007","Import")); + b = new GT_GuiIconButton(this, 2, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK).setTooltipText(trans("224","Ignore")); + b = new GT_GuiIconButton(this, 3, startX + spaceX*1, startY+spaceY*1, GT_GuiIcon.REDSTONE_ON).setTooltipText(trans("225","Conditional")); + b = new GT_GuiIconButton(this, 4, startX + spaceX*2, startY+spaceY*1, GT_GuiIcon.REDSTONE_OFF).setTooltipText(trans("226","Invert Condition")); + b = new GT_GuiIconButton(this, 5, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.ALLOW_INPUT).setTooltipText(trans("227","Allow Input")); + b = new GT_GuiIconButton(this, 6, startX + spaceX*1, startY+spaceY*2, GT_GuiIcon.BLOCK_INPUT).setTooltipText(trans("228","Block Input")); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.fontRendererObj.drawString(trans("229","Import/Export" ), startX + spaceX*3, 3+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(trans("230","Conditional"), startX + spaceX*3, 3+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(trans("231", "Enable Input"), startX + spaceX*3, 3+startY+spaceY*2, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (getClickable(btn.id)){ + coverVariable = getNewCoverVariable(btn.id); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + b.enabled = getClickable(b.id); + } + } + + private int getNewCoverVariable(int id) { + switch (id) { + case 0: + return coverVariable & ~0x1; + case 1: + return coverVariable | 0x1; + case 2: + if (coverVariable > 5) + return 0x6 | (coverVariable & ~0xE); + return (coverVariable & ~0xE); + case 3: + if (coverVariable > 5) + return 0x8 | (coverVariable & ~0xE); + return 0x2 | (coverVariable & ~0xE); + case 4: + if (coverVariable > 5) + return 0xA | (coverVariable & ~0xE); + return (0x4 | (coverVariable & ~0xE)); + case 5: + if (coverVariable <= 5) + return coverVariable + 6; + break; + case 6: + if (coverVariable > 5) + return coverVariable - 6; + } + return coverVariable; + } + + private boolean getClickable(int id) { + if (coverVariable < 0 | 11 < coverVariable) + return false; + + switch (id) { + case 0: case 1: + return (0x1 & coverVariable) != id; + case 2: + return (coverVariable % 6) >= 2; + case 3: + return (coverVariable % 6) < 2 | 4 <= (coverVariable % 6); + case 4: + return (coverVariable % 6) < 4; + case 5: + return coverVariable < 6; + case 6: + return coverVariable >= 6; + } + return false; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index 963b519f34..f2a37dd3cc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -1,9 +1,16 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; @@ -31,10 +38,10 @@ public class GT_Cover_DoesWork aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4; if(aCoverVariable <0){aCoverVariable = 3;} switch(aCoverVariable) { - case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("018", "Normal")); break; - case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("019", "Inverted")); break; - case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("020", "Ready to work")); break; - case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("021", "Not ready to work")); break; + case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("018", "Normal")); break; // Progress scaled + case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("019", "Inverted")); break; // ^ inverted + case 2: GT_Utility.sendChatToPlayer(aPlayer, trans("020", "Ready to work")); break; // Not Running + case 3: GT_Utility.sendChatToPlayer(aPlayer, trans("021", "Not ready to work")); break; // Running } return aCoverVariable; } @@ -70,4 +77,112 @@ public class GT_Cover_DoesWork public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GT_Cover_DoesWork.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GuiButton b; + b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.PROGRESS); + b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.CHECKMARK); + b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + String s1, s2; + if ((coverVariable & 0x2) > 0) + s1 = trans("242", "Machine idle"); + else + s1 = trans("241", "Recipe progress"); + if ((coverVariable & 0x1) > 0) + s2 = trans("INVERTED","Inverted"); + else + s2 = trans("NORMAL","Normal"); + this.fontRendererObj.drawString(s1, startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(s2, startX + spaceX*3, 4+startY+spaceY*1, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (getClickable(btn.id)){ + boolean state = false; + if (btn.id == 2) + state = ((GT_GuiIconCheckButton) btn).isChecked(); + + coverVariable = getNewCoverVariable(btn.id, state); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + if(b.id == 2){ + ((GT_GuiIconCheckButton) b).setChecked((coverVariable & 0x1) > 0); + } else { + b.enabled = getClickable(b.id); + } + } + } + + private int getNewCoverVariable(int id, boolean buttonState) { + switch (id) { + case 0: + return coverVariable & ~0x2; + case 1: + return coverVariable | 0x2; + case 2: + if (buttonState) + return coverVariable & ~0x1; + return coverVariable | 0x1; + } + return coverVariable; + } + + private boolean getClickable(int id) { + switch (id) { + case 0: + return (coverVariable & 0x2) > 0; + case 1: + return (coverVariable & 0x2) == 0; + case 2: + return true; + } + return false; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 13aafe90df..35dcd9f6b4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -1,14 +1,20 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import ic2.api.item.IElectricItem; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -141,4 +147,109 @@ public class GT_Cover_EUMeter public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GuiButton b; + b = new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("031", "Normal Universal Storage")); + b = new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("033", "Normal Electricity Storage")); + b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("035", "Normal Steam Storage")); + b = new GT_GuiIconCheckButton(this, 3, startX + spaceX*4, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("037", "Normal Average Electric Input")); + b = new GT_GuiIconCheckButton(this, 4, startX + spaceX*4, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("039", "Normal Average Electric Output")); + b = new GT_GuiIconCheckButton(this, 5, startX + spaceX*4, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("041", "Normal Electricity Storage(Including Batteries)")); + b = new GT_GuiIconCheckButton(this, 6, startX + spaceX*0, startY+spaceY*3+4, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + String s2; + if ((coverVariable & 0x1) > 0) + s2 = trans("INVERTED","Inverted"); + else + s2 = trans("NORMAL","Normal"); + this.fontRendererObj.drawString(s2, startX + spaceX*1, 8+startY+spaceY*3, 0xFF555555); + + this.fontRendererObj.drawString("Universal", + startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString("Int. EU", + startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString("Steam", + startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + this.fontRendererObj.drawString("Avg. Input", + startX + spaceX*5, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString("Avg. Output", + startX + spaceX*5, 4+startY+spaceY*2, 0xFF555555); + this.fontRendererObj.drawString("EU stored", + startX + spaceX*5, 4+startY+spaceY*0, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (btn.id == 6 || !isEnabled(btn.id)){ + coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + for (Object o : buttonList) + ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); + } + + private int getNewCoverVariable(int id, boolean checked) { + if (id == 6) { + if (checked) + return coverVariable & ~0x1; + else + return coverVariable | 0x1; + } + return (coverVariable & 0x1) | (id << 1) ; + } + + private boolean isEnabled(int id) { + if (id == 6) + return (coverVariable & 0x1) > 0; + return (coverVariable >> 1) == id; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index 0a213bb844..bc966d3f54 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -184,8 +184,8 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { this.coverVariable = aCoverVariable; GT_GuiIconButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(trans("232","Filter Input")); - b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(trans("233","Filter Output")); + b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(trans("232","Filter Input")); + b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(trans("233","Filter Output")); b = new GT_GuiIconButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.BLOCK_INPUT).setTooltipText(trans("234", "Block Output")); b = new GT_GuiIconButton(this, 3, startX + spaceX*1, startY+spaceY*2, GT_GuiIcon.ALLOW_INPUT).setTooltipText(trans("235", "Allow Output")); b = new GT_GuiIconButton(this, 4, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.WHITELIST).setTooltipText(trans("236","Whitelist Fluid")); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 40706721c9..063788d50f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -1,20 +1,33 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiFakeItemButton; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; public class GT_Cover_ItemMeter extends GT_CoverBehavior { + + // left bit (normal/invert) + // >> 1: 0=all items, else slot-1 + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { int[] tSlots; - if (aCoverVariable < 2) { + if ((aCoverVariable & 0x2) > 0) { tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); } else { - tSlots = new int[]{aCoverVariable - 2}; + tSlots = new int[]{(aCoverVariable >> 1) - 1}; } int tMax = 0; int tUsed = 0; @@ -26,22 +39,52 @@ public class GT_Cover_ItemMeter tUsed += (tStack.stackSize<<6)/tStack.getMaxStackSize(); } } + + boolean inverted = (aCoverVariable & 0x1)>0; if(tUsed==0)//nothing - aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 15 : 0)); + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(inverted ? 15 : 0)); else if(tUsed >= tMax)//full - aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 0 : 15)); + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(inverted ? 0 : 15)); else//1-14 range - aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 14-((14*tUsed)/tMax) : 1+((14*tUsed)/tMax)) ); + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(inverted ? 14-((14*tUsed)/tMax) : 1+((14*tUsed)/tMax)) ); return aCoverVariable; } public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (2 + aTileEntity.getSizeInventory()); - switch(aCoverVariable) { - case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break; - case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break; - default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable - 2)); break; + if (aPlayer.isSneaking()) { + if ((0x1 & aCoverVariable)>0) { + aCoverVariable = aCoverVariable & ~0x1; + GT_Utility.sendChatToPlayer(aPlayer, trans("NORMAL","Normal")); + } + else { + aCoverVariable = aCoverVariable | 0x1; + GT_Utility.sendChatToPlayer(aPlayer, trans("INVERTED","Inverted")); + } + return aCoverVariable; } + + int val = aCoverVariable >> 1; + int lsb = aCoverVariable & 0x1; + + if (val < 0) + aCoverVariable = lsb; + else + aCoverVariable = ((val + 1) << 1) | lsb; + + if ((aCoverVariable >> 1) > aTileEntity.getSizeInventory()) + aCoverVariable = lsb; + + if ((aCoverVariable >> 1) == 0) + GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + trans("ALL", "All")); + else + GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + ((aCoverVariable >> 1) - 1)); + + //aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (aTileEntity.getSizeInventory() + 2); + //switch(aCoverVariable) { + // case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break; + // case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break; + // default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable >> 1)); break; + //} return aCoverVariable; } @@ -76,4 +119,186 @@ public class GT_Cover_ItemMeter public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private final GT_GuiIconCheckButton button; + private final GT_GuiIntegerTextBox intSlot; + private final GT_GuiFakeItemButton intSlotIcon; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + private final int maxSlot; + + private final String ALL = trans("ALL", "All"); + private final String INVERTED = trans("INVERTED","Inverted"); + private final String NORMAL = trans("NORMAL","Normal"); + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + button = new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + + intSlot = new GT_GuiIntegerTextBox(this, 1, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 2+5, 12); + intSlot.setMaxStringLength(6); + + //only shows if opened gui of block sadly, should've used container. + intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 1, GT_GuiIcon.SLOT_GRAY); + + if (tile instanceof TileEntity && !super.tile.isDead()) + maxSlot = tile.getSizeInventory() - 1; + else + maxSlot = -1; + + if (maxSlot == -1) + intSlot.setEnabled(false); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + if ((coverVariable & 0x1) > 0) + this.getFontRenderer().drawString(INVERTED, startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); + else + this.getFontRenderer().drawString(NORMAL, startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); + + this.getFontRenderer().drawString(trans("254", "Internal slot#"), startX + spaceX*3, 4+startY+spaceY*1, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + update(); + if (intSlot.isEnabled()) + intSlot.setFocused(true); + } + + @Override + public void buttonClicked(GuiButton btn) { + if (isInverted()) + coverVariable = (coverVariable & ~0x1); + else + coverVariable = (coverVariable | 0x1); + + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + update(); + } + + private void update() { + resetTextBox(intSlot); + button.setChecked(isInverted()); + + int slot = getSlot(); + if (slot < 0) { + intSlotIcon.setItem(null); + return; + } + if (tile instanceof TileEntity && !super.tile.isDead()) { + if (tile.getSizeInventory() >= slot) { + ItemStack item = tile.getStackInSlot(slot); + intSlotIcon.setItem(item); + return; + } + } + intSlotIcon.setItem(null); + } + + @Override + public void onMouseWheel(int x, int y, int delta) { + for (GT_GuiIntegerTextBox box : textBoxes) { + if (box.isFocused()) { + int step = Math.max(1, Math.abs(delta / 120)); + step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); + int val = parseTextBox(box); + + if (val < 0) + val = -1; + + val = val + step; + + if (val < 0) + val = -1; + else if (val > maxSlot ) + val = maxSlot; + + box.setText(val < 0 ? ALL : String.valueOf(val)); + return; + } + } + } + + @Override + public void applyTextBox(GT_GuiIntegerTextBox box) { + int val = parseTextBox(box); + + if (val < 0) + coverVariable = coverVariable & 0x1; + else + coverVariable = ((val+1) << 1) | (coverVariable & 0x1); + + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + update(); + } + + @Override + public void resetTextBox(GT_GuiIntegerTextBox box) { + box.setText(getSlot() < 0 ? ALL : String.valueOf(getSlot())); + } + + private int parseTextBox(GT_GuiIntegerTextBox box) { + String text = box.getText(); + if (text == null) + return -1; + text = text.trim(); + if (text.startsWith(ALL)) + text = text.substring(ALL.length()); + + if (text.isEmpty()) + return -1; + + int val; + try { + val = Integer.parseInt(text); + } catch (NumberFormatException e) { + return -1; + } + + if (val < 0) + return -1; + else if (maxSlot < val) + return maxSlot; + return val; + } + + private boolean isInverted() { + return ((coverVariable & 0x1) > 0); + } + + private int getSlot() { + if ((coverVariable & ~0x1) == 0) + return -1; + return (coverVariable >> 1) - 1; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 5a0bb2e7d2..9ca2f77d62 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -1,8 +1,14 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; @@ -42,9 +48,9 @@ public class GT_Cover_LiquidMeter public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, trans("054", "Inverted")); - } else { GT_Utility.sendChatToPlayer(aPlayer, trans("055", "Normal")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, trans("054", "Inverted")); } return aCoverVariable == 0 ? 1 : 0; } @@ -80,4 +86,82 @@ public class GT_Cover_LiquidMeter public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + String s2; + if (coverVariable == 0) + s2 = trans("INVERTED","Inverted"); + else + s2 = trans("NORMAL","Normal"); + + this.fontRendererObj.drawString(s2, startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + boolean state = false; + if (btn.id == 0) + state = ((GT_GuiIconCheckButton) btn).isChecked(); + + coverVariable = getNewCoverVariable(btn.id, state); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + updateButtons(); + } + + private void updateButtons(){ + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + if(b.id == 0) + ((GT_GuiIconCheckButton) b).setChecked(coverVariable == 0); + } + } + + private int getNewCoverVariable(int id, boolean buttonState) { + if (id == 0) { + if (buttonState) + return coverVariable | 0x1; + else + return coverVariable & ~0x1; + } + return coverVariable; + } + } } \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index 3316b204dc..43160aa908 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -1,12 +1,18 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -139,5 +145,119 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 60; } + /** + * GUI Stuff + */ + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final String[] tooltiptext = { + trans("056", "Emit if 1 Maintenance Needed"), + trans("058", "Emit if 2 Maintenance Needed"), + trans("060", "Emit if 3 Maintenance Needed"), + trans("062", "Emit if 4 Maintenance Needed"), + trans("064", "Emit if 5 Maintenance Needed"), + trans("066", "Emit if rotor needs maintenance low accuracy mod"), + trans("068", "Emit if rotor needs maintenance high accuracy mod"), + }; + + private final String[] buttontext = { + trans("247", "1 Issue"), + trans("248", "2 Issues"), + trans("249", "3 Issues"), + trans("250", "4 Issues"), + trans("251", "5 Issues"), + trans("252", "Rotor < 80%"), + trans("253", "Rotor < 100%"), + + trans("INVERTED","Inverted"), + trans("NORMAL","Normal"), + }; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GuiButton b; + b = new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[0]); + b = new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[1]); + b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[2]); + b = new GT_GuiIconCheckButton(this, 3, startX + spaceX*0, startY+spaceY*3, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[3]); + b = new GT_GuiIconCheckButton(this, 4, startX + spaceX*4 + 4, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[4]); + b = new GT_GuiIconCheckButton(this, 5, startX + spaceX*4 + 4, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[5]); + b = new GT_GuiIconCheckButton(this, 6, startX + spaceX*4 + 4, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null).setTooltipText(tooltiptext[6]); + b = new GT_GuiIconCheckButton(this, 7, startX + spaceX*4 + 4, startY+spaceY*3, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); + } + + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + + this.fontRendererObj.drawString(buttontext[0],startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(buttontext[1],startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(buttontext[2],startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + this.fontRendererObj.drawString(buttontext[3],startX + spaceX*1, 4+startY+spaceY*3, 0xFF555555); + this.fontRendererObj.drawString(buttontext[4],startX + spaceX*5 + 4, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(buttontext[5],startX + spaceX*5 + 4, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(buttontext[6],startX + spaceX*5 + 4, 4+startY+spaceY*2, 0xFF555555); + // inverted normal + String s2 = ((coverVariable & 0x1) > 0) ? buttontext[7] : buttontext[8]; + this.fontRendererObj.drawString(s2, startX + spaceX*5 + 4, 4+startY+spaceY*3, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (btn.id == 7 || !isEnabled(btn.id)){ + coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + for (Object o : buttonList) + ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); + } + + private int getNewCoverVariable(int id, boolean checked) { + if (id == 7) { + if (checked) + return coverVariable & ~0x1; + else + return coverVariable | 0x1; + } + return (coverVariable & 0x1) | (id << 1) ; + } + + private boolean isEnabled(int id) { + if (id == 7) + return (coverVariable & 0x1) > 0; + return (coverVariable >>> 1) == id; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index 9e6c764170..57f52ab42d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -1,9 +1,15 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.fluids.Fluid; @@ -94,5 +100,79 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20; } + /** + * GUI Stuff + */ + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("068", "Emit if any Player is close")); + new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("069", "Emit if other Player is close")); + new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) + .setTooltipText(trans("070", "Emit if you are close")); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.fontRendererObj.drawString("Any player", + startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString("Other players", + startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString("Only owner", + startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (!isEnabled(btn.id)){ + coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + for (Object o : buttonList) + ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); + } + + private int getNewCoverVariable(int id, boolean checked) { + return id; + } + + private boolean isEnabled(int id) { + return coverVariable == id; + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 364229f6f8..a6f7d653b9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -2,13 +2,13 @@ package gregtech.common.covers; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; -import gregtech.api.gui.widgets.GT_GuiIcon; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index a359d20aa9..1407311b88 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -1,7 +1,12 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.IGuiScreen; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; @@ -78,4 +83,118 @@ public abstract class GT_Cover_RedstoneWirelessBase public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private GT_GuiIntegerTextBox fBox; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + fBox = new GT_GuiIntegerTextBoxWithMinus(this, 2,startX + spaceX*0,startY+spaceY*0 + 2, spaceX*4-3,12); + fBox.setText(String.valueOf(coverVariable)); + fBox.setMaxStringLength(12); + + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.getFontRenderer().drawString(trans("246","Frequency" ), startX + spaceX*4, 4+startY+spaceY*0, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + fBox.setFocused(true); + } + + @Override + public void onMouseWheel(int x, int y, int delta) { + for (GT_GuiIntegerTextBox box : textBoxes){ + if (box.isFocused()) { + int step = Math.max(1, Math.abs(delta / 120)); + step = (isShiftKeyDown() ? 1000 : isCtrlKeyDown() ? 50 : 1) * (delta > 0 ? step : -step); + long i; + try { + i = Long.parseLong(box.getText()); + } catch (NumberFormatException e) { + return; + } + i = i + step; + if (i > Integer.MAX_VALUE) + i = Integer.MAX_VALUE; + else if (i < Integer.MIN_VALUE) + i = Integer.MIN_VALUE; + + box.setText(String.valueOf(i)); + return; + } + } + } + + @Override + public void applyTextBox(GT_GuiIntegerTextBox box) { + long i; + String s = box.getText().trim(); + try { + i = Long.parseLong(s); + } catch (NumberFormatException e) { + resetTextBox(box); + return; + } + + if (i > Integer.MAX_VALUE) + i = Integer.MAX_VALUE; + else if (i < Integer.MIN_VALUE) + i = Integer.MIN_VALUE; + + + coverVariable = (int) i; + fBox.setText(String.valueOf(coverVariable)); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + + @Override + public void resetTextBox(GT_GuiIntegerTextBox box) { + box.setText(String.valueOf(coverVariable)); + } + + private class GT_GuiIntegerTextBoxWithMinus extends GT_GuiIntegerTextBox { + + public GT_GuiIntegerTextBoxWithMinus(IGuiScreen gui, int id, int x, int y, int width, int height) { + super(gui, id, x, y, width, height); + } + + @Override + public boolean validChar(char c, int key) { + if (getCursorPosition() == 0 && key == 12) // minus first allowed. + return true; + return super.validChar(c, key); + } + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index b43cbe0122..b1c0c5c3af 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -1,9 +1,15 @@ package gregtech.common.covers; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; @@ -64,4 +70,80 @@ public class GT_Cover_Shutter public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 0; } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + + private final static int startX = 10; + private final static int startY = 25; + private final static int spaceX = 18; + private final static int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null); + new GT_GuiIconCheckButton(this, 3, startX + spaceX*0, startY+spaceY*3, GT_GuiIcon.CHECKMARK, null); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.fontRendererObj.drawString(trans("082", "Open if work enabled"), + 3+startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); + this.fontRendererObj.drawString(trans("083", "Open if work disabled"), + 3+startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(trans("084", "Only Output allowed"), + 3+startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + this.fontRendererObj.drawString(trans("085", "Only Input allowed"), + 3+startX + spaceX*1, 4+startY+spaceY*3, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + public void buttonClicked(GuiButton btn){ + if (!isEnabled(btn.id)){ + coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + for (Object o : buttonList) + ((GT_GuiIconCheckButton) o).setChecked(isEnabled(((GT_GuiIconCheckButton) o).id)); + } + + private int getNewCoverVariable(int id, boolean checked) { + return id; + } + + private boolean isEnabled(int id) { + return coverVariable == id; + } + } } diff --git a/src/main/resources/assets/gregtech/textures/gui/GuiButtons.png b/src/main/resources/assets/gregtech/textures/gui/GuiButtons.png index f9b1d69325..54f5230e7a 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/GuiButtons.png and b/src/main/resources/assets/gregtech/textures/gui/GuiButtons.png differ -- cgit From be33bc7e56c76eb63292dfc15efc7173c64aae41 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Mon, 1 Jun 2020 17:31:40 +0200 Subject: Check first, then commit next time --- src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 063788d50f..e9442951e2 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -24,11 +24,11 @@ public class GT_Cover_ItemMeter public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { int[] tSlots; - if ((aCoverVariable & 0x2) > 0) { - tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); - } else { + if ((aCoverVariable >> 1) > 0) tSlots = new int[]{(aCoverVariable >> 1) - 1}; - } + else + tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); + int tMax = 0; int tUsed = 0; for (int i : tSlots) { -- cgit From c041f577b7f56509dd9b4efc16eecd4571ba1f39 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Tue, 2 Jun 2020 21:56:02 +0200 Subject: Should not break existing covers now. --- .../gregtech/common/covers/GT_Cover_ItemMeter.java | 66 ++++++++++++---------- 1 file changed, 35 insertions(+), 31 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index e9442951e2..3186b94732 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -19,13 +19,24 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_ItemMeter extends GT_CoverBehavior { - // left bit (normal/invert) - // >> 1: 0=all items, else slot-1 + // format: + private static final int SLOT_MASK = 0x3FFFFFF; // 0 = all, 1 = 0 ... + private static final int CONVERTED_BIT = 0x80000000; + private static final int INVERT_BIT = 0x40000000; public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + //Convert from ver. 5.09.33.50 + if ((CONVERTED_BIT & aCoverVariable) == 0) + if (aCoverVariable == 0) + aCoverVariable = CONVERTED_BIT; + else if (aCoverVariable == 1) + aCoverVariable = CONVERTED_BIT | INVERT_BIT; + else if (aCoverVariable > 1) + aCoverVariable = CONVERTED_BIT | Math.min((aCoverVariable - 2), SLOT_MASK); + int[] tSlots; - if ((aCoverVariable >> 1) > 0) - tSlots = new int[]{(aCoverVariable >> 1) - 1}; + if ((aCoverVariable & SLOT_MASK) > 0) + tSlots = new int[]{(aCoverVariable & SLOT_MASK) - 1}; else tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); @@ -40,7 +51,7 @@ public class GT_Cover_ItemMeter } } - boolean inverted = (aCoverVariable & 0x1)>0; + boolean inverted = (aCoverVariable & INVERT_BIT) == INVERT_BIT; if(tUsed==0)//nothing aTileEntity.setOutputRedstoneSignal(aSide, (byte)(inverted ? 15 : 0)); else if(tUsed >= tMax)//full @@ -52,32 +63,25 @@ public class GT_Cover_ItemMeter public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - if ((0x1 & aCoverVariable)>0) { - aCoverVariable = aCoverVariable & ~0x1; + if ((aCoverVariable & INVERT_BIT) == INVERT_BIT) { + aCoverVariable = aCoverVariable & ~INVERT_BIT; GT_Utility.sendChatToPlayer(aPlayer, trans("NORMAL","Normal")); } else { - aCoverVariable = aCoverVariable | 0x1; + aCoverVariable = aCoverVariable | INVERT_BIT; GT_Utility.sendChatToPlayer(aPlayer, trans("INVERTED","Inverted")); } return aCoverVariable; } - int val = aCoverVariable >> 1; - int lsb = aCoverVariable & 0x1; - - if (val < 0) - aCoverVariable = lsb; - else - aCoverVariable = ((val + 1) << 1) | lsb; - - if ((aCoverVariable >> 1) > aTileEntity.getSizeInventory()) - aCoverVariable = lsb; + int slot = (aCoverVariable & SLOT_MASK) + 1; + if (slot > aTileEntity.getSizeInventory() || slot > SLOT_MASK) + slot = 0; - if ((aCoverVariable >> 1) == 0) + if (slot == 0) GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + trans("ALL", "All")); else - GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + ((aCoverVariable >> 1) - 1)); + GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (slot - 1)); //aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (aTileEntity.getSizeInventory() + 2); //switch(aCoverVariable) { @@ -85,7 +89,7 @@ public class GT_Cover_ItemMeter // case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break; // default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable >> 1)); break; //} - return aCoverVariable; + return CONVERTED_BIT | (aCoverVariable & INVERT_BIT) | slot; } public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -168,7 +172,7 @@ public class GT_Cover_ItemMeter intSlotIcon = new GT_GuiFakeItemButton(this, startX + spaceX * 8-4, startY + spaceY * 1, GT_GuiIcon.SLOT_GRAY); if (tile instanceof TileEntity && !super.tile.isDead()) - maxSlot = tile.getSizeInventory() - 1; + maxSlot = Math.min(tile.getSizeInventory() - 1, SLOT_MASK-1); else maxSlot = -1; @@ -197,9 +201,9 @@ public class GT_Cover_ItemMeter @Override public void buttonClicked(GuiButton btn) { if (isInverted()) - coverVariable = (coverVariable & ~0x1); + coverVariable = (coverVariable & ~INVERT_BIT); else - coverVariable = (coverVariable | 0x1); + coverVariable = (coverVariable | INVERT_BIT); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); update(); @@ -252,10 +256,10 @@ public class GT_Cover_ItemMeter public void applyTextBox(GT_GuiIntegerTextBox box) { int val = parseTextBox(box); - if (val < 0) - coverVariable = coverVariable & 0x1; - else - coverVariable = ((val+1) << 1) | (coverVariable & 0x1); + if (val >= 0) + coverVariable = val + 1; + + coverVariable = coverVariable | CONVERTED_BIT | (coverVariable & INVERT_BIT); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); update(); @@ -292,13 +296,13 @@ public class GT_Cover_ItemMeter } private boolean isInverted() { - return ((coverVariable & 0x1) > 0); + return ((coverVariable & INVERT_BIT) == 0); } private int getSlot() { - if ((coverVariable & ~0x1) == 0) + if ((coverVariable & SLOT_MASK) == 0) return -1; - return (coverVariable >> 1) - 1; + return (coverVariable & SLOT_MASK) - 1; } } } -- cgit From f4d55b721efe29faadde20a616bf04daca19e4e1 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Tue, 2 Jun 2020 21:56:52 +0200 Subject: Not for the arm either ... --- .../java/gregtech/common/covers/GT_Cover_Arm.java | 39 +++++++++++++--------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index c86f80e530..77558e001d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -20,12 +20,12 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Arm extends GT_CoverBehavior { public final int mTickRate; - - //msb unused, 2nd : direction (1=export) - //right 15 bits: internalSlot, next 15 bits adjSlot, 0 = all, slot = -1 + //msb converted, 2nd : direction (1=export) + //right 14 bits: internalSlot, next 14 bits adjSlot, 0 = all, slot = -1 protected final static int EXPORT_MASK = 0x40000000; - protected final static int SLOT_ID_MASK = 0x7FFF; + protected final static int SLOT_ID_MASK = 0x3FFF; protected final static int SLOT_ID_MIN = 0; + protected final static int CONVERTED_BIT = 0x80000000; public GT_Cover_Arm(int aTickRate) { this.mTickRate = aTickRate; @@ -36,6 +36,13 @@ public class GT_Cover_Arm return aCoverVariable; } + //Convert from ver. 5.09.33.50, check if 3 last bits are equal + if ((aCoverVariable >>> 29) == 0) { + aCoverVariable = CONVERTED_BIT | (((aCoverVariable+1) & SLOT_ID_MASK) << 14) | EXPORT_MASK; + } else if ((aCoverVariable >>> 29) == 7) { + aCoverVariable = CONVERTED_BIT | Math.min(Math.abs(aCoverVariable-1), SLOT_ID_MASK); + } + boolean usePower = false; if (aTileEntity.getUniversalEnergyCapacity() >= 128L) { if (aTileEntity.isUniversalEnergyStored(256L)) { @@ -52,11 +59,11 @@ public class GT_Cover_Arm fromTile = (TileEntity) aTileEntity; toTile = aTileEntity.getTileEntityAtSide(aSide); fromSlot = aCoverVariable & SLOT_ID_MASK; - toSlot = (aCoverVariable>>15) & SLOT_ID_MASK; + toSlot = (aCoverVariable>>14) & SLOT_ID_MASK; } else { fromTile = aTileEntity.getTileEntityAtSide(aSide); toTile = (TileEntity) aTileEntity; - fromSlot = (aCoverVariable>>15) & SLOT_ID_MASK; + fromSlot = (aCoverVariable>>14) & SLOT_ID_MASK; toSlot = aCoverVariable & SLOT_ID_MASK; } @@ -119,35 +126,35 @@ public class GT_Cover_Arm private void sendMessageToPlayer(EntityPlayer aPlayer, int var) { if ((var & EXPORT_MASK) != 0) - GT_Utility.sendChatToPlayer(aPlayer, trans("001","Puts out into adjacent Slot #") + (((var >> 15) & SLOT_ID_MASK) - 1)); + GT_Utility.sendChatToPlayer(aPlayer, trans("001","Puts out into adjacent Slot #") + (((var >> 14) & SLOT_ID_MASK) - 1)); else GT_Utility.sendChatToPlayer(aPlayer, trans("002","Grabs in for own Slot #") + ((var & SLOT_ID_MASK) - 1)); } private int getNewVar(int var, int step) { int intSlot = (var & SLOT_ID_MASK); - int adjSlot = (var >> 15) & SLOT_ID_MASK; + int adjSlot = (var >> 14) & SLOT_ID_MASK; if ((var & EXPORT_MASK) == 0) { int x = (intSlot + step); if (x > SLOT_ID_MASK ) return createVar(0, SLOT_ID_MASK, 0); else if (x < 1) - return createVar(- step - intSlot + 1, 0, 1); + return createVar(-step - intSlot + 1, 0, EXPORT_MASK); else return createVar(0, x, 0); } else { int x = (adjSlot - step); - if (x > SLOT_ID_MASK ) - return createVar(SLOT_ID_MASK, 0, 1); + if (x > SLOT_ID_MASK) + return createVar(SLOT_ID_MASK, 0, EXPORT_MASK); else if (x < 1) - return createVar(0, + step - adjSlot + 1, 0); + return createVar(0, +step - adjSlot + 1, 0); else - return createVar(x, 0, 1); + return createVar(x, 0, EXPORT_MASK); } } private int createVar(int adjSlot, int intSlot, int export){ - return ((export & 0x1) << 30) | ((adjSlot & SLOT_ID_MASK) << 15) | (intSlot & SLOT_ID_MASK); + return CONVERTED_BIT | export | ((adjSlot & SLOT_ID_MASK) << 14) | (intSlot & SLOT_ID_MASK); } public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -231,7 +238,7 @@ public class GT_Cover_Arm export = (coverVariable & EXPORT_MASK) > 0; internalSlotID = (coverVariable & SLOT_ID_MASK); - adjacentSlotID = (coverVariable >> 15) & SLOT_ID_MASK; + adjacentSlotID = (coverVariable >> 14) & SLOT_ID_MASK; new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT).setTooltipText(trans("006", "Export")); new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT).setTooltipText(trans("007", "Import")); @@ -387,7 +394,7 @@ public class GT_Cover_Arm } private int getNewCoverVariable() { - return (export ? EXPORT_MASK : 0) | ((adjacentSlotID & SLOT_ID_MASK) << 15) | (internalSlotID & SLOT_ID_MASK); + return (export ? EXPORT_MASK : 0) | ((adjacentSlotID & SLOT_ID_MASK) << 14) | (internalSlotID & SLOT_ID_MASK) | CONVERTED_BIT; } private boolean buttonClickable(int id) { -- cgit From 0e2794bb58cce84b5daf7fd85a124550fff6de4c Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Wed, 3 Jun 2020 21:01:32 +0200 Subject: coverguis: Cleaned up text. --- src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java | 12 ++++++------ src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 35dcd9f6b4..d12034d3a7 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -180,17 +180,17 @@ public class GT_Cover_EUMeter GuiButton b; b = new GT_GuiIconCheckButton(this, 0, startX + spaceX*0, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("031", "Normal Universal Storage")); + .setTooltipText(trans("256", "Universal Storage")); b = new GT_GuiIconCheckButton(this, 1, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("033", "Normal Electricity Storage")); + .setTooltipText(trans("257", "Electricity Storage")); b = new GT_GuiIconCheckButton(this, 2, startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("035", "Normal Steam Storage")); + .setTooltipText(trans("258", "Steam Storage")); b = new GT_GuiIconCheckButton(this, 3, startX + spaceX*4, startY+spaceY*1, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("037", "Normal Average Electric Input")); + .setTooltipText(trans("259", "Average Electric Input")); b = new GT_GuiIconCheckButton(this, 4, startX + spaceX*4, startY+spaceY*2, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("039", "Normal Average Electric Output")); + .setTooltipText(trans("260", "Average Electric Output")); b = new GT_GuiIconCheckButton(this, 5, startX + spaceX*4, startY+spaceY*0, GT_GuiIcon.CHECKMARK, null) - .setTooltipText(trans("041", "Normal Electricity Storage(Including Batteries)")); + .setTooltipText(trans("261", "Electricity Storage(Including Batteries)")); b = new GT_GuiIconCheckButton(this, 6, startX + spaceX*0, startY+spaceY*3+4, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 3186b94732..ed3d6fc3f9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -82,13 +82,6 @@ public class GT_Cover_ItemMeter GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + trans("ALL", "All")); else GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (slot - 1)); - - //aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (aTileEntity.getSizeInventory() + 2); - //switch(aCoverVariable) { - // case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break; - // case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break; - // default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable >> 1)); break; - //} return CONVERTED_BIT | (aCoverVariable & INVERT_BIT) | slot; } -- cgit From 884a268666ef8223b1b3fc6ccb4808700813c8e7 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Sat, 20 Jun 2020 16:46:29 +0200 Subject: Item detector cover GUI fix. How'd i miss that. --- .../gregtech/common/covers/GT_Cover_ItemMeter.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index ed3d6fc3f9..83b03b65a5 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -176,12 +176,12 @@ public class GT_Cover_ItemMeter @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - if ((coverVariable & 0x1) > 0) + if (isInverted()) this.getFontRenderer().drawString(INVERTED, startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); else this.getFontRenderer().drawString(NORMAL, startX + spaceX*3, 4+startY+spaceY*0, 0xFF555555); - this.getFontRenderer().drawString(trans("254", "Internal slot#"), startX + spaceX*3, 4+startY+spaceY*1, 0xFF555555); + this.getFontRenderer().drawString(trans("254", "Detect slot#"), startX + spaceX*3, 4+startY+spaceY*1, 0xFF555555); } @Override @@ -247,12 +247,14 @@ public class GT_Cover_ItemMeter @Override public void applyTextBox(GT_GuiIntegerTextBox box) { - int val = parseTextBox(box); + int val = parseTextBox(box)+1; - if (val >= 0) - coverVariable = val + 1; + if (val > SLOT_MASK) + val = SLOT_MASK; + else if (val < 0) + val = 0; - coverVariable = coverVariable | CONVERTED_BIT | (coverVariable & INVERT_BIT); + coverVariable = val | CONVERTED_BIT | (coverVariable & INVERT_BIT); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); update(); @@ -289,12 +291,10 @@ public class GT_Cover_ItemMeter } private boolean isInverted() { - return ((coverVariable & INVERT_BIT) == 0); + return ((coverVariable & INVERT_BIT) != 0); } private int getSlot() { - if ((coverVariable & SLOT_MASK) == 0) - return -1; return (coverVariable & SLOT_MASK) - 1; } } -- cgit From 8ce4ae8d22f31587c600bf8190cfb88e1a4f2ea2 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Sun, 19 Jul 2020 19:08:59 +0200 Subject: Rework clientside pollution (#302) * Rework clientside pollution * Pollution rework * removed debug --- .../java/gregtech/api/net/GT_Packet_Pollution.java | 31 ++- src/main/java/gregtech/common/GT_Client.java | 49 +---- src/main/java/gregtech/common/GT_Pollution.java | 71 +++++-- src/main/java/gregtech/common/GT_Proxy.java | 5 - .../common/entities/GT_EntityFXPollution.java | 65 ++++++ .../common/misc/GT_ClientPollutionMap.java | 156 ++++++++++++++ src/main/java/gregtech/common/misc/GT_Command.java | 50 +++-- .../common/render/GT_PollutionRenderer.java | 235 +++++++++++++++++++++ 8 files changed, 577 insertions(+), 85 deletions(-) create mode 100644 src/main/java/gregtech/common/entities/GT_EntityFXPollution.java create mode 100644 src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java create mode 100644 src/main/java/gregtech/common/render/GT_PollutionRenderer.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java index 2c67d74150..7f717c1a47 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java +++ b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java @@ -1,38 +1,47 @@ package gregtech.api.net; import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; -import gregtech.common.GT_Pollution; +import gregtech.common.GT_Client; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.IBlockAccess; +import java.nio.ByteBuffer; + public class GT_Packet_Pollution extends GT_Packet { - private int mPollution; + private ChunkCoordIntPair chunk; + private int pollution; public GT_Packet_Pollution() { super(true); } - public GT_Packet_Pollution(int aPollution) { + public GT_Packet_Pollution(ChunkCoordIntPair chunk, int pollution) { super(false); - mPollution = aPollution; + this.chunk = chunk; + this.pollution = pollution; } @Override public byte[] encode() { - ByteArrayDataOutput tOut = ByteStreams.newDataOutput(4); - tOut.writeInt(mPollution); - return tOut.toByteArray(); + return ByteBuffer + .allocate(12) + .putInt(chunk.chunkXPos) + .putInt(chunk.chunkZPos) + .putInt(pollution) + .array(); } @Override public GT_Packet decode(ByteArrayDataInput aData) { - return new GT_Packet_Pollution(aData.readInt()); + return new GT_Packet_Pollution( + new ChunkCoordIntPair(aData.readInt(), aData.readInt()), + aData.readInt() + ); } @Override public void process(IBlockAccess aWorld) { - GT_Pollution.mPlayerPollution = mPollution; + GT_Client.recieveChunkPollutionPacket(chunk, pollution); } @Override diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 51f5e30c28..e528323da4 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -33,6 +33,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.oredict.OreDictionary; @@ -56,7 +57,8 @@ public class GT_Client extends GT_Proxy }); } - private final HashSet mCapeList = new HashSet(); + private final HashSet mCapeList = new HashSet<>(); + public final static GT_PollutionRenderer mPollutionRenderer = new GT_PollutionRenderer(); private final GT_CapeRenderer mCapeRenderer; private final List mPosR; private final List mPosG; @@ -247,45 +249,6 @@ public class GT_Client extends GT_Proxy drawGrid(aEvent, false); } - //TODO less bad - //@SubscribeEvent - //public void manipulateDensity(EntityViewRenderEvent.FogDensity event) { - // if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){ - // event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f; - // event.setCanceled(true); - // } - //} - - //@SubscribeEvent - //public void manipulateColor(EntityViewRenderEvent.FogColors event) { - // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ - // event.red = 140f/255f; - // event.green = 80f/255f; - // event.blue = 40f/255f; - // } - //} - - //@SubscribeEvent - //public void manipulateGrassColor(BiomeEvent.GetGrassColor event) { - // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ - // event.newColor = 0xD2691E; - // } - //} - - //@SubscribeEvent - //public void manipulateWaterColor(BiomeEvent.GetWaterColor event) { - // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ - // event.newColor = 0x556B2F; - // } - //} - - //@SubscribeEvent - //public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) { - // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ - // event.newColor = 0xCD853F; - // } - //} - public boolean isServerSide() { return true; } @@ -329,6 +292,8 @@ public class GT_Client extends GT_Proxy mCapeList.add(tName.toLowerCase()); } (new Thread(this)).start(); + + mPollutionRenderer.preLoad(); } public void onLoad() { @@ -730,4 +695,8 @@ public class GT_Client extends GT_Proxy return 0; } } + + public static void recieveChunkPollutionPacket(ChunkCoordIntPair chunk, int pollution) { + mPollutionRenderer.processPacket(chunk, pollution); + } } diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index f25c21f86a..be49e57e4a 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -1,12 +1,18 @@ package gregtech.common; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_Pollution; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; @@ -15,6 +21,8 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.ChunkWatchEvent; import java.util.ArrayList; import java.util.HashMap; @@ -64,6 +72,10 @@ public class GT_Pollution { private final World aWorld; public static int mPlayerPollution; + private static int POLLUTIONPACKET_MINVALUE = 1000; + + private static GT_PollutionEventHandler EVENT_HANDLER; + public GT_Pollution(World world){ aWorld=world; chunkData=dimensionWiseChunkData.get(aWorld.provider.dimensionId); @@ -72,6 +84,11 @@ public class GT_Pollution { dimensionWiseChunkData.put(world.provider.dimensionId,chunkData); } dimensionWisePollution.put(aWorld.provider.dimensionId,this); + + if (EVENT_HANDLER == null) { + EVENT_HANDLER = new GT_PollutionEventHandler(); + MinecraftForge.EVENT_BUS.register(EVENT_HANDLER); + } } public static void onWorldTick(TickEvent.WorldTickEvent aEvent){//called from proxy @@ -130,7 +147,9 @@ public class GT_Pollution { AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(actualPos.chunkXPos << 4, 0, actualPos.chunkZPos << 4, (actualPos.chunkXPos << 4) + 16, 256, (actualPos.chunkZPos << 4) + 16); List tEntitys = aWorld.getEntitiesWithinAABB(EntityLivingBase.class, chunk); for (EntityLivingBase tEnt : tEntitys) { - if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { + if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) + continue; + if (!(GT_Utility.isWearingFullGasHazmat(tEnt))) { switch (XSTR_INSTANCE.nextInt(3)) { default: tEnt.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, Math.min(tPollution / 1000, 1000), tPollution / 400000)); @@ -148,6 +167,8 @@ public class GT_Pollution { //AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); //List tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); for (EntityLivingBase tEnt : tEntitys) { + if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode) + continue; if (!GT_Utility.isWearingFullGasHazmat(tEnt)) { switch (XSTR_INSTANCE.nextInt(4)) { default: @@ -178,15 +199,21 @@ public class GT_Pollution { } //Write new pollution to Hashmap !!! chunkData.get(actualPos)[GTPOLLUTION] = tPollution; + + //Send new value to players nearby + if (tPollution > POLLUTIONPACKET_MINVALUE) { + NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(aWorld.provider.dimensionId, (actualPos.chunkXPos << 4), 64, (actualPos.chunkZPos << 4), 256); + GT_Values.NW.sendToAllAround(new GT_Packet_Pollution(actualPos, tPollution), point); + } } } - + private static void damageBlock(World world, int x, int y, int z, boolean sourRain){ if (world.isRemote) return; Block tBlock = world.getBlock(x, y, z); int tMeta = world.getBlockMetadata(x, y, z); if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand|| tBlock == Blocks.deadbush)return; - + if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves) world.setBlockToAir(x, y, z); if (tBlock == Blocks.reeds) { @@ -199,12 +226,12 @@ public class GT_Pollution { tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); world.setBlockToAir(x, y, z); } - if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus || + if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus || tBlock.getMaterial() == Material.cactus || tBlock == Blocks.melon_block || tBlock == Blocks.melon_stem) { tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); world.setBlockToAir(x, y, z); } - if (tBlock == Blocks.red_flower || tBlock == Blocks.yellow_flower || tBlock == Blocks.carrots || + if (tBlock == Blocks.red_flower || tBlock == Blocks.yellow_flower || tBlock == Blocks.carrots || tBlock == Blocks.potatoes || tBlock == Blocks.pumpkin || tBlock == Blocks.pumpkin_stem) { tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); world.setBlockToAir(x, y, z); @@ -218,12 +245,12 @@ public class GT_Pollution { if (tBlock == Blocks.mossy_cobblestone) world.setBlock(x, y, z, Blocks.cobblestone); if (tBlock == Blocks.grass || tBlock.getMaterial() == Material.grass ) - world.setBlock(x, y, z, Blocks.dirt); + world.setBlock(x, y, z, Blocks.dirt); if(tBlock == Blocks.farmland || tBlock == Blocks.dirt){ - world.setBlock(x, y, z, Blocks.sand); + world.setBlock(x, y, z, Blocks.sand); } - - if(sourRain && world.isRaining() && (tBlock == Blocks.stone || tBlock == Blocks.gravel || tBlock == Blocks.cobblestone) && + + if(sourRain && world.isRaining() && (tBlock == Blocks.stone || tBlock == Blocks.gravel || tBlock == Blocks.cobblestone) && world.getBlock(x, y+1, z) == Blocks.air && world.canBlockSeeTheSky(x, y, z)){ if(tBlock == Blocks.stone){world.setBlock(x, y, z, Blocks.cobblestone); } else if(tBlock == Blocks.cobblestone){world.setBlock(x, y, z, Blocks.gravel); } @@ -256,19 +283,22 @@ public class GT_Pollution { } public static int getPollution(Chunk ch){ - if(!GT_Mod.gregtechproxy.mPollution)return 0; + if(!GT_Mod.gregtechproxy.mPollution) + return 0; HashMap dataMap=dimensionWiseChunkData.get(ch.worldObj.provider.dimensionId); if(dataMap==null || dataMap.get(ch.getChunkCoordIntPair())==null) return 0; return dataMap.get(ch.getChunkCoordIntPair())[GTPOLLUTION]; } - public static int getPollution(ChunkCoordIntPair aCh, int aDim){ - if(!GT_Mod.gregtechproxy.mPollution)return 0; - HashMap dataMap=dimensionWiseChunkData.get(aDim); - if(dataMap==null || dataMap.get(aCh)==null) return 0; + public static int getPollution(ChunkCoordIntPair aCh, int aDim) { + if (!GT_Mod.gregtechproxy.mPollution) + return 0; + HashMap dataMap = dimensionWiseChunkData.get(aDim); + if (dataMap == null || dataMap.get(aCh) == null) + return 0; return dataMap.get(aCh)[GTPOLLUTION]; } - + //Add compatibility with old code @Deprecated /*Don't use it... too weird way of passing position*/ public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution){ @@ -276,4 +306,15 @@ public class GT_Pollution { //is just bad especially when that is both used to store ChunkPos and BlockPos depending on context addPollution(aWorld.getChunkFromBlockCoords(aPos.chunkPosX,aPos.chunkPosZ),aPollution); } + + public class GT_PollutionEventHandler { + @SubscribeEvent + public void chunkWatch(ChunkWatchEvent.Watch event) { + if (chunkData.containsKey(event.chunk)) { + int pollution = chunkData.get(event.chunk)[GTPOLLUTION]; + if (pollution > POLLUTIONPACKET_MINVALUE) + GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(event.chunk, pollution), event.player); + } + } + } } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 26b971a093..5b762d6d58 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1490,11 +1490,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F)); } } - if (aEvent.player.ticksExisted % 10 == 0) { - int tPollution = 0; - tPollution = GT_Pollution.getPollution(new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ), aEvent.player.dimension); - if(aEvent.player instanceof EntityPlayerMP)GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(tPollution), (EntityPlayerMP) aEvent.player); - } } } diff --git a/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java new file mode 100644 index 0000000000..2123313190 --- /dev/null +++ b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java @@ -0,0 +1,65 @@ +package gregtech.common.entities; + +import cofh.lib.util.helpers.MathHelper; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.world.World; + +import java.util.Random; + +public class GT_EntityFXPollution extends EntityFX { + + public GT_EntityFXPollution(World world, double x, double y, double z) { + super(world, x, y, z,0 ,0 ,0); + + this.particleRed = 0.25F; + this.particleGreen = 0.2F; + this.particleBlue = 0.25F; + + this.motionX *= 0.1D; + this.motionY *= -0.1D; + this.motionZ *= 0.1F; + + Random random = world.rand; + this.motionX += random.nextFloat() * -1.9D * random.nextFloat() * 0.1D; + this.motionY += random.nextFloat() * -0.5D * random.nextFloat() * 0.1D * 5.0D; + this.motionZ += random.nextFloat() * -1.9D * random.nextFloat() * 0.1D; + + this.particleTextureIndexX = 0; + this.particleTextureIndexY = 0; + + this.particleMaxAge = (int)((double)20 / ((double)random.nextFloat() * 0.8D + 0.2D)); + + this.particleScale *= 0.75F; + this.noClip = true; + } + + @Override + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } else { + this.motionY += -5.0E-4D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + this.motionX *= 0.96D; + this.motionY *= 0.96D; + this.motionZ *= 0.96D; + if (this.onGround) { + this.motionX *= 0.7D; + this.motionZ *= 0.7D; + } + } + } + + + public float getSize(float tickDelta) { + return this.particleScale * MathHelper.clamp(((float)this.particleAge + tickDelta) / (float)this.particleMaxAge * 32.0F, 0.0F, 1.0F); + } +} diff --git a/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java new file mode 100644 index 0000000000..7ba470e412 --- /dev/null +++ b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java @@ -0,0 +1,156 @@ +package gregtech.common.misc; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class GT_ClientPollutionMap { + private static final byte RADIUS = 24; + private static final byte DISTANCE_RELOAD_MAP = 5; //When player moved x chunks, shift the map to new center. + private static final byte SIZE = RADIUS*2+1; //Area to keep stored. + + private int x0, z0; + private int dim; + + private boolean initialized = false; + + private static short[][] chunkMatrix; //short because reasons. + + + public GT_ClientPollutionMap(){ } + + public void reset() { + initialized = false; + } + + private void initialize(int playerChunkX, int playerChunkZ, int dimension) { + initialized = true; + chunkMatrix = new short[SIZE][SIZE]; + x0 = playerChunkX; + z0 = playerChunkZ; + dim = dimension; + } + + public void addChunkPollution(int chunkX, int chunkZ, int pollution) { + EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; + if (player == null || player.worldObj == null) + return; + + int playerXChunk = MathHelper.floor_double(player.posX) >> 4; + int playerZChunk = MathHelper.floor_double(player.posZ) >> 4; //posX/Z seems to be always loaded, + + if (!initialized) { + initialize(playerXChunk, playerZChunk, player.dimension); + } + + if (dim != player.dimension) { + initialize(playerXChunk, playerZChunk, player.dimension); + } + + if (Math.abs(x0 - playerXChunk) > DISTANCE_RELOAD_MAP || Math.abs(z0 - playerZChunk) > DISTANCE_RELOAD_MAP) + shiftCenter(playerXChunk, playerZChunk); + + int relX = chunkX - x0 + RADIUS; + if (relX >= SIZE || relX < 0) //out of bounds + return; + int relZ = chunkZ - z0 + RADIUS; + if (relZ >= SIZE || relZ < 0) //out of bounds + return; + + pollution = pollution/225; + if (pollution > Short.MAX_VALUE) //Sanity + chunkMatrix[relX][relZ] = Short.MAX_VALUE; //Max pollution = 7,3mill + else if (pollution < 0) + chunkMatrix[relX][relZ] = 0; + else + chunkMatrix[relX][relZ] = (short) (pollution); + } + + //xy interpolation, between 4 chunks as corners, unknown treated as 0. + public int getPollution(double fx, double fz) { + if (!initialized) + return 0; + int x = MathHelper.floor_double(fx); + int z = MathHelper.floor_double(fz); + int xDiff = ((x-8) >> 4) - x0; + int zDiff = ((z-8) >> 4) - z0; + + if (xDiff < -RADIUS || zDiff < -RADIUS || xDiff >= RADIUS || zDiff >= RADIUS ) + return 0; + + //coordinates in shifted chunk. + x = (x-8) % 16; + z = (z-8) % 16; + if (x < 0) + x = 16+x; + if (z < 0) + z = 16+z; + + int xi = 15 - x; + int zi = 15 - z; + + //read pollution in 4 corner chunks + int offsetX = RADIUS+xDiff; + int offsetZ = RADIUS+zDiff; + + int c00 = chunkMatrix[offsetX][offsetZ]; + int c10 = chunkMatrix[offsetX+1][offsetZ]; + int c01 = chunkMatrix[offsetX][offsetZ+1]; + int c11 = chunkMatrix[offsetX+1][offsetZ+1]; + + //Is divided by 15*15 but is handled when storing chunk data. + return c00*xi*zi + c10*x*zi + c01*xi*z + c11*x*z; + } + + //shift the matrix to fit new center + private void shiftCenter(int chunkX, int chunkZ) { + int xDiff = chunkX - x0; + int zDiff = chunkZ - z0; + boolean[] allEmpty = new boolean[SIZE]; //skip check z row if its empty. + if (xDiff > 0) + for (byte x = 0; x < SIZE; x++) { + int xOff = x + xDiff; + if (xOff < SIZE) { + chunkMatrix[x] = chunkMatrix[xOff].clone(); + } else { + chunkMatrix[x] = new short[SIZE]; + allEmpty[x] = true; + } + } + else if (xDiff < 0) + for (byte x = SIZE-1; x >= 0; x--) { + int xOff = x + xDiff; + if (xOff > 0) { + chunkMatrix[x] = chunkMatrix[xOff].clone(); + } else { + chunkMatrix[x] = new short[SIZE]; + allEmpty[x] = true; + } + } + + if (zDiff > 0) + for (byte x = 0; x < SIZE; x++) { + if (allEmpty[x]) + continue; + for (int z = 0; z < SIZE ; z++) { + int zOff = z + zDiff; + chunkMatrix[x][z] = (zOff < SIZE) ? chunkMatrix[x][zOff] : 0; + } + } + else if (zDiff < 0) + for (byte x = 0; x < SIZE; x++) { + if (allEmpty[x]) + continue; + for (int z = SIZE-1; z >= 0 ; z--) { + int zOff = z+zDiff; + chunkMatrix[x][z] = (zOff > 0) ? chunkMatrix[x][zOff] : 0; + } + } + + x0 = chunkX; + z0 = chunkZ; + } +} diff --git a/src/main/java/gregtech/common/misc/GT_Command.java b/src/main/java/gregtech/common/misc/GT_Command.java index 66ae7058bc..f3272ee341 100644 --- a/src/main/java/gregtech/common/misc/GT_Command.java +++ b/src/main/java/gregtech/common/misc/GT_Command.java @@ -1,11 +1,15 @@ package gregtech.common.misc; +import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; import gregtech.api.objects.GT_ChunkManager; +import gregtech.common.GT_Pollution; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.command.WrongUsageException; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; + import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; @@ -21,10 +25,10 @@ public final class GT_Command extends CommandBase { @Override public String getCommandUsage(ICommandSender sender) { - return "Usage: gt . Valid subcommands are: toggle, chunks."; + return "Usage: gt . Valid subcommands are: toggle, chunks, pollution."; } private void printHelp(ICommandSender sender) { - sender.addChatMessage(new ChatComponentText("Usage: gt ")); + sender.addChatMessage(new ChatComponentText("Usage: gt ")); sender.addChatMessage(new ChatComponentText("\"toggle D1\" - toggles general.Debug (D1)")); sender.addChatMessage(new ChatComponentText("\"toggle D2\" - toggles general.Debug2 (D2)")); sender.addChatMessage(new ChatComponentText("\"toggle debugCleanroom\" - toggles cleanroom debug log")); @@ -38,6 +42,10 @@ public final class GT_Command extends CommandBase { sender.addChatMessage(new ChatComponentText("\"toggle debugStones\" - toggles worldgen stones debug")); sender.addChatMessage(new ChatComponentText("\"toggle debugChunkloaders\" - toggles chunkloaders debug")); sender.addChatMessage(new ChatComponentText("\"chunks\" - print a list of the force loaded chunks")); + sender.addChatMessage(new ChatComponentText( + "\"pollution \" - adds the of the pollution to the current chunk, " + + "\n if isnt specified, will add" + GT_Mod.gregtechproxy.mPollutionSmogLimit + "gibbl." + )); } @Override @@ -45,25 +53,24 @@ public final class GT_Command extends CommandBase { List l = new ArrayList<>(); Stream keywords = Arrays.stream(new String[]{"toggle", "chunks"}); String test = ss.length == 0 ? "" : ss[0].trim(); - if (ss.length == 0 || ss.length == 1 && (test.isEmpty() || keywords.anyMatch(s -> s.startsWith(test)))) { - keywords.forEach(s -> { - if (test.isEmpty() || s.startsWith(test)) - l.add(s); - }); + if (ss.length == 0 || ss.length == 1 && (test.isEmpty() || Stream.of("toggle", "chunks", "pollution").anyMatch(s -> s.startsWith(test)))) { + Stream.of("toggle", "chunks", "pollution") + .filter(s -> test.isEmpty() || s.startsWith(test)) + .forEach(l::add); } else if (test.equals("toggle")) { - String test1 = ss.length == 1 ? "" : ss[1].trim(); - Arrays.stream(new String[]{"D1", "D2", "debugCleanroom", "debugDriller", "debugBlockPump", "debugBlockMiner", "debugWorldGen", "debugEntityCramming", - "debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders"}).forEach(s -> { - if (test1.isEmpty() || s.startsWith(test1)) - l.add(s); - }); + String test1 = ss[1].trim(); + Stream.of("D1", "D2", "debugCleanroom", "debugDriller", "debugBlockPump", "debugBlockMiner", "debugWorldGen", "debugEntityCramming", + "debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders") + .filter(s -> test1.isEmpty() || s.startsWith(test1)) + .forEach(l::add); + } return l; } @Override public void processCommand(ICommandSender sender, String[] strings) { - if (strings.length < 1 || (!strings[0].equals("toggle") && !strings[0].equals("chunks"))) { + if (strings.length < 1) { printHelp(sender); return; } @@ -90,6 +97,21 @@ public final class GT_Command extends CommandBase { GT_ChunkManager.printTickets(); sender.addChatMessage(new ChatComponentText("Forced chunks logged to GregTech.log")); break; + case "pollution": { + ChunkCoordinates coordinates = sender.getPlayerCoordinates(); + int amount = (strings.length < 2) ? GT_Mod.gregtechproxy.mPollutionSmogLimit : Integer.parseInt(strings[1]); + GT_Pollution.addPollution(sender + .getEntityWorld() + .getChunkFromBlockCoords( + coordinates.posX, + coordinates.posZ + ), + amount + ); + break; + } + default: + printHelp(sender); } } } diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java new file mode 100644 index 0000000000..832e93ecf9 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -0,0 +1,235 @@ +package gregtech.common.render; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.common.misc.GT_ClientPollutionMap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.client.event.EntityViewRenderEvent; +import net.minecraftforge.event.world.WorldEvent; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GT_PollutionRenderer { + private static GT_ClientPollutionMap pollutionMap; + private static int playerPollution = 0; + + private static boolean DEBUG = false; + + // PARTICLES_POLLUTION_START + PARTICLES_POLLUTION_END -> Max Particles + private static final int PARTICLES_MAX_NUM = 100; + private static final int PARTICLES_POLLUTION_START = 400000; + private static final int PARTICLES_POLLUTION_END = 3500000; + + private static final int FOG_START_AT_POLLUTION = 400000; + private static final int FOG_MAX_AT_POLLUTION = 7000000; + //jump from linear to exponential fog. x*FOG_MAX_AT_POLLUTION+FOG_START_AT_POLLUTION + private static final double FOG_START_EXP_RATIO = 0.02D; + + private static final float[] fogColor = {0.3f, 0.25f, 0.1f}; + private static final short[] grassColor = {230, 180, 40}; + private static final short[] leavesColor = {160, 80, 15}; + private static final short[] liquidColor = {160, 200, 10}; + private static final short[] foliageColor = {160, 80, 15}; + + //TODO need to soft update some blocks, grass and leaves does more often than liquid it looks like. + + public GT_PollutionRenderer() { + pollutionMap = new GT_ClientPollutionMap(); + } + + public void preLoad() { + net.minecraftforge.common.MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); + } + + public void processPacket(ChunkCoordIntPair chunk, int pollution) { + pollutionMap.addChunkPollution(chunk.chunkXPos, chunk.chunkZPos, pollution); + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public void enteredWorld(WorldEvent.Load event) { + EntityClientPlayerMP p = Minecraft.getMinecraft().thePlayer; + if (!event.world.isRemote || p == null) + return; + pollutionMap.reset(); + } + + private static int color(int color, int pollution, int low, float high, short[] colors) { + if ( pollution < low) + return color; + + int r = (color >> 16) & 0xFF; + int g = (color >> 8) & 0xFF; + int b = color & 0xFF; + float p = (pollution - low) / high; + if (p > 1) p = 1; + float pi = 1 - p; + + r = ((int) (r * pi + p * colors[0])) & 0xFF; + g = ((int) (g * pi + p * colors[1])) & 0xFF; + b = ((int) (b * pi + p * colors[2])) & 0xFF; + + return (r & 0xFF) << 16 | (g & 0xFF) << 8 | b & 0xFF; + } + + // Methods for hodgepodge to color grass / foliage blocks etc. + public static int colorGrass(int oColor, int x, int z) { + return color(oColor, pollutionMap.getPollution(x, z)/1000, 350, 600, grassColor); + } + public static int colorLeaves(int oColor, int x, int z) { + return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, leavesColor); + } + public static int colorLiquid(int oColor, int x, int z) { + return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, liquidColor); + } + public static int colorFoliage(int oColor, int x, int z) { + return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, foliageColor); + } + + @SubscribeEvent(priority = EventPriority.LOW) + public void manipulateColor(EntityViewRenderEvent.FogColors event) { + if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) + return; + + if (event.block.getMaterial() == Material.water || + event.block.getMaterial() == Material.lava) + return; + + float x = fogIntensityLastTick > 1 ? 1F : (float) fogIntensityLastTick; + float xi = 1 - x; + + event.red = xi*event.red + x*fogColor[0]; + event.green = xi*event.green + x*fogColor[1]; + event.blue = xi*event.blue + x*fogColor[2]; + } + + private static final int END_MAX_DISTANCE = 192 - 1; + private static double fogIntensityLastTick = 0; + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void renderGTPollutionFog(EntityViewRenderEvent.RenderFogEvent event) { + if ((!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) || + (fogIntensityLastTick <= 0 && fogIntensityLastTick >= FOG_START_EXP_RATIO)) + return; + + if (event.fogMode == 0) { + double v = 1 - fogIntensityLastTick/FOG_START_EXP_RATIO; + //trying to smooth out jump from linear to exponential + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + GL11.glFogf(GL11.GL_FOG_START, (float) ((END_MAX_DISTANCE-20) * 0.75F * v + 20)); + GL11.glFogf(GL11.GL_FOG_END, (float) (END_MAX_DISTANCE * (0.75F + v * 0.25F))); + } + //else if ( event.fogMode < 0) { } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void renderGTPollutionFog(EntityViewRenderEvent.FogDensity event) { + if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) + return; + + if (event.entity.isPotionActive(Potion.blindness) || + (fogIntensityLastTick < FOG_START_EXP_RATIO) || + event.block.getMaterial() == Material.water || + event.block.getMaterial() == Material.lava + ) + return; + + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP2); + event.density = (float) Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F)/5 + 0.01F; + event.setCanceled(true); + } + + private double lastUpdate = 0; + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderTick(TickEvent.RenderTickEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc == null) + return; + EntityClientPlayerMP player = mc.thePlayer; + if (player == null) + return; + + if (event.phase == TickEvent.Phase.START) { + if (event.renderTickTime < lastUpdate) + lastUpdate = lastUpdate - 1; + float step = (float) ((event.renderTickTime - lastUpdate) / 50); + lastUpdate = event.renderTickTime; + + float fogIntensity = (playerPollution-FOG_START_AT_POLLUTION)/ (float) FOG_MAX_AT_POLLUTION; + if (fogIntensity > 1) fogIntensity = 1; + else if (fogIntensity < 0) fogIntensity = 0; + + double e = fogIntensity-fogIntensityLastTick; + if (e != 0) { + if (e > 0.2) e = 0.2D; + else if (e < -0.5) e = - 0.5D; + + if (e > 0.001D || e < -0.001D) + fogIntensityLastTick += step *e; + else + fogIntensityLastTick = fogIntensity; + } + } + else if (DEBUG) { + drawPollution("Intensity: " + (fogIntensityLastTick * 10000), 0); + drawPollution("Pollution: " + pollutionMap.getPollution(Minecraft.getMinecraft().thePlayer.lastTickPosX, Minecraft.getMinecraft().thePlayer.lastTickPosZ), 20); + drawPollution("Density: " + ((float)(Math.pow(fogIntensityLastTick - FOG_START_EXP_RATIO, .75F)/5 + 0.01F)* 10000), 40); + } + } + + // Adding dirt particles in the air + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onClientTick(TickEvent.ClientTickEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc == null) + return; + EntityClientPlayerMP player = mc.thePlayer; + if (player == null || (player.capabilities.isCreativeMode && !DEBUG)) + return; + + World w = player.worldObj; + playerPollution = pollutionMap.getPollution(player.lastTickPosX, player.lastTickPosZ); + + float intensity = ((float) playerPollution - PARTICLES_POLLUTION_START) / PARTICLES_POLLUTION_END; + if (intensity < 0) + return; + else if (intensity > 1) + intensity = 1; + else + intensity *= intensity; + + int x = MathHelper.floor_double(player.posX); + int y = MathHelper.floor_double(player.posY); + int z = MathHelper.floor_double(player.posZ); + + int numParticles = Math.round(intensity * PARTICLES_MAX_NUM); + + for (int l = 0; l < numParticles; ++l) { + int i1 = x + w.rand.nextInt(16) - w.rand.nextInt(16); + int j1 = y + w.rand.nextInt(16) - w.rand.nextInt(16); + int k1 = z + w.rand.nextInt(16) - w.rand.nextInt(16); + Block block = w.getBlock(i1, j1, k1); + + if (block.getMaterial() == Material.air) { + EntityFX fx = new GT_EntityFXPollution(w, (float) i1 + w.rand.nextFloat(), (float) j1 + w.rand.nextFloat(), (float) k1 + w.rand.nextFloat()); + mc.effectRenderer.addEffect(fx); + } + } + } + + private void drawPollution(String text, int off){ + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, 0, off, 0xFFFFFFFF); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } +} -- cgit From 483bfc8dafd3e3ab2880affe49f8216b5c93a911 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 19 Jul 2020 20:21:43 +0200 Subject: added missing imports --- src/main/java/gregtech/common/render/GT_PollutionRenderer.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java index 832e93ecf9..4353786a7b 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -6,11 +6,18 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.common.entities.GT_EntityFXPollution; import gregtech.common.misc.GT_ClientPollutionMap; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.potion.Potion; +import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; import net.minecraftforge.client.event.EntityViewRenderEvent; import net.minecraftforge.event.world.WorldEvent; import org.lwjgl.opengl.GL11; -- cgit From f2240aa9d967aa0afc6a0473aa1e707bc41ab75b Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 19 Jul 2020 20:28:35 +0200 Subject: removed unused function --- src/main/java/gregtech/common/entities/GT_EntityFXPollution.java | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java index 2123313190..b44f90f7ea 100644 --- a/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java +++ b/src/main/java/gregtech/common/entities/GT_EntityFXPollution.java @@ -1,6 +1,5 @@ package gregtech.common.entities; -import cofh.lib.util.helpers.MathHelper; import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; @@ -57,9 +56,4 @@ public class GT_EntityFXPollution extends EntityFX { } } } - - - public float getSize(float tickDelta) { - return this.particleScale * MathHelper.clamp(((float)this.particleAge + tickDelta) / (float)this.particleMaxAge * 32.0F, 0.0F, 1.0F); - } } -- cgit From b3b3ef4f0961fda0eb7e56bf1cf43cabc0e4f8d6 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Jul 2020 19:09:07 +0200 Subject: feat(Gregtech) add Raw DD Portal Block Add Raw Poatal Block for DD Infusion recipe --- src/main/java/gregtech/api/enums/ItemList.java | 1 + src/main/java/gregtech/api/enums/Textures.java | 1 + .../gregtech/common/blocks/GT_Block_Reinforced.java | 4 ++++ .../loaders/postload/GT_MachineRecipeLoader.java | 19 +++++++++++++++++++ .../textures/blocks/iconsets/BLOCK_DEEP_DARK_RAW.png | Bin 0 -> 3218 bytes 5 files changed, 25 insertions(+) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/BLOCK_DEEP_DARK_RAW.png (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index cb6e94f5ba..6f7a0567a1 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -1474,6 +1474,7 @@ public enum ItemList implements IItemContainer { Block_TungstenSteelReinforced, Block_NaquadahPlate, Block_NeutroniumPlate, + Block_BedrockiumCompressed, Honeycomb, Charcoal_Pile, diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index a813eacd57..7b229550ff 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -351,6 +351,7 @@ public class Textures { BLOCK_TITANIUMPREIN, BLOCK_NAQUADAHPREIN, BLOCK_NEUTRONIUMPREIN, + BLOCK_DEEP_DARK_RAW, BLOCK_IRREIN, BLOCK_PLASCRETE, BLOCK_TSREIN, diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 32ce6e78f9..ec31cb212c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -55,6 +55,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Titanium Reinforced Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Naquadah Reinforced Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Neutronium Reinforced Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Raw Deep Dark Portal Block"); ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(40.0f).setResistance(100.0f), 1, 2)); @@ -67,6 +68,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { ItemList.Block_TitaniumPlate.set(new ItemStack(this.setHardness(200.0f).setResistance(300.0f), 1, 9)); ItemList.Block_NaquadahPlate.set(new ItemStack(this.setHardness(500.0f).setResistance(1000.0f), 1, 10)); ItemList.Block_NeutroniumPlate.set(new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); + ItemList.Block_BedrockiumCompressed.set(new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteBlack)}); //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteRed)}); //GT_ModHandler.addCraftingRecipe(ItemList.Block_IridiumTungstensteel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hBP", 'P', OrePrefixes.plate.get(Materials.Iridium), 'B', ItemList.Block_TungstenSteelReinforced.get(1L, new Object[0])}); @@ -116,6 +118,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return Textures.BlockIcons.BLOCK_NAQUADAHPREIN.getIcon(); case 11: return Textures.BlockIcons.BLOCK_NEUTRONIUMPREIN.getIcon(); + case 12: + return Textures.BlockIcons.BLOCK_DEEP_DARK_RAW.getIcon(); } } return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index cdbe444248..a705c3895d 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -2752,6 +2752,25 @@ public class GT_MachineRecipeLoader implements Runnable { Materials.ElectrumFlux.getMolten(1152L), }, ItemList.FusionComputer_UV.get(1), 1000, 90000); + GT_Values.RA.addAssemblylineRecipe(GT_ModHandler.getModItem("dreamcraft", "item.HeavyDutyPlateTier8", 1, 0), 576000, new Object[]{ + GT_ModHandler.getModItem("ExtraUtilities", "cobblestone_compressed", 1, 7), + GT_ModHandler.getModItem("IC2", "blockMachine2", 1, 0), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 4L), + new Object[]{OrePrefixes.circuit.get(Materials.Piko), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Piko), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Piko), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Piko), 1}, + GT_ModHandler.getModItem("dreamcraft", "PicoWafer", 32, 0), + ItemList.Robot_Arm_UEV.get(1), + ItemList.Emitter_UEV.get(1), + ItemList.Sensor_UEV.get(1), + ItemList.Field_Generator_UEV.get(1), + }, new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("oganesson"), 2880), + Materials.Infinity.getMolten(2880L), + Materials.Cheese.getMolten(2880L), + }, ItemList.Block_BedrockiumCompressed.get(1), 10000, 5000000); + if (GregTech_API.sThaumcraftCompat != null) { String tKey = "GT_WOOD_TO_CHARCOAL"; GT_LanguageManager.addStringLocalization(GT_MachineRecipeLoader.aTextTCGTPage + tKey, "You have discovered a way of making charcoal magically instead of using regular ovens for this purpose.

To create charcoal from wood you first need an air-free environment, some vacuus essentia is needed for that, then you need to incinerate the wood using ignis essentia and wait until all the water inside the wood is burned away.

This method however doesn't create creosote oil as byproduct."); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/BLOCK_DEEP_DARK_RAW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BLOCK_DEEP_DARK_RAW.png new file mode 100644 index 0000000000..ef3500ab97 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BLOCK_DEEP_DARK_RAW.png differ -- cgit From ae4c28053de46d319c5a82bb06cf34fcb705b6a1 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sat, 25 Jul 2020 13:44:08 +0200 Subject: feat(Gregtech)New Boiler Fuels Add Cactus and Sugar Fuesl from gt++ to the single Block Boiler burn list Allow for Cactus/sugar coke/coal to be used as fuel in coal boilers. #6438 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6438 (cherry picked from commit eb900fccc4dc85dee445498c9524c9a75b5529e6) --- .../tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 6db4013a60..eeb8ec252f 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -137,7 +137,11 @@ public class GT_MetaTileEntity_Boiler_Bronze (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Diamond) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke") ) { if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10); -- cgit From 949609a1a422abf232cb5fb61f49003a7ecfa6aa Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sat, 25 Jul 2020 22:04:53 +0200 Subject: change(Gregtech)recipes change T1 heavy Duty ingot recipe from crafting to Assembler HV change Iridium Alloy Ingot recipe from crafting recipe to Assembler IV (cherry picked from commit ec51124197a8009d38e2e2027667b5c40569175f) --- src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java | 6 +++--- src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 20dbccf2cb..57654ec43b 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -382,12 +382,12 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Ingot_Heavy2.set(addItem(tLastID = 463, "Heavy Duty Alloy Ingot T2", "Used to make Heavy Duty Plates T2", new Object[0])); ItemList.Ingot_Heavy3.set(addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3", new Object[0])); - GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B', OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A', OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)}); + //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B', OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A', OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)}); } ItemList.Ingot_IridiumAlloy.set(addItem(tLastID = 480, "Iridium Alloy Ingot", "Used to make Iridium Plates", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)})); - GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); + //GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); + //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); ItemList.Paper_Printed_Pages.set(addItem(tLastID = 481, "Printed Pages", "Used to make written Books", new Object[]{new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), new Behaviour_PrintedPages(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); ItemList.Paper_Magic_Empty.set(addItem(tLastID = 482, "Magic Paper", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 1L)})); diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index af1843265f..f6576fcb76 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -1423,6 +1423,7 @@ public class GT_MachineRecipeLoader implements Runnable { GT_ModHandler.removeRecipeByOutput(ItemList.IC2_Fertilizer.get(1L)); GT_Values.RA.addImplosionRecipe(ItemList.IC2_Compressed_Coal_Chunk.get(1L), 8, ItemList.IC2_Industrial_Diamond.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4L), GT_OreDictUnificator.get(OrePrefixes.plateAlloy, Materials.Advanced, 4L), GT_OreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Diamond, 1L), GT_Utility.getIntegratedCircuit(1)}, GT_Values.NF, ItemList.Ingot_IridiumAlloy.get(1L), 200, 7680); GT_Values.RA.addImplosionRecipe(ItemList.Ingot_IridiumAlloy.get(1L), 8, GT_OreDictUnificator.get(OrePrefixes.plateAlloy, Materials.Iridium, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)); if (Loader.isModLoaded("GalacticraftMars")) { @@ -1441,8 +1442,9 @@ public class GT_MachineRecipeLoader implements Runnable { //GT_Values.RA.addPulveriserRecipe(GT_ModHandler.getModItem("GalacticraftMars", "tile.asteroidsBlock", 1L, 2), new ItemStack[]{GT_ModHandler.getModItem("GalacticraftMars", "tile.asteroidsBlock", 1L, 0)}, null, 400, 2); //GT_Values.RA.addCentrifugeRecipe(GT_ModHandler.getModItem("GalacticraftMars", "tile.asteroidsBlock", 1L, 0), null, null, Materials.Nitrogen.getGas(33), new ItemStack(Blocks.sand,1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Nickel, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gallium, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Platinum, 1), new int[]{5000,400,400,100,100,100}, 400, 8); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("GalacticraftCore", "item.heavyPlating", 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.MeteoricIron, 2L), Materials.TungstenSteel.getMolten(48L), ItemList.Ingot_Heavy2.get(1L), 300, 1920); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("GalacticraftMars", "item.null", 1L, 3), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Desh, 4L), Materials.Platinum.getMolten(72L), ItemList.Ingot_Heavy3.get(1L), 300, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.compressed, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.compressed, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.compressed, Materials.Aluminium, 1L), GT_Utility.getIntegratedCircuit(1)}, Materials.StainlessSteel.getMolten(72L), ItemList.Ingot_Heavy1.get(1L), 300, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_ModHandler.getModItem("GalacticraftCore", "item.heavyPlating", 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.MeteoricIron, 2L), GT_Utility.getIntegratedCircuit(1)}, Materials.TungstenSteel.getMolten(72L), ItemList.Ingot_Heavy2.get(1L), 300, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_ModHandler.getModItem("GalacticraftMars", "item.null", 1L, 3), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Desh, 4L), GT_Utility.getIntegratedCircuit(1)}, Materials.Platinum.getMolten(72L), ItemList.Ingot_Heavy3.get(1L), 300, 7680); GT_Values.RA.addImplosionRecipe(ItemList.Ingot_Heavy1.get(1L), 8, GT_ModHandler.getModItem("GalacticraftCore", "item.heavyPlating", 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.StainlessSteel, 1L)); GT_Values.RA.addImplosionRecipe(ItemList.Ingot_Heavy2.get(1L), 16, GT_ModHandler.getModItem("GalacticraftMars", "item.null", 1L, 3), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.TungstenSteel, 2L)); GT_Values.RA.addImplosionRecipe(ItemList.Ingot_Heavy3.get(1L), 24, GT_ModHandler.getModItem("GalacticraftMars", "item.itemBasicAsteroids", 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Platinum, 3L)); -- cgit From 3a07aac9a56e9f340954e9092aecf85ba648c405 Mon Sep 17 00:00:00 2001 From: moller21 <42100910+moller21@users.noreply.github.com> Date: Sun, 23 Aug 2020 15:33:20 +0200 Subject: Attempt at improving chest buffers, also slowing down lower tier ones. --- .../implementations/GT_MetaTileEntity_Buffer.java | 23 +++--- .../java/gregtech/api/util/GT_LanguageManager.java | 2 +- src/main/java/gregtech/api/util/GT_Utility.java | 7 +- .../common/gui/GT_Container_ChestBuffer.java | 2 +- .../common/gui/GT_Container_SuperBuffer.java | 2 +- .../automation/GT_MetaTileEntity_ChestBuffer.java | 86 ++++++++++++---------- .../automation/GT_MetaTileEntity_SuperBuffer.java | 3 +- .../automation/GT_MetaTileEntity_TypeFilter.java | 6 +- 8 files changed, 68 insertions(+), 63 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 73ab28822a..a57f2440a7 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -12,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound; import static gregtech.api.enums.GT_Values.V; public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock { - public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = true; + public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = false; public int mSuccess = 0, mTargetStackSize = 0; public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { @@ -257,18 +257,15 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM } protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if( bStockingMode ) { - int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1); - if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { - mSuccess = 50; - aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true); - } - } else { - int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, (byte) 64, (byte) 1, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize); - if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { - mSuccess = 50; - aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true); - } + int tCost; + if( bStockingMode ) + tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, (byte) 1, (byte) 64, (byte) 1); + else + tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, (byte) 64, (byte) 1, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize); + + if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { + mSuccess = 50; + aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true); } } diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java index b44b6ffa40..c87e0f7417 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -323,7 +323,7 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_214", "Connected"); addStringLocalization("Interaction_DESCRIPTION_Index_215", "Disconnected"); addStringLocalization("Interaction_DESCRIPTION_Index_216", "Deprecated Recipe"); - addStringLocalization("Interaction_DESCRIPTION_Index_217", "Stocking mode. Keeps this many items in destination input slots."); + addStringLocalization("Interaction_DESCRIPTION_Index_217", "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."); addStringLocalization("Interaction_DESCRIPTION_Index_218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."); addStringLocalization("Interaction_DESCRIPTION_Index_500", "Fitting: Loose - More Flow"); addStringLocalization("Interaction_DESCRIPTION_Index_501", "Fitting: Tight - More Efficiency"); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 6df77f16bf..a65ed00aed 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -547,7 +547,7 @@ public class GT_Utility { for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; } - if (aTileEntity2 != null && aTileEntity2 instanceof IInventory) { + if (aTileEntity2 instanceof IInventory) { int[] tPutSlots = null; if (aTileEntity2 instanceof ISidedInventory) tPutSlots = ((ISidedInventory) aTileEntity2).getAccessibleSlotsFromSide(aPutTo); @@ -561,13 +561,12 @@ public class GT_Utility { byte tMovedItemCount = 0; ItemStack tGrabStack = aTileEntity1.getStackInSlot(tGrabSlots[i]); if (listContainsItem(aFilter, tGrabStack, true, aInvertFilter)) { - if (isAllowedToTakeFromSlot(aTileEntity1, tGrabSlots[i], aGrabFrom, tGrabStack)) { + if (tGrabStack.stackSize >= aMinMoveAtOnce && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlots[i], aGrabFrom, tGrabStack)) { for (int j = 0; j < tPutSlots.length; j++) { if (isAllowedToPutIntoSlot((IInventory) aTileEntity2, tPutSlots[j], aPutTo, tGrabStack, aMaxTargetStackSize)) { tMovedItemCount += moveStackFromSlotAToSlotB(aTileEntity1, (IInventory) aTileEntity2, tGrabSlots[i], tPutSlots[j], aMaxTargetStackSize, aMinTargetStackSize, (byte) (aMaxMoveAtOnce - tMovedItemCount), aMinMoveAtOnce); - if (tMovedItemCount >= aMaxMoveAtOnce) { + if (tMovedItemCount >= aMaxMoveAtOnce ||(tMovedItemCount > 0 && aMaxTargetStackSize < 64)) return tMovedItemCount; - } } } } diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java index 016d0889f7..d465134d5e 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java @@ -67,7 +67,7 @@ public class GT_Container_ChestBuffer if (aSlotIndex == 30) { ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) { - GT_Utility.sendChatToPlayer(aPlayer, trans("217","Stocking mode. Keeps this many items in destination input slots.")); + GT_Utility.sendChatToPlayer(aPlayer, trans("217","Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); } else { GT_Utility.sendChatToPlayer(aPlayer, trans("218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); } diff --git a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java index 5a59cb5aa9..530e64aa68 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java @@ -62,7 +62,7 @@ public class GT_Container_SuperBuffer if (aSlotIndex == 3) { ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) { - GT_Utility.sendChatToPlayer(aPlayer, trans("217","Stocking mode. Keeps this many items in destination input slots.")); + GT_Utility.sendChatToPlayer(aPlayer, trans("217","Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); } else { GT_Utility.sendChatToPlayer(aPlayer, trans("218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index d11b1f2f81..6605d4fc35 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -19,11 +19,15 @@ import java.util.Comparator; public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { + private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1,1,1}; + + public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 28, new String[]{ "Buffers up to 27 Item Stacks", "Use Screwdriver to regulate output stack size", - "Consumes 3EU per moved Item"}); + "Consumes 3EU per moved Item", + getTickRateDesc(aTier)}); } public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { @@ -55,6 +59,8 @@ public class GT_MetaTileEntity_ChestBuffer } protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (aTimer % tickRate[mTier] > 0) return; + if(aBaseMetaTileEntity.hasInventoryBeenModified()) { fillStacksIntoFirstSlots(); } @@ -64,9 +70,9 @@ public class GT_MetaTileEntity_ChestBuffer super.moveItems(aBaseMetaTileEntity, aTimer); } // mSuccesss is set to 50 on a successful move - if(mSuccess == 50) { - fillStacksIntoFirstSlots(); - } + //if(mSuccess == 50) { + // fillStacksIntoFirstSlots(); + //} if(mSuccess < 0) { mSuccess = 0; } @@ -85,47 +91,32 @@ public class GT_MetaTileEntity_ChestBuffer return 1; Item item1 = o1.getItem(); Item item2 = o2.getItem(); - - // If item1 is a block and item2 isn't, sort item1 before item2 - if (((item1 instanceof ItemBlock)) && (!(item2 instanceof ItemBlock))) { + + if(item1 instanceof ItemBlock) { + if (!(item2 instanceof ItemBlock)) + return -1; // If item1 is a block and item2 isn't, sort item1 before item2 + } else if (item2 instanceof ItemBlock) + return 1; // If item2 is a block and item1 isn't, sort item1 after item2 + + int id1 = Item.getIdFromItem( item1 ); + int id2 = Item.getIdFromItem( item2 ); + if ( id1 < id2 ) { return -1; } - - // If item2 is a block and item1 isn't, sort item1 after item2 - if (((item2 instanceof ItemBlock)) && (!(item1 instanceof ItemBlock))) { + if ( id1 > id2 ) { return 1; } - // If the items are blocks, use the string comparison - if ((item1 instanceof ItemBlock)) { // only need to check one since we did the check above - String displayName1 = o1.getDisplayName(); - String displayName2 = o2.getDisplayName(); - int result = displayName1.compareToIgnoreCase(displayName2); - //GT_FML_LOGGER.info("sorter: " + displayName1 + " " + displayName2 + " " + result); - return result; - } else - { - // Not a block. Use the ID and damage to compare them. - int id1 = Item.getIdFromItem( item1 ); - int id2 = Item.getIdFromItem( item2 ); - if ( id1 < id2 ) { - return -1; - } - if ( id1 > id2 ) { - return 1; - } - // id1 must equal id2, get their damage and compare - id1 = o1.getItemDamage(); - id2 = o2.getItemDamage(); - - if ( id1 < id2 ) { - return -1; - } - if ( id1 > id2 ) { - return 1; - } - return 0; + id1 = o1.getItemDamage(); + id2 = o2.getItemDamage(); + + if ( id1 < id2 ) { + return -1; + } + if ( id1 > id2 ) { + return 1; } + return 0; } }); } @@ -155,4 +146,21 @@ public class GT_MetaTileEntity_ChestBuffer public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); } + + protected static String getTickRateDesc(int tier){ + int tickRate = getTickRate(tier); + String s = ""; + if (tickRate < 20) + s = "1/" + 20/tickRate + " "; + else if (tickRate > 20) { + s = (tickRate / 20) + "th "; + } + return "Moves items every " + s + "second"; + } + + protected static int getTickRate(int tier) { + if (tier > 9) + return 1; + return tickRate[tier]; + } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java index 10fcb47d12..da35f17518 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -15,7 +15,8 @@ public class GT_MetaTileEntity_SuperBuffer super(aID, aName, aNameRegional, aTier, 257, new String[]{ "Buffers up to 256 Item Stacks", "Use Screwdriver to regulate output stack size", - "Consumes 1EU per moved Item"}); + "Consumes 1EU per moved Item", + getTickRateDesc(aTier)}); } public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 9b9f782601..6292a769a2 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -83,17 +83,17 @@ public class GT_MetaTileEntity_TypeFilter } } } - this.mRotationIndex = 0; + this.mRotationIndex = -1; } } public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); - if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) { + if ((getBaseMetaTileEntity().isServerSide()) && ((aTick % 8L == 0L) || mRotationIndex == -1)) { if (this.mPrefix.mPrefixedItems.isEmpty()) { this.mInventory[9] = null; } else { - this.mInventory[9] = GT_Utility.copyAmount(1L, new Object[]{this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())}); + this.mInventory[9] = GT_Utility.copyAmount(1L, this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); if (this.mInventory[9].getItemDamage() == 32767) { this.mInventory[9].setItemDamage(0); } -- cgit From edbf6cb86a352a4b84a09f85b5869ba41ba35563 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 9 Sep 2020 08:04:03 +0800 Subject: Fix GTNewHorizons/GT-New-Horizons-Modpack#6586 This makes it waste the extra fuel value, give the optimal output advertised on tooltip and always have an efficiency of 100%. --- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 8e29d620c3..4bd44ef80c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -88,6 +88,17 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); + + if (aOptFlow < fuelValue) { + // turbine too weak and/or fuel too powerful + // at least consume 1L + this.realOptFlow = 1; + // wastes the extra fuel and generate aOptFlow directly + depleteInput(new FluidStack(firstFuelType, 1)); + this.storedFluid += 1; + return GT_Utility.safeInt((long)aOptFlow * (long)aBaseEff / 10000L); + } + actualOptimalFlow = GT_Utility.safeInt((long)aOptFlow / fuelValue); this.realOptFlow = actualOptimalFlow; -- cgit From 68dd34753ccf0d8d646a57e5384122234359cf1c Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Tue, 15 Sep 2020 20:11:57 +0200 Subject: fix horibe tps lag on multie smelter --- .../multi/GT_MetaTileEntity_MultiFurnace.java | 47 ++++++++++++++++++---- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index b21d8fe73c..1bb610e5a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -82,15 +82,48 @@ public class GT_MetaTileEntity_MultiFurnace ArrayList tInputList = getStoredInputs(); if (!tInputList.isEmpty()) { int mVolatage=GT_Utility.safeInt(getMaxInputVoltage()); - - int j = 0; - this.mOutputItems = new ItemStack[8 * this.mLevel]; - for (int i = 0; (i < 256) && (j < this.mOutputItems.length); i++) { - if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) { - j++; + int tMaxParrallel = 8 * this.mLevel; + int tCurrenParrallel = 0; + ItemStack tSmeltStack = tInputList.get(0); + ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); + if (tOutputStack == null) + return false; + for (int i = 0;i 0) { +// this.mOutputItems = new ItemStack[8 * this.mLevel]; +// for (int i = 0; (i < 256) && (j < this.mOutputItems.length); i++) { +// if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) { +// j++; +// } +// } + this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; + for (int i = 0; i64 ? 64 : tCurrenParrallel; + tNewStack.stackSize = size; + tCurrenParrallel -= size; + this.mOutputItems[i] = tNewStack; + } + + + if (this.mOutputItems != null && this.mOutputItems.length > 0) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(4, 512, 1, mVolatage); -- cgit From d8331a70f92f1c272a28f86fb0655433080aff34 Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Sun, 27 Sep 2020 19:41:51 +0200 Subject: fix furnace recipes with 2+ output fix multi smelter only given 1 item if the even if the recipe gave more then 1 item --- .../tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 1bb610e5a0..cdc68702d2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -112,6 +112,7 @@ public class GT_MetaTileEntity_MultiFurnace // j++; // } // } + tCurrenParrallel *= tOutputStack.stackSize; this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; for (int i = 0; i Date: Mon, 12 Oct 2020 20:57:59 +0200 Subject: add overflow voiding to digital chests --- .../GT_MetaTileEntity_DigitalChestBase.java | 36 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 43c1778d8f..9cbb032de2 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -15,11 +15,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; @Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2") public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEInventory { public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks"); + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use screwdrive to enable void items on over flow"); } public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -56,6 +57,14 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti aBaseMetaTileEntity.openGUI(aPlayer); return true; } + + protected boolean mVoidOverflow = false; + + @Override + public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mVoidOverflow = !mVoidOverflow; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.voidoveflow") +" "+mVoidOverflow); + } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -80,10 +89,13 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } int count = getItemCount(); ItemStack stack = getItemStack(); - if ((mInventory[0] != null) && (count < getMaxItemCount()) && GT_Utility.areStacksEqual(mInventory[0], stack)) { + if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; if (count > getMaxItemCount()) { - mInventory[0].stackSize = (count - getMaxItemCount()); + if (mVoidOverflow) + mInventory[0] = null; + else + mInventory[0].stackSize = (count - getMaxItemCount()); count = getMaxItemCount(); } else { mInventory[0] = null; @@ -106,7 +118,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti mInventory[2] = null; } } - } + }} abstract protected int getItemCount(); abstract public void setItemCount(int aCount); @@ -182,6 +194,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti aNBT.setInteger("mItemCount", getItemCount()); if (getItemStack() != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + aNBT.setBoolean("mVoidOverflow", mVoidOverflow); } @Override @@ -190,6 +203,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti setItemCount(aNBT.getInteger("mItemCount")); if (aNBT.hasKey("mItemStack")) setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"))); + mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); + } @Override @@ -235,7 +250,18 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti if (storedStack != null) { if (GT_Utility.areStacksEqual(storedStack, inputStack)) { if (input.getStackSize() + getItemCount() > getMaxItemCount()) - return createOverflowStack(input.getStackSize() + getItemCount(), mode); + { + if (mVoidOverflow) + { + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getMaxItemCount()); + return null; + } + else + { + return createOverflowStack(input.getStackSize() + getItemCount(), mode); + } + } else { if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount(getItemCount() + (int) input.getStackSize()); -- cgit From 51c8b661564bcd3c2b99572ec9dfb522076442bf Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Mon, 12 Oct 2020 21:28:23 +0200 Subject: speling --- .../common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 9cbb032de2..52e0acd72e 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -20,7 +20,7 @@ import net.minecraft.util.StatCollector; @Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2") public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEInventory { public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use screwdrive to enable void items on over flow"); + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use a screwdriver to enable voiding items on overflow"); } public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { -- cgit From 7d49c433e2dfb6f422b366fd3fb60632be2d70c7 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Mon, 12 Oct 2020 22:40:47 +0200 Subject: fix extra } in post tick --- .../common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 52e0acd72e..35d1849a6e 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -118,7 +118,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti mInventory[2] = null; } } - }} + } abstract protected int getItemCount(); abstract public void setItemCount(int aCount); -- cgit From d2f9c3c10f44a50fa07c16f1d93891e797a599b0 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Tue, 13 Oct 2020 01:18:37 +0200 Subject: remove extra if else --- .../storage/GT_MetaTileEntity_DigitalChestBase.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 35d1849a6e..15b6c28f6d 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -91,14 +91,11 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti ItemStack stack = getItemStack(); if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (count > getMaxItemCount()) { - if (mVoidOverflow) - mInventory[0] = null; - else - mInventory[0].stackSize = (count - getMaxItemCount()); - count = getMaxItemCount(); - } else { + if (count <= getMaxItemCount() || mVoidOverflow ) { mInventory[0] = null; + } else { + mInventory[0].stackSize = (count - getMaxItemCount()); + count = getMaxItemCount(); } } if (mInventory[1] == null && stack != null) { -- cgit From 344b00012aca59c4b0372185e41f529baffa5da3 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Tue, 13 Oct 2020 22:26:49 +0800 Subject: Make cleanroom workspeed based on height and tier It is now 225 second per block height. A standard 3x4x3 cleanroom will take 7.5 minute to fire up (down from 8.33 minute). Any wider will not cause it to slowdown. The cleanroom will be overclockable (not perfect). --- .../machines/multi/GT_MetaTileEntity_Cleanroom.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 673c2cabaf..6ceebc3877 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -18,8 +18,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { + private int mHeight = -1; public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -46,17 +48,20 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas "Up to 10 Machine Hull Item & Energy transfer through walls", "Remaining Blocks: Plascrete, 20 min", GT_Values.cleanroomGlass+"% of the Plascrete can be Reinforced Glass (min 20 Plascrete still apply)", - "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency", + "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked", "An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV", "2 LV batteries + 1 LV generator or 1 MV generator", + "Time required to reach full efficiency is propotional to the height of empty space within.", "Make sure your Energy Hatch matches!"}; } @Override public boolean checkRecipe(ItemStack aStack) { mEfficiencyIncrease = 100; - mMaxProgresstime = 100; - mEUt = -4; + // use the standard overclock mechanism to determine duration and estimate a maximum consumption + calculateOverclockedNessMulti(40, 45 * Math.min(1, mHeight - 1), 1, getMaxInputVoltage()); + // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. + mEUt /= -10; return true; } @@ -231,6 +236,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas float ratio = (((float)mPlascreteCount)/100f)* GT_Values.cleanroomGlass; + this.mHeight = -y; + return mPlascreteCount>=20 && mGlassCount < (int) Math.floor(ratio); } -- cgit From cf5760685cb16758329f32df8eadfc703ec8abae Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Tue, 13 Oct 2020 17:31:28 +0200 Subject: better localisation handeling --- .../tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java | 2 +- src/main/resources/assets/gregtech/lang/en_US.lang | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 15b6c28f6d..6d97d9011d 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -63,7 +63,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mVoidOverflow = !mVoidOverflow; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.voidoveflow") +" "+mVoidOverflow); + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); } @Override diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index bb76bb3c9c..88616c6041 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -41,7 +41,8 @@ GT5U.machines.separatebus=Input busses are separated GT5U.machines.pumpareaset=Pumping area set to GT5U.machines.oilfluidpump=Oil/Fluid Pump GT5U.machines.minermulti=Multiblock Miner -GT5U.machines.voidoveflow=Void Over Flow +GT5U.machines.voidoveflow.enabled=Overflow voiding enabled +GT5U.machines.voidoveflow.disabled=Overflow voiding disabled -- cgit From 6d9bd4fff43c6e76766816908758127737dde642 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 19 Oct 2020 10:54:08 +0200 Subject: Bee Definition Cleanup (#326) * Bee Definition Cleanup Removed a Lot of boilerplate code, by using Consumers instead of Overrides Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made Use of Static imports + use "Color" class for better IDE integration & readability + parameterised some Generics + reroute some Method overloads Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed an oversight Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed a typo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../gregtech/common/bees/GT_AlleleBeeSpecies.java | 14 +- .../java/gregtech/common/bees/GT_AlleleHelper.java | 11 +- .../java/gregtech/common/bees/GT_Bee_Mutation.java | 5 +- .../gregtech/loaders/misc/GT_BeeDefinition.java | 6032 +++++++++----------- .../gregtech/loaders/misc/GT_BranchDefinition.java | 289 +- 5 files changed, 2781 insertions(+), 3570 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java b/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java index 83dc82e6f9..41726b4fc5 100644 --- a/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java +++ b/src/main/java/gregtech/common/bees/GT_AlleleBeeSpecies.java @@ -8,9 +8,19 @@ import forestry.apiculture.genetics.alleles.AlleleBeeSpecies; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import java.awt.*; + public class GT_AlleleBeeSpecies extends AlleleBeeSpecies { - public GT_AlleleBeeSpecies(String uid, boolean dominant, String unlocalizedName, String authority, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor) { - super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor); + public GT_AlleleBeeSpecies(String uid, + boolean dominant, + String unlocalizedName, + String authority, + String unlocalizedDescription, + IClassification branch, + String binomial, + Color primaryColor, + Color secondaryColor) { + super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor.getRGB(), secondaryColor.getRGB()); AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.SPECIES); } diff --git a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java index cb54f5d4a1..e1db4c2ac0 100644 --- a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java +++ b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java @@ -21,7 +21,7 @@ public class GT_AlleleHelper extends AlleleHelper { private static final String modId = Constants.ID; - private Map> alleleMaps = new HashMap<>(); + private Map, Map> alleleMaps = new HashMap<>(); public void init() { if (PluginManager.Module.APICULTURE.isEnabled()) { @@ -114,12 +114,17 @@ public class GT_AlleleHelper extends AlleleHelper { } alleleMaps.put(Boolean.class, booleans); } - + @SuppressWarnings("unchecked") public static void initialisation(){ GT_AlleleHelper helper = new GT_AlleleHelper(); try { - helper.alleleMaps = (Map>) FieldUtils.readField(FieldUtils.getField(AlleleHelper.class,"alleleMaps",true),AlleleHelper.instance,true); + helper.alleleMaps = (Map, Map>) + FieldUtils.readField( + FieldUtils.getField(AlleleHelper.class,"alleleMaps",true), + AlleleHelper.instance, + true + ); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java index 7b61505fc7..ca919e7cf2 100644 --- a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java +++ b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java @@ -16,7 +16,7 @@ import java.util.List; public class GT_Bee_Mutation extends BeeMutation { - private float split = 1; + private final float split; public GT_Bee_Mutation(IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance, float split) { super(bee0, bee1, result, chance); @@ -52,6 +52,7 @@ public class GT_Bee_Mutation extends BeeMutation { return processedChance; } + @SuppressWarnings("unchecked") private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) { float mutationChance = this.getBaseChance(); List mutationConditions = null; @@ -61,7 +62,7 @@ public class GT_Bee_Mutation extends BeeMutation { if (f == null) return mutationChance; try { - mutationConditions = f.get(this) instanceof List ? (List) f.get(this) : null; + mutationConditions = f.get(this) instanceof List ? (List) f.get(this) : null; } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java b/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java index 95914d1a71..097c2dd034 100644 --- a/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java +++ b/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java @@ -14,7 +14,6 @@ import forestry.apiculture.genetics.BeeVariation; import forestry.apiculture.genetics.IBeeDefinition; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.alleles.AlleleHelper; -import forestry.core.genetics.alleles.EnumAllele; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -34,3411 +33,2573 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import org.apache.commons.lang3.text.WordUtils; +import java.awt.*; import java.util.Arrays; import java.util.Locale; +import java.util.function.Consumer; + +import static forestry.api.apiculture.EnumBeeChromosome.*; +import static forestry.api.core.EnumHumidity.ARID; +import static forestry.api.core.EnumHumidity.DAMP; +import static forestry.api.core.EnumTemperature.*; +import static forestry.core.genetics.alleles.EnumAllele.*; +import static gregtech.loaders.misc.GT_BeeDefinitionReference.*; + +@SuppressWarnings("ALL") +/** + * Bride Class for Lambdas + */ +class GT_BeeDefinitionReference { + protected final static byte FORESTRY = 0; + protected final static byte EXTRABEES = 1; + protected final static byte GENDUSTRY = 2; + protected final static byte MAGICBEES = 3; + protected final static byte GREGTECH = 4; + private GT_BeeDefinitionReference() {} +} -public enum GT_BeeDefinition implements IBeeDefinition { - - //organic - CLAY(GT_BranchDefinition.ORGANIC, "Clay", true, 0xC8C8DA, 0x0000FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); - beeSpecies.addProduct(new ItemStack(Items.clay_ball, 1), 0.15f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("BiomesOPlenty", "mudball", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - //Example - //beeSpecies.setIsSecret(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); - //Exaples - //template = BeeDefinition.CULTIVATED.getTemplate(); - //AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - //tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(-1)); - //tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(50)); - //tMutation.requireResource(Blocks.coal_block, 0); - //AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); - //tMutation.requireResource(GameRegistry.findBlock("minecraft", "sand"), 1); - //AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, GT_Bees.superLife); - //tMutation.restrictDateRange( 1, 1, 1, 1); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY, "Industrious"), getSpecies(FORRESTRY, "Diligent"), 10); - tMutation.requireResource(Blocks.clay,0); //blockStainedHardenedClay - } - }, - SLIMEBALL(GT_BranchDefinition.ORGANIC, "SlimeBall", true, 0x4E9E55, 0x00FF15) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 15), 0.30f); - beeSpecies.addProduct(new ItemStack(Items.slime_ball, 1), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STICKY), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - if (Loader.isModLoaded("TConstruct")) { - beeSpecies.addProduct(GT_ModHandler.getModItem("TConstruct", "strangeFood", 1, 0), 0.10f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("TConstruct", "slime.gel", 1, 2), 0.01f); - } - - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.MUSHROOMS); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "water")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Marshy"), CLAY.species, 7); - if (Loader.isModLoaded("TConstruct")) - tMutation.requireResource(GameRegistry.findBlock("TConstruct", "slime.gel"), 1); - } - }, - PEAT(GT_BranchDefinition.ORGANIC, "Peat", true, 0x906237, 0x58300B) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LIGNIE), 0.30f); - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.15f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "peat", 1, 0), 0.15f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "mulch", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Rural"), CLAY.species, 10); - } - }, - STICKYRESIN(GT_BranchDefinition.ORGANIC, "StickyResin", true, 0x2E8F5B, 0xDCC289) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STICKY), 0.15f); - beeSpecies.addSpecialty(ItemList.IC2_Resin.get(1), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SLIMEBALL.species, PEAT.species, 15); - tMutation.requireResource("logRubber"); - } - }, - COAL(GT_BranchDefinition.ORGANIC, "Coal", true, 0x666666, 0x525252) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LIGNIE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.COAL), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.CACTI); - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectCreeper); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Industrious"), PEAT.species, 9); - tMutation.requireResource("blockCoal"); - } - }, - OIL(GT_BranchDefinition.ORGANIC, "Oil", true, 0x4C4C4C, 0x333333) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OIL), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.NORMAL); - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "water")); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(COAL.species, STICKYRESIN.species, 4); - } - }, - SANDWICH(GT_BranchDefinition.ORGANIC, "Sandwich", true, 0x32CD32, 0xDAA520) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); - beeSpecies.addSpecialty(ItemList.Food_Sliced_Cucumber.get(1), 0.05f); - beeSpecies.addSpecialty(ItemList.Food_Sliced_Onion.get(1), 0.05f); - beeSpecies.addSpecialty(ItemList.Food_Sliced_Tomato.get(1), 0.05f); - beeSpecies.addSpecialty(ItemList.Food_Sliced_Cheese.get(1), 0.05f); - beeSpecies.addSpecialty(new ItemStack(Items.cooked_porkchop, 1, 0), 0.05f); - beeSpecies.addSpecialty(new ItemStack(Items.cooked_beef, 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_2); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectFertile); - AlleleHelper.instance.set(template, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGE); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Agrarian"), getSpecies(MAGICBEES,"TCBatty"), 10); - } - }, - ASH(GT_BranchDefinition.ORGANIC, "Ash", true, 0x1e1a18, 0xc6c6c6) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ASH), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.NORMAL); - AlleleHelper.instance.set(template, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGE); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(COAL.species, CLAY.species, 10); - tMutation.restrictTemperature(EnumTemperature.HELLISH); - } - }, - APATITE(GT_BranchDefinition.ORGANIC, "Apatite", true, 0xc1c1f6, 0x676784) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.APATITE), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ASH.species, COAL.species, 10); - tMutation.requireResource("blockApatite"); - } - }, - - FERTILIZER(GT_BranchDefinition.ORGANIC, "Fertilizer", true, 0x7fcef5, 0x654525) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); - beeSpecies.addSpecialty(GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1), 0.2f); - beeSpecies.addSpecialty(GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1), 0.2f); - beeSpecies.addSpecialty(ItemList.FR_Fertilizer.get(1), 0.3f); - beeSpecies.addSpecialty(ItemList.IC2_Fertilizer.get(1), 0.3f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ASH.species, APATITE.species, 8); - } - }, - - //IC2 - COOLANT(GT_BranchDefinition.IC2, "Coolant", false, 0x144F5A, 0x2494A2) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 4), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.COOLANT), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.SNOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectGlacial); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Icy"), getSpecies(FORRESTRY,"Glacial"), 10); - tMutation.requireResource(Block.getBlockFromItem(GT_ModHandler.getModItem("IC2", "fluidCoolant", 1).getItem()), 0); - tMutation.restrictTemperature(EnumTemperature.ICY); - } - }, - ENERGY(GT_BranchDefinition.IC2, "Energy", false, 0xC11F1F, 0xEBB9B9) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 12), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.NETHER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Demonic"), getSpecies(EXTRABEES,"volcanic"), 10); - tMutation.requireResource(Block.getBlockFromItem(GT_ModHandler.getModItem("IC2", "fluidHotCoolant", 1).getItem()), 0); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(128, "Boneyard Biome"));//Boneyard Biome - } - }, - LAPOTRON(GT_BranchDefinition.IC2, "Lapotron", false, 0x6478FF, 0x1414FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LAPIS), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LAPOTRON), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.SNOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(LAPIS.species, ENERGY.species, 6); - tMutation.requireResource("blockLapis"); - tMutation.restrictTemperature(EnumTemperature.ICY); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//moon dim - } - }, - PYROTHEUM(GT_BranchDefinition.IC2, "Pyrotheum", false, 0xffebc4, 0xe36400) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PYROTHEUM), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.NETHER); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, ENERGY.species, 4); - tMutation.restrictTemperature(EnumTemperature.HELLISH); - } - }, - CRYOTHEUM(GT_BranchDefinition.IC2, "Cryotheum", false, 0x2660ff, 0x5af7ff) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COOLANT), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CRYOTHEUM), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectSnowing); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.SNOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, COOLANT.species, 4); - tMutation.restrictTemperature(EnumTemperature.ICY); - } - }, - //Alloy - REDALLOY(GT_BranchDefinition.GTALLOY, "RedAlloy", false, 0xE60000, 0xB80000) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDALLOY), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(COPPER.species, REDSTONE.species, 10); - tMutation.requireResource("blockRedAlloy"); - } - }, - REDSTONEALLOY(GT_BranchDefinition.GTALLOY, "RedStoneAlloy", false, 0xA50808, 0xE80000) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONEALLOY), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, REDALLOY.species, 8); - tMutation.requireResource("blockRedstoneAlloy"); - } - }, - CONDUCTIVEIRON(GT_BranchDefinition.GTALLOY, "ConductiveIron", false, 0xCEADA3, 0x817671) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CONDUCTIVEIRON), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONEALLOY.species, IRON.species, 8); - tMutation.requireResource("blockConductiveIron"); - } - }, - VIBRANTALLOY(GT_BranchDefinition.GTALLOY, "VibrantAlloy", false, 0x86A12D, 0xC4F2AE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.VIBRANTALLOY), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FAST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ENERGETICALLOY.species, getSpecies(FORRESTRY,"Phantasmal"), 6); - tMutation.requireResource("blockVibrantAlloy"); - tMutation.restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH); - } - }, - ENERGETICALLOY(GT_BranchDefinition.GTALLOY, "EnergeticAlloy", false, 0xFF9933, 0xFFAD5C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGETICALLOY), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONEALLOY.species, getSpecies(FORRESTRY,"Demonic"), 9); - tMutation.requireResource("blockEnergeticAlloy"); - } - }, - ELECTRICALSTEEL(GT_BranchDefinition.GTALLOY, "ElectricalSteel", false, 0x787878, 0xD8D8D8) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ELECTRICALSTEEL), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(STEEL.species, getSpecies(FORRESTRY,"Demonic"), 9); - tMutation.requireResource("blockElectricalSteel"); - } - }, - DARKSTEEL(GT_BranchDefinition.GTALLOY, "DarkSteel", false, 0x252525, 0x443B44) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DARKSTEEL), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ELECTRICALSTEEL.species, getSpecies(FORRESTRY,"Demonic"), 7); - tMutation.requireResource("blockDarkSteel"); - } - }, - PULSATINGIRON(GT_BranchDefinition.GTALLOY, "PulsatingIron", false, 0x6DD284, 0x006600) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PULSATINGIRON), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDALLOY.species, getSpecies(FORRESTRY,"Ended"), 9); - tMutation.requireResource("blockPulsatingIron"); - } - }, - STAINLESSSTEEL(GT_BranchDefinition.GTALLOY, "StainlessSteel", false, 0xC8C8DC, 0x778899) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STEEL), 0.10f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STAINLESSSTEEL), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CHROME), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - } - - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CHROME.species, STEEL.species, 9); - tMutation.requireResource("blockStainlessSteel"); - } - }, - ENDERIUM(GT_BranchDefinition.GTALLOY, "Enderium", false, 0x599087, 0x2E8B57) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDERIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CHROME), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, GT_Bees.speedBlinding); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(EXTRABEES, "teleport")); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLATINUM.species, getSpecies(FORRESTRY,"Phantasmal"), 3); - tMutation.requireResource("blockEnderium"); - } - }, - //thaumic - THAUMIUMDUST(GT_BranchDefinition.THAUMIC, "ThaumiumDust", true, 0x7A007A, 0x5C005C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMIUMDUST), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_2); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectExploration); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.JUNGLE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"TCFire"), getSpecies(FORRESTRY,"Edenic"), 10); - tMutation.requireResource("blockThaumium"); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest - } - }, - THAUMIUMSHARD(GT_BranchDefinition.THAUMIC, "ThaumiumShard", true, 0x9966FF, 0xAD85FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.THAUMIUMDUST), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMIUMSHARD), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.SNOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectGlacial); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMDUST.species, getSpecies(MAGICBEES,"TCWater"), 10); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest - } - }, - AMBER(GT_BranchDefinition.THAUMIC, "Amber", true, 0xEE7700, 0x774B15) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.AMBER), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMDUST.species, STICKYRESIN.species, 10); - tMutation.requireResource("blockAmber"); - } - }, - QUICKSILVER(GT_BranchDefinition.THAUMIC, "Quicksilver", true, 0x7A007A, 0x5C005C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUICKSILVER), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.JUNGLE); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectMiasmic); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMDUST.species, SILVER.species, 10); - } - }, - SALISMUNDUS(GT_BranchDefinition.THAUMIC, "SalisMundus", true, 0xF7ADDE, 0x592582) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.JUNGLE); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectMiasmic); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMDUST.species, THAUMIUMSHARD.species, 8); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest - } - }, - TAINTED(GT_BranchDefinition.THAUMIC, "Tainted", true, 0x904BB8, 0xE800FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.TAINTED), 0.20f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.CAVE_DWELLING, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.LOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMDUST.species, THAUMIUMSHARD.species, 7); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(193, "Tainted Land"));//Tainted Land - } - }, - MITHRIL(GT_BranchDefinition.THAUMIC, "Mithril", true, 0xF0E68C, 0xFFFFD2) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MITHRIL), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.CAVE_DWELLING, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.LOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(IO.species, PLATINUM.species, 7); - tMutation.requireResource(GregTech_API.sBlockMetal4, 10); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim - } - }, - ASTRALSILVER(GT_BranchDefinition.THAUMIC, "AstralSilver", true, 0xAFEEEE, 0xE6E6FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SILVER), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ASTRALSILVER), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.CAVE_DWELLING, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.LOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SILVER.species, IRON.species, 3); - tMutation.requireResource(GregTech_API.sBlockMetal1, 6); - } - }, - THAUMINITE(GT_BranchDefinition.THAUMIC, "Thauminite", true, 0x2E2D79, 0x7581E0) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "comb", 1, 19), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMINITE), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"TCOrder"), THAUMIUMDUST.species, 8); - if (Loader.isModLoaded("thaumicbases")) - tMutation.requireResource(GameRegistry.findBlock("thaumicbases", "thauminiteBlock"), 0); - } - }, - SHADOWMETAL(GT_BranchDefinition.THAUMIC, "ShadowMetal", true, 0x100322, 0x100342) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "comb", 1, 20), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SHADOWMETAL), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"TCChaos"), getSpecies(MAGICBEES,"TCVoid"), 6); - if (Loader.isModLoaded("TaintedMagic")) - tMutation.requireResource(GameRegistry.findBlock("TaintedMagic", "BlockShadowmetal"), 0); - } - }, - DIVIDED(GT_BranchDefinition.THAUMIC, "Unstable", true, 0xF0F0F0, 0xDCDCDC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 61), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DIVIDED), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOW); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(DIAMOND.species, IRON.species, 3); - if (Loader.isModLoaded("ExtraUtilities")) - tMutation.requireResource(GameRegistry.findBlock("ExtraUtilities", "decorativeBlock1"), 5); - } - }, - SPARKELING(GT_BranchDefinition.THAUMIC, "NetherStar", true, 0x7A007A, 0xFFFFFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "miscResources", 1, 3), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SPARKELING), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.CAVE_DWELLING, true); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.NETHER); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectAggressive); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"Withering"), getSpecies(MAGICBEES, "Draconic"), 1); - tMutation.requireResource(GregTech_API.sBlockGem3, 3); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(9, "END Biome"));//sky end biome - } - }, -//gems - REDSTONE(GT_BranchDefinition.GEM, "Redstone", true, 0x7D0F0F, 0xD11919) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONE), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RAREEARTH), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Industrious"), getSpecies(FORRESTRY,"Demonic"), 10); - tMutation.requireResource("blockRedstone"); - } - }, - LAPIS(GT_BranchDefinition.GEM, "Lapis", true, 0x1947D1, 0x476CDA) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LAPIS), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Demonic"), getSpecies(FORRESTRY,"Imperial"), 10); - tMutation.requireResource("blockLapis"); - } - }, - CERTUS(GT_BranchDefinition.GEM, "CertusQuartz", true, 0x57CFFB, 0xBBEEFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CERTUS), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY, "Hermitic"), LAPIS.species, 10); - if (Loader.isModLoaded("appliedenergistics2")) - tMutation.requireResource(GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"), 0); - } - }, - FLUIX(GT_BranchDefinition.GEM, "FluixDust", true, 0xA375FF, 0xB591FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FLUIX), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, LAPIS.species, 7); - if (Loader.isModLoaded("appliedenergistics2")) - tMutation.requireResource(GameRegistry.findBlock("appliedenergistics2", "tile.BlockFluix"), 0); - } - }, - RUBY(GT_BranchDefinition.GEM, "Ruby", false, 0xE6005C, 0xCC0052) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.RUBY), 0.15f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.REDGARNET), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, DIAMOND.species, 5); - tMutation.requireResource("blockRuby"); - } - }, - SAPPHIRE(GT_BranchDefinition.GEM, "Sapphire", true, 0x0033CC, 0x00248F) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SAPPHIRE), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CERTUS.species, LAPIS.species, 5); - tMutation.requireResource(GregTech_API.sBlockGem2, 12); - } - }, - DIAMOND(GT_BranchDefinition.GEM, "Diamond", false, 0xCCFFFF, 0xA3CCCC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DIAMOND), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CERTUS.species, COAL.species, 3); - tMutation.requireResource("blockDiamond"); - } - }, - OLIVINE(GT_BranchDefinition.GEM, "Olivine", true, 0x248F24, 0xCCFFCC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OLIVINE), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MAGNESIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CERTUS.species, getSpecies(FORRESTRY,"Ended"), 5); - } - }, - EMERALD(GT_BranchDefinition.GEM, "Emerald", false, 0x248F24, 0x2EB82E) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.EMERALD), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ALUMINIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(OLIVINE.species, DIAMOND.species, 4); - tMutation.requireResource("blockEmerald"); - } - }, - REDGARNET(GT_BranchDefinition.GEM, "RedGarnet", false, 0xBD4C4C, 0xECCECE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDGARNET), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PYROPE), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(DIAMOND.species, RUBY.species, 4); - tMutation.requireResource("blockGarnetRed"); - } - }, - YELLOWGARNET(GT_BranchDefinition.GEM, "YellowGarnet", false, 0xA3A341, 0xEDEDCE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.YELLOWGARNET), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GROSSULAR), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(EMERALD.species, REDGARNET.species, 3); - tMutation.requireResource("blockGarnetYellow"); - } - }, - FIRESTONE(GT_BranchDefinition.GEM, "Firestone", false, 0xC00000, 0xFF0000) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FIRESTONE), 0.15f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, RUBY.species, 4); - tMutation.requireResource("blockFirestone"); - } - }, - //Metal Line - COPPER(GT_BranchDefinition.METAL, "Copper", true, 0xFF6600, 0xE65C00) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COPPER), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GOLD), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Majestic"), CLAY.species, 13); - tMutation.requireResource("blockCopper"); - } - }, - TIN(GT_BranchDefinition.METAL, "Tin", true, 0xD4D4D4, 0xDDDDDD) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TIN), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ZINC), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CLAY.species, getSpecies(FORRESTRY,"Diligent"), 13); - tMutation.requireResource("blockTin"); - } - }, - LEAD(GT_BranchDefinition.METAL, "Lead", true, 0x666699, 0xA3A3CC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LEAD), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SULFUR), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(COAL.species, COPPER.species, 13); - tMutation.requireResource("blockLead"); - } - }, - IRON(GT_BranchDefinition.METAL, "Iron", true, 0xDA9147, 0xDE9C59) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.IRON), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.TIN), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TIN.species, COPPER.species, 13); - tMutation.requireResource("blockIron"); - } - }, - STEEL(GT_BranchDefinition.METAL, "Steel", true, 0x808080, 0x999999) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STEEL), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRON), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(IRON.species, COAL.species, 10); - tMutation.requireResource("blockSteel"); - tMutation.restrictTemperature(EnumTemperature.HOT); - - } - }, - NICKEL(GT_BranchDefinition.METAL, "Nickel", true, 0x8585AD, 0x8585AD) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NICKEL), 0.15f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.02f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(IRON.species, COPPER.species, 13); - tMutation.requireResource("blockNickel"); - } - }, - ZINC(GT_BranchDefinition.METAL, "Zinc", true, 0xF0DEF0, 0xF2E1F2) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ZINC), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GALLIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(IRON.species, TIN.species, 13); - tMutation.requireResource("blockZinc"); - } - }, - SILVER(GT_BranchDefinition.METAL, "Silver", true, 0xC2C2D6, 0xCECEDE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SILVER), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SULFUR), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(LEAD.species, TIN.species, 10); - tMutation.requireResource("blockSilver"); - } - }, - GOLD(GT_BranchDefinition.METAL, "Gold", true, 0xEBC633, 0xEDCC47) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.GOLD), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NICKEL), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(LEAD.species, COPPER.species, 13); - tMutation.requireResource("blockGold"); - tMutation.restrictTemperature(EnumTemperature.HOT); - } - }, - ARSENIC(GT_BranchDefinition.METAL, "Arsenic", true, 0x736C52, 0x292412) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ARSENIC), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ZINC.species, SILVER.species, 10); - tMutation.requireResource("blockArsenic"); - } - }, - //Rare Metals - ALUMINIUM(GT_BranchDefinition.RAREMETAL, "Aluminium", true, 0xB8B8FF, 0xD6D6FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ALUMINIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.BAUXITE), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NICKEL.species, ZINC.species, 9); - tMutation.requireResource("blockAluminium"); - } - }, - TITANIUM(GT_BranchDefinition.RAREMETAL, "Titanium", true, 0xCC99FF, 0xDBB8FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TITANIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ALMANDINE), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, ALUMINIUM.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal7, 9); - } - }, - CHROME(GT_BranchDefinition.RAREMETAL, "Chrome", true, 0xEBA1EB, 0xF2C3F2) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CHROME), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MAGNESIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TITANIUM.species, RUBY.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal2, 3); - } - }, - MANGANESE(GT_BranchDefinition.RAREMETAL, "Manganese", true, 0xD5D5D5, 0xAAAAAA) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MANGANESE), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRON), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TITANIUM.species, ALUMINIUM.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal4, 6); - } - }, - TUNGSTEN(GT_BranchDefinition.RAREMETAL, "Tungsten", false, 0x5C5C8A, 0x7D7DA1) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TUNGSTEN), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MOLYBDENUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Heroic"), MANGANESE.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal7, 11); - } - }, - PLATINUM(GT_BranchDefinition.RAREMETAL, "Platinum", false, 0xE6E6E6, 0xFFFFCC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.02f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(DIAMOND.species, CHROME.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal5, 12); - } - }, - IRIDIUM(GT_BranchDefinition.RAREMETAL, "Iridium", false, 0xDADADA, 0xD1D1E0) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OSMIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TUNGSTEN.species, PLATINUM.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal3, 12); - } - }, - OSMIUM(GT_BranchDefinition.RAREMETAL, "Osmium", false, 0x2B2BDA, 0x8B8B8B) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OSMIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TUNGSTEN.species, PLATINUM.species, 5); - tMutation.requireResource(GregTech_API.sBlockMetal5, 9); - } - }, - LITHIUM(GT_BranchDefinition.RAREMETAL, "Lithium", false, 0xF0328C, 0xE1DCFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LITHIUM), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALT), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SALTY.species, ALUMINIUM.species, 5); - tMutation.requireResource("blockLithium"); - } - }, - SALTY(GT_BranchDefinition.RAREMETAL, "Salt", true, 0xF0C8C8, 0xFAFAFA) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALT), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LITHIUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.WARM); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CLAY.species, ALUMINIUM.species, 5); - tMutation.requireResource("blockSalt"); - } - }, - ELECTROTINE(GT_BranchDefinition.RAREMETAL, "Electrotine", false, 0x1E90FF, 0x3CB4C8) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ELECTROTINE), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONE), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, GOLD.species, 5); - tMutation.requireResource("blockElectrotine"); - } - }, - //radiactive - URANIUM(GT_BranchDefinition.RADIOACTIVE, "Uranium", true, 0x19AF19, 0x169E16) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.URANIUM), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Avenging"), PLATINUM.species, 2); - tMutation.requireResource(GregTech_API.sBlockMetal7, 14); - } - }, - PLUTONIUM(GT_BranchDefinition.RADIOACTIVE, "Plutonium", true, 0x570000, 0x240000) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LEAD), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PLUTONIUM), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(URANIUM.species, EMERALD.species, 2); - tMutation.requireResource(GregTech_API.sBlockMetal5, 13); - } - }, - - NAQUADAH(GT_BranchDefinition.RADIOACTIVE, "Naquadah", false, 0x003300, 0x002400) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADAH), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLUTONIUM.species, IRIDIUM.species, 1); - tMutation.requireResource(GregTech_API.sBlockMetal4, 12); - } - }, - - NAQUADRIA(GT_BranchDefinition.RADIOACTIVE, "Naquadria", false, 0x000000, 0x002400) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADAH), 0.20f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADRIA), 0.15f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLUTONIUM.species, IRIDIUM.species, 8,10); - tMutation.requireResource(GregTech_API.sBlockMetal4, 15); - } - }, - DOB(GT_BranchDefinition.RADIOACTIVE, "DOB", false, 0x003300, 0x002400) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.DOB), 0.75f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NAQUADAH.species, THAUMIUMSHARD.species, 1); - if (Loader.isModLoaded("AdvancedSolarPanel")) - tMutation.requireResource(GameRegistry.findBlock("AdvancedSolarPanel", "BlockAdvSolarPanel"), 2); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(9, "END Biome"));//sky end biome - } - }, - THORIUM(GT_BranchDefinition.RADIOACTIVE, "Thorium", false, 0x005000, 0x001E00) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.THORIUM), 0.75f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(COAL.species, URANIUM.species, 2).setIsSecret(); - tMutation.requireResource(GregTech_API.sBlockMetal7, 5); - } - }, - LUTETIUM(GT_BranchDefinition.RADIOACTIVE, "Lutetium", false, 0xE6FFE6, 0xFFFFFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LUTETIUM), 0.15f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(THORIUM.species, getSpecies(EXTRABEES,"rotten"), 1).setIsSecret(); - tMutation.requireResource(GregTech_API.sBlockMetal4, 3); - } - }, - AMERICIUM(GT_BranchDefinition.RADIOACTIVE, "Americium", false, 0xE6E6FF, 0xC8C8C8) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.AMERICUM), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(LUTETIUM.species, CHROME.species, 3, 4).setIsSecret(); - tMutation.requireResource(GregTech_API.sBlockMetal1, 2); - } - }, - NEUTRONIUM(GT_BranchDefinition.RADIOACTIVE, "Neutronium", false, 0xFFF0F0, 0xFAFAFA) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEUTRONIUM), 0.0001f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.NOCTURNAL, true); - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(NAQUADRIA.species, AMERICIUM.species, 1,2).setIsSecret(); - tMutation.requireResource(GregTech_API.sBlockMetal5, 2); - } - }, - //Twilight - NAGA(GT_BranchDefinition.TWILIGHT, "Naga", true, 0x0D5A0D, 0x28874B) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.02f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAGA), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"Eldritch"), getSpecies(FORRESTRY,"Imperial"), 8); - tMutation.restrictHumidity(EnumHumidity.DAMP); - } - }, - LICH(GT_BranchDefinition.TWILIGHT, "Lich", true, 0xC5C5C5, 0x5C605E) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.04f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LICH), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(MAGICBEES,"Supernatural"), NAGA.species, 7); - tMutation.restrictHumidity(EnumHumidity.ARID); - } - }, - HYDRA(GT_BranchDefinition.TWILIGHT, "Hydra", true, 0x872836, 0xB8132C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.06f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.HYDRA), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(LICH.species, getSpecies(MAGICBEES,"TCFire"), 6); - tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(138, "Undergarden"));//undergarden biome - } - }, - URGHAST(GT_BranchDefinition.TWILIGHT, "UrGhast", true, 0xA7041C, 0x7C0618) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.08f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.URGHAST), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(HYDRA.species, THAUMIUMDUST.species, 5); - if (Loader.isModLoaded("Thaumcraft")) - tMutation.requireResource(GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 4); - tMutation.restrictTemperature(EnumTemperature.HELLISH); - } - }, - SNOWQUEEN(GT_BranchDefinition.TWILIGHT, "SnowQueen", true, 0xD02001, 0x9C0018) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.15f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SNOWQUEEN), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(URGHAST.species, SALISMUNDUS.species, 4); - if (Loader.isModLoaded("thaumicbases")) - tMutation.requireResource(GameRegistry.findBlock("thaumicbases", "blockSalisMundus"), 0); - tMutation.restrictTemperature(EnumTemperature.ICY); - } - }, - //HEE - ENDDUST(GT_BranchDefinition.HEE, "End Dust", true, 0xCC00FA, 0x003A7D) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDDUST), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.NORMAL); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Ended"), STAINLESSSTEEL.species, 8); - - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "end_powder_ore"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - ENDIUM(GT_BranchDefinition.HEE, "Endium", true, 0xa0ffff, 0x2F5A6C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDIUM), 0.10f); - beeSpecies.addSpecialty(GT_Bees.propolis.getStackForType(PropolisType.Endium), 0.15f); - beeSpecies.addSpecialty(GT_Bees.drop.getStackForType(DropType.ENDERGOO), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.NORMAL); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Ended"), THAUMIUMDUST.species, 8); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource("blockHeeEndium"); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - STARDUST(GT_BranchDefinition.HEE, "Star Dust", true, 0xffff00, 0xDCBE13) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STARDUST), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, GT_Bees.speedBlinding); - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Ended"), ZINC.species, 8); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "stardust_ore"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - } - }, - - ECTOPLASMA(GT_BranchDefinition.HEE, "Ectoplasma", true, 0xDCB0E5, 0x381C40) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ECTOPLASMA), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Ended"), ENDDUST.species, 5); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "spooky_log"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - ARCANESHARDS(GT_BranchDefinition.HEE, "Arcane Shards", true, 0x9010AD, 0x333D82) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ARCANESHARD), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONG); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(THAUMIUMSHARD.species, ENDDUST.species, 5); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "laboratory_floor"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - DRAGONESSENCE(GT_BranchDefinition.HEE, "Dragonessence", true, 0xFFA12B, 0x911ECE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DRAGONESSENCE), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectBeatific); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_3); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_3); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ECTOPLASMA.species, ARCANESHARDS.species, 4); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 1); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - FIREESSENCE(GT_BranchDefinition.HEE, "Fireessence", true, 0xD41238, 0xFFA157) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FIREESSENSE), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.ELONGATED); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_3); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_3); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(FIRESTONE.species, ARCANESHARDS.species, 4); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 2); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - ENDERMANHEAD(GT_BranchDefinition.HEE, "Enderman", true, 0x161616, 0x6200e7) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDERMAN), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(EXTRABEES, "teleport")); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.UP_1); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ENDERIUM.species, STARDUST.species, 4); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "ender_goo"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - - SILVERFISH(GT_BranchDefinition.HEE, "Silverfisch", true, 0xEE053D, 0x000000) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SILVERFISH), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGER); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(MAGICBEES, "SlowSpeed")); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); - - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ECTOPLASMA.species, STARDUST.species, 5); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "ender_goo"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - RUNE(GT_BranchDefinition.HEE, "Rune", true, 0xE31010, 0x0104D9) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RUNEI), 0.0025f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RUNEII), 0.00125f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, GT_Bees.superLife); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(MAGICBEES, "SlowSpeed")); - AlleleHelper.instance.set(template, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(template, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(DRAGONESSENCE.species, STARDUST.species, 2).setIsSecret(); - tMutation.restrictHumidity(EnumHumidity.ARID); - if (Loader.isModLoaded("EnderStorage")) - tMutation.requireResource(GameRegistry.findBlock("EnderStorage", "enderChest"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - - - } - }, - //Space Bees - SPACE(GT_BranchDefinition.SPACE, "Space", true, 0x003366, 0xC0C0C0) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.02f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(getSpecies(FORRESTRY,"Industrious"), getSpecies(FORRESTRY,"Heroic"), 10); - tMutation.restrictTemperature(EnumTemperature.ICY); - } - }, - METEORICIRON(GT_BranchDefinition.SPACE, "MeteoricIron", true, 0x321928, 0x643250) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.04f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.METEORICIRON), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SPACE.species, IRON.species, 9); - tMutation.requireResource(GregTech_API.sBlockMetal4, 7); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//Moon Dim - } - }, - DESH(GT_BranchDefinition.SPACE, "Desh", false, 0x323232, 0x282828) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.06f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DESH), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, AlleleEffect.effectIgnition); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MARS.species, TITANIUM.species, 9); - tMutation.requireResource(GregTech_API.sBlockMetal2, 12); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(29, "Mars"));//Mars Dim - } - }, - LEDOX(GT_BranchDefinition.SPACE, "Ledox", false, 0x0000CD, 0x0074FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.10f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LEDOX), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(EXTRABEES, "freezing")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CALLISTO.species, LEAD.species, 7); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Ledox"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(35, "Europa"));//Europa Dim - } - }, - CALLISTOICE(GT_BranchDefinition.SPACE, "CallistoIce", false, 0x0074FF, 0x1EB1FF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.10f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CALLISTOICE), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(EXTRABEES, "freezing")); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CALLISTO.species, getSpecies(EXTRABEES,"freezing"), 7); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.CallistoColdIce"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(45, "Callisto"));//Callisto Dim - } - }, - MYTRYL(GT_BranchDefinition.SPACE, "Mytryl", false, 0xDAA520, 0xF26404) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.16f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MYTRYL), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(IO.species, MITHRIL.species, 6); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Mytryl"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim - } - }, - QUANTIUM(GT_BranchDefinition.SPACE, "Quantium", false, 0x00FF00, 0x00D10B) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.16f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(VENUS.species, OSMIUM.species, 6); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Quantinum"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(39, "Venus"));//Venus Dim - } - }, - ORIHARUKON(GT_BranchDefinition.SPACE, "Oriharukon", false, 0x228B22, 0x677D68) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.26f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ORIHARUKON), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(LEAD.species, OBERON.species, 5); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "metalsblock"), 6); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(46, "Oberon"));//Oberon Dim - } - }, - MYSTERIOUSCRYSTAL(GT_BranchDefinition.SPACE, "MysteriousCrystal", false, 0x3CB371, 0x16856C) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.42f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MYSTERIOUSCRYSTAL), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ENCELADUS.species, EMERALD.species, 3); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.MysteriousCrystal"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim - } - }, - BLACKPLUTONIUM(GT_BranchDefinition.SPACE, "BlackPlutonium", false, 0x000000, 0x323232) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.68f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.BLACKPLUTONIUM), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLUTO.species, PLUTONIUM.species, 2); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.BlackPlutonium"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(49, "Pluto"));//Pluto Dim - } - }, - TRINIUM(GT_BranchDefinition.SPACE, "Trinium", false, 0xB0E0E6, 0xC8C8D2) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TRINIUM), 0.75f); - beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.SPEED, GT_Bees.speedBlinding); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(ENCELADUS.species, IRIDIUM.species, 4); - tMutation.requireResource(GregTech_API.sBlockMetal4, 9); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim - } - }, - //Planet Line - MERCURY(GT_BranchDefinition.PLANET, "Mercury", false, 0x4A4033, 0xB5A288) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MERCURY), 0.50f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, TUNGSTEN.species, 25, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "mercuryblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(37, "Mercury"));//Mercury Dim - } - }, - VENUS(GT_BranchDefinition.PLANET, "Venus", false, 0x4A4033, 0xB5A288) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VENUS), 0.50f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, MITHRIL.species, 25, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "venusblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(39, "Venus"));//Venus Dim - } - }, - MOON(GT_BranchDefinition.PLANET, "Moon", false, 0x373735, 0x7E7E78) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MOON), 0.50f); - if (Loader.isModLoaded("dreamcraft")) - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MoonStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SPACE.species, CLAY.species, 25); - if (Loader.isModLoaded("GalacticraftCore")) - tMutation.requireResource(GameRegistry.findBlock("GalacticraftCore", "tile.moonBlock"), 4); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//Moon Dim - } - }, - MARS(GT_BranchDefinition.PLANET, "Mars", false, 0x220D05, 0x3A1505) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MarsStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MOON.species, IRON.species, 20); - if (Loader.isModLoaded("GalacticraftMars")) - tMutation.requireResource(GameRegistry.findBlock("GalacticraftMars", "tile.mars"), 5); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(29, "Mars"));//Mars Dim - } - }, - PHOBOS(GT_BranchDefinition.PLANET, "Phobos", true, 0x220D05, 0x7a5706) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.25f); - if (Loader.isModLoaded("dreamcraft")) - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PhobosStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MARS.species, MOON.species, 20); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "phobosblocks"), 2); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(38, "Phobos"));//Phobos Dim - } - }, - DEIMOS(GT_BranchDefinition.PLANET, "Deimos", true, 0x220D05, 0x7a3206) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.DeimosStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MARS.species, SPACE.species, 20); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "deimosblocks"), 1); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(40, "Deimos"));//Deimos Dim - } - }, - CERES(GT_BranchDefinition.PLANET, "Ceres", true, 0x3ca5b7, 0x1e7267) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CeresStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MARS.species, METEORICIRON.species, 20); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ceresblocks"), 1); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(42, "Ceres"));//Ceres Dim - } - }, - JUPITER(GT_BranchDefinition.PLANET, "Jupiter", false, 0x734B2E, 0xD0CBC4) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoIceDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.GanymedeStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MARS.species, DESH.species, 15); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Ledox"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteriods"));//Asteriods Dim - } - }, - IO(GT_BranchDefinition.PLANET, "IO", true, 0x734B2E, 0xe5701b) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, getSpecies(EXTRABEES, "volcanic"), 15); - tMutation.restrictTemperature(EnumTemperature.HELLISH); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ioblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim - } - }, - EUROPA(GT_BranchDefinition.PLANET, "Europa", true, 0x5982ea, 0x0b36a3) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1, 0), 0.10f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, IRON.species, 15); - tMutation.restrictTemperature(EnumTemperature.ICY); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "europagrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(35, "Europa"));//Europa Dim - } - }, - GANYMEDE(GT_BranchDefinition.PLANET, "Ganymede", true, 0x3d1b10, 0x190c07) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.GanymedeStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.COLD); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, TITANIUM.species, 15); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ganymedeblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(43, "Ganymede"));//Ganymede Dim - } - }, - CALLISTO(GT_BranchDefinition.PLANET, "Callisto", true, 0x0f333d, 0x0d84a5) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1, 0), 0.10f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoIceDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, getSpecies(EXTRABEES, "artic"), 15); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "callistoblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(45, "Callisto"));//Callisto Dim - } - }, - SATURN(GT_BranchDefinition.PLANET, "Saturn", false, 0xD2A472, 0xF8C37B) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusIceDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(JUPITER.species, LEDOX.species, 25, 2); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Quantinum"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteriods"));//Asteriods Dim - } - }, - ENCELADUS(GT_BranchDefinition.PLANET, "Enceladus", true, 0xD2A472, 0x193fa0) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1, 0), 0.10f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusIceDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SATURN.species, CHROME.species, 25, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "enceladusblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim - } - }, - TITAN(GT_BranchDefinition.PLANET, "Titan", true, 0xa0641b, 0x7c1024) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SATURN.species, NICKEL.species, 25, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "titanblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(44, "Titan"));//Titan Dim - } - }, - URANUS(GT_BranchDefinition.PLANET, "Uranus", false, 0x75C0C9, 0x84D8EC) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(SATURN.species, TRINIUM.species, 10); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "metalsblock"), 6); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteroids"));//Asteroids Dim - } - }, - MIRANDA(GT_BranchDefinition.PLANET, "Miranda", true, 0x75C0C9, 0x0d211c) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(URANUS.species, TIN.species, 10); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "mirandablocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(86, "Miranda"));//Miranda Dim - } - }, - OBERON(GT_BranchDefinition.PLANET, "Oberon", true, 0x4A4033, 0xB5A288) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(URANUS.species, IRIDIUM.species, 10); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "oberonblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(46, "Oberon"));//Oberon Dim - } - }, - NEPTUNE(GT_BranchDefinition.PLANET, "Neptune", false, 0x334CFF, 0x576DFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(URANUS.species, ORIHARUKON.species, 7); - if (Loader.isModLoaded("dreamcraft")) - tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.MysteriousCrystal"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteroids"));//Asteroids Dim - } - }, - PROTEUS(GT_BranchDefinition.PLANET, "Proteus", true, 0x334CFF, 0x592610) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NEPTUNE.species, COPPER.species, 7); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "proteusblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(47, "Proteus"));//Proteus Dim - } - }, - TRITON(GT_BranchDefinition.PLANET, "Triton", true, 0x334CFF, 0x421118) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NEPTUNE.species, GOLD.species, 7); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tritonblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(48, "Triton"));//Triton Dim - } - }, - PLUTO(GT_BranchDefinition.PLANET, "Pluto", false, 0x34271E, 0x69503D) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLUTO), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PlutoStoneDust", 1, 0), 0.10f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PlutoIceDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NEPTUNE.species, PLUTONIUM.species, 5); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "plutoblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(49, "Pluto"));//Pluto Dim - } - }, - HAUMEA(GT_BranchDefinition.PLANET, "Haumea", false, 0x1C1413, 0x392B28) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.HAUMEA), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.HaumeaStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.ICY); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLUTO.species, NAQUADAH.species, 7, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "haumeablocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(83, "Haumea"));//Haumea Dim - } - }, - MAKEMAKE(GT_BranchDefinition.PLANET, "MakeMake", false, 0x301811, 0x120A07) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MAKEMAKE), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MakeMakeStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(PLUTO.species, NAQUADRIA.species, 7, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "makemakegrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(25, "MakeMake"));//MakeMake Dim - } - }, - CENTAURI(GT_BranchDefinition.PLANET, "Centauri", false, 0x2F2A14, 0xB06B32) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CENTAURI), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MAKEMAKE.species, DESH.species, 3); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "acentauribbgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim - } - }, - ACENTAURI(GT_BranchDefinition.PLANET, "aCentauri", false, 0x2F2A14, 0xa01e14) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CENTAURI), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(CENTAURI.species, INFINITYCATALYST.species, 3); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "acentauribbgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(31, "aCentauri"));//aCentauri Dim - } - }, - TCETI(GT_BranchDefinition.PLANET, "tCeti", false, 0x46241A, 0x7B412F) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TCETI), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MAKEMAKE.species, HAUMEA.species, 5, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tcetieblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim - } - }, - TCETIE(GT_BranchDefinition.PLANET, "tCetiE", false, 0x2d561b, 0x0c0f60) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TCETI), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(TCETI.species, getSpecies(MAGICBEES, "TCWater"), 5, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tcetieblocks"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(85, "tCeti E"));//tCeti E Dim - } - }, - BARNARDA(GT_BranchDefinition.PLANET, "Barnarda", false, 0x0D5A0D, 0xE6C18D) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1, 0), 0.05f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - beeSpecies.setHasEffect(); - } +public enum GT_BeeDefinition implements IBeeDefinition { + //organic + CLAY(GT_BranchDefinition.ORGANIC, "Clay", true, new Color(0xC8C8DA), new Color(0x0000FF), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); + beeSpecies.addProduct(new ItemStack(Items.clay_ball, 1), 0.15f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("BiomesOPlenty", "mudball", 1, 0), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOWER); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.VANILLA); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Industrious"), getSpecies(FORESTRY, "Diligent"), 10); + tMutation.requireResource(Blocks.clay, 0); //blockStainedHardenedClay + } + ), + SLIMEBALL(GT_BranchDefinition.ORGANIC, "SlimeBall", true, new Color(0x4E9E55), new Color(0x00FF15), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 15), 0.30f); + beeSpecies.addProduct(new ItemStack(Items.slime_ball, 1), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STICKY), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + if (Loader.isModLoaded("TConstruct")) { + beeSpecies.addProduct(GT_ModHandler.getModItem("TConstruct", "strangeFood", 1, 0), 0.10f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("TConstruct", "slime.gel", 1, 2), 0.01f); + } + }, + template -> { + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.MUSHROOMS); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOWER); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "water")); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Marshy"), CLAY, 7); + if (Loader.isModLoaded("TConstruct")) + tMutation.requireResource(GameRegistry.findBlock("TConstruct", "slime.gel"), 1); + } + ), + PEAT(GT_BranchDefinition.ORGANIC, "Peat", true, new Color(0x906237), new Color(0x58300B), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LIGNIE), 0.30f); + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.15f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "peat", 1, 0), 0.15f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "mulch", 1, 0), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FASTER); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + }, + dis -> dis.registerMutation(getSpecies(FORESTRY, "Rural"), CLAY, 10) + ), + STICKYRESIN(GT_BranchDefinition.ORGANIC, "StickyResin", true, new Color(0x2E8F5B), new Color(0xDCC289), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STICKY), 0.15f); + beeSpecies.addSpecialty(ItemList.IC2_Resin.get(1), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOWER); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SLIMEBALL, PEAT, 15); + tMutation.requireResource("logRubber"); + } + ), + COAL(GT_BranchDefinition.ORGANIC, "Coal", true, new Color(0x666666), new Color(0x525252), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LIGNIE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.COAL), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.CACTI); + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.DOWN_1); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectCreeper); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Industrious"), PEAT, 9); + tMutation.requireResource("blockCoal"); + } + ), + OIL(GT_BranchDefinition.ORGANIC, "Oil", true, new Color(0x4C4C4C), new Color(0x333333), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OIL), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOWER); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.NORMAL); + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "water")); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + + }, + dis -> dis.registerMutation(COAL, STICKYRESIN, 4) + ), + SANDWICH(GT_BranchDefinition.ORGANIC, "Sandwich", true, new Color(0x32CD32), new Color(0xDAA520), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); + beeSpecies.addSpecialty(ItemList.Food_Sliced_Cucumber.get(1), 0.05f); + beeSpecies.addSpecialty(ItemList.Food_Sliced_Onion.get(1), 0.05f); + beeSpecies.addSpecialty(ItemList.Food_Sliced_Tomato.get(1), 0.05f); + beeSpecies.addSpecialty(ItemList.Food_Sliced_Cheese.get(1), 0.05f); + beeSpecies.addSpecialty(new ItemStack(Items.cooked_porkchop, 1, 0), 0.05f); + beeSpecies.addSpecialty(new ItemStack(Items.cooked_beef, 1, 0), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOW); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectFertile); + AlleleHelper.instance.set(template, TERRITORY, Territory.LARGE); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FASTER); + + }, + dis -> dis.registerMutation(getSpecies(FORESTRY, "Agrarian"), getSpecies(MAGICBEES, "TCBatty"), 10) + ), + ASH(GT_BranchDefinition.ORGANIC, "Ash", true, new Color(0x1e1a18), new Color(0xc6c6c6), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ASH), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.NORMAL); + AlleleHelper.instance.set(template, TERRITORY, Territory.LARGE); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FASTER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(COAL, CLAY, 10); + tMutation.restrictTemperature(HELLISH); + } + ), + APATITE(GT_BranchDefinition.ORGANIC, "Apatite", true, new Color(0xc1c1f6), new Color(0x676784), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.APATITE), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FASTER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ASH, COAL, 10); + tMutation.requireResource("blockApatite"); + } + ), + FERTILIZER(GT_BranchDefinition.ORGANIC, "Fertilizer", true, new Color(0x7fcef5), new Color(0x654525), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 9), 0.15f); + beeSpecies.addSpecialty(GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1), 0.2f); + beeSpecies.addSpecialty(GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1), 0.2f); + beeSpecies.addSpecialty(ItemList.FR_Fertilizer.get(1), 0.3f); + beeSpecies.addSpecialty(ItemList.IC2_Fertilizer.get(1), 0.3f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FASTER); + }, + dis -> dis.registerMutation(ASH, APATITE, 8) + ), + + //gems + REDSTONE(GT_BranchDefinition.GEM, "Redstone", true, new Color(0x7D0F0F), new Color(0xD11919), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONE), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RAREEARTH), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Industrious"), getSpecies(FORESTRY, "Demonic"), 10); + tMutation.requireResource("blockRedstone"); + } + ), + LAPIS(GT_BranchDefinition.GEM, "Lapis", true, new Color(0x1947D1), new Color(0x476CDA), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LAPIS), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Demonic"), getSpecies(FORESTRY, "Imperial"), 10); + tMutation.requireResource("blockLapis"); + } + ), + CERTUS(GT_BranchDefinition.GEM, "CertusQuartz", true, new Color(0x57CFFB), new Color(0xBBEEFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CERTUS), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Hermitic"), LAPIS, 10); + if (Loader.isModLoaded("appliedenergistics2")) + tMutation.requireResource(GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"), 0); + } + ), + FLUIX(GT_BranchDefinition.GEM, "FluixDust", true, new Color(0xA375FF), new Color(0xB591FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FLUIX), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, LAPIS, 7); + if (Loader.isModLoaded("appliedenergistics2")) + tMutation.requireResource(GameRegistry.findBlock("appliedenergistics2", "tile.BlockFluix"), 0); + } + ), + DIAMOND(GT_BranchDefinition.GEM, "Diamond", false, new Color(0xCCFFFF), new Color(0xA3CCCC), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DIAMOND), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(HOT); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(CERTUS, COAL, 3); + tMutation.requireResource("blockDiamond"); + } + ), + RUBY(GT_BranchDefinition.GEM, "Ruby", false, new Color(0xE6005C), new Color(0xCC0052), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.RUBY), 0.15f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.REDGARNET), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, DIAMOND, 5); + tMutation.requireResource("blockRuby"); + } + ), + SAPPHIRE(GT_BranchDefinition.GEM, "Sapphire", true, new Color(0x0033CC), new Color(0x00248F), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SAPPHIRE), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(CERTUS, LAPIS, 5); + tMutation.requireResource(GregTech_API.sBlockGem2, 12); + } + ), + OLIVINE(GT_BranchDefinition.GEM, "Olivine", true, new Color(0x248F24), new Color(0xCCFFCC), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OLIVINE), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MAGNESIUM), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> dis.registerMutation(CERTUS, getSpecies(FORESTRY, "Ended"), 5) + ), + EMERALD(GT_BranchDefinition.GEM, "Emerald", false, new Color(0x248F24), new Color(0x2EB82E), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.EMERALD), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ALUMINIUM), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(OLIVINE, DIAMOND, 4); + tMutation.requireResource("blockEmerald"); + } + ), + REDGARNET(GT_BranchDefinition.GEM, "RedGarnet", false, new Color(0xBD4C4C), new Color(0xECCECE), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDGARNET), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PYROPE), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(DIAMOND, RUBY, 4); + tMutation.requireResource("blockGarnetRed"); + } + ), + YELLOWGARNET(GT_BranchDefinition.GEM, "YellowGarnet", false, new Color(0xA3A341), new Color(0xEDEDCE), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.YELLOWGARNET), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GROSSULAR), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(EMERALD, REDGARNET, 3); + tMutation.requireResource("blockGarnetYellow"); + } + ), + FIRESTONE(GT_BranchDefinition.GEM, "Firestone", false, new Color(0xC00000), new Color(0xFF0000), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FIRESTONE), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, RUBY, 4); + tMutation.requireResource("blockFirestone"); + } + ), - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } + //Metal Line + COPPER(GT_BranchDefinition.METAL, "Copper", true, new Color(0xFF6600), new Color(0xE65C00), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COPPER), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GOLD), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Majestic"), CLAY, 13); + tMutation.requireResource("blockCopper"); + } + ), + TIN(GT_BranchDefinition.METAL, "Tin", true, new Color(0xD4D4D4), new Color(0xDDDDDD), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TIN), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ZINC), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(CLAY, getSpecies(FORESTRY, "Diligent"), 13); + tMutation.requireResource("blockTin"); + } + ), + LEAD(GT_BranchDefinition.METAL, "Lead", true, new Color(0x666699), new Color(0xA3A3CC), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LEAD), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SULFUR), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(COAL, COPPER, 13); + tMutation.requireResource("blockLead"); + } + ), + IRON(GT_BranchDefinition.METAL, "Iron", true, new Color(0xDA9147), new Color(0xDE9C59), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.IRON), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.TIN), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TIN, COPPER, 13); + tMutation.requireResource("blockIron"); + } + ), + STEEL(GT_BranchDefinition.METAL, "Steel", true, new Color(0x808080), new Color(0x999999), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STEEL), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRON), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(IRON, COAL, 10); + tMutation.requireResource("blockSteel"); + tMutation.restrictTemperature(HOT); - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MAKEMAKE.species, THORIUM.species, 3, 2); - if (Loader.isModLoaded("GalaxySpace")) - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim - } - }, - BARNARDAC(GT_BranchDefinition.PLANET, "BarnardaC", false, 0x0D5A0D, 0x473f0a) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } + } + ), + NICKEL(GT_BranchDefinition.METAL, "Nickel", true, new Color(0x8585AD), new Color(0x8585AD), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NICKEL), 0.15f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.02f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(IRON, COPPER, 13); + tMutation.requireResource("blockNickel"); + } + ), + ZINC(GT_BranchDefinition.METAL, "Zinc", true, new Color(0xF0DEF0), new Color(0xF2E1F2), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ZINC), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.GALLIUM), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(IRON, TIN, 13); + tMutation.requireResource("blockZinc"); + } + ), + SILVER(GT_BranchDefinition.METAL, "Silver", true, new Color(0xC2C2D6), new Color(0xCECEDE), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SILVER), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SULFUR), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(LEAD, TIN, 10); + tMutation.requireResource("blockSilver"); + } + ), + GOLD(GT_BranchDefinition.METAL, "Gold", true, new Color(0xEBC633), new Color(0xEDCC47), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.GOLD), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NICKEL), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(LEAD, COPPER, 13); + tMutation.requireResource("blockGold"); + tMutation.restrictTemperature(HOT); + } + ), + ARSENIC(GT_BranchDefinition.METAL, "Arsenic", true, new Color(0x736C52), new Color(0x292412), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ARSENIC), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ZINC, SILVER, 10); + tMutation.requireResource("blockArsenic"); + } + ), - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } + //Rare Metals + ALUMINIUM(GT_BranchDefinition.RAREMETAL, "Aluminium", true, new Color(0xB8B8FF), new Color(0xD6D6FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ALUMINIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.BAUXITE), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NICKEL, ZINC, 9); + tMutation.requireResource("blockAluminium"); + } + ), + TITANIUM(GT_BranchDefinition.RAREMETAL, "Titanium", true, new Color(0xCC99FF), new Color(0xDBB8FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TITANIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ALMANDINE), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, ALUMINIUM, 5); + tMutation.requireResource(GregTech_API.sBlockMetal7, 9); + } + ), + CHROME(GT_BranchDefinition.RAREMETAL, "Chrome", true, new Color(0xEBA1EB), new Color(0xF2C3F2), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CHROME), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MAGNESIUM), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TITANIUM, RUBY, 5); + tMutation.requireResource(GregTech_API.sBlockMetal2, 3); + } + ), + MANGANESE(GT_BranchDefinition.RAREMETAL, "Manganese", true, new Color(0xD5D5D5), new Color(0xAAAAAA), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MANGANESE), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRON), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TITANIUM, ALUMINIUM, 5); + tMutation.requireResource(GregTech_API.sBlockMetal4, 6); + } + ), + TUNGSTEN(GT_BranchDefinition.RAREMETAL, "Tungsten", false, new Color(0x5C5C8A), new Color(0x7D7DA1), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TUNGSTEN), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MOLYBDENUM), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Heroic"), MANGANESE, 5); + tMutation.requireResource(GregTech_API.sBlockMetal7, 11); + } + ), + PLATINUM(GT_BranchDefinition.RAREMETAL, "Platinum", false, new Color(0xE6E6E6), new Color(0xFFFFCC), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.02f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(DIAMOND, CHROME, 5); + tMutation.requireResource(GregTech_API.sBlockMetal5, 12); + } + ), + IRIDIUM(GT_BranchDefinition.RAREMETAL, "Iridium", false, new Color(0xDADADA), new Color(0xD1D1E0), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OSMIUM), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TUNGSTEN, PLATINUM, 5); + tMutation.requireResource(GregTech_API.sBlockMetal3, 12); + } + ), + OSMIUM(GT_BranchDefinition.RAREMETAL, "Osmium", false, new Color(0x2B2BDA), new Color(0x8B8B8B), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.OSMIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.IRIDIUM), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TUNGSTEN, PLATINUM, 5); + tMutation.requireResource(GregTech_API.sBlockMetal5, 9); + } + ), + SALTY(GT_BranchDefinition.RAREMETAL, "Salt", true, new Color(0xF0C8C8), new Color(0xFAFAFA), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALT), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LITHIUM), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(CLAY, ALUMINIUM, 5); + tMutation.requireResource("blockSalt"); + } + ), + LITHIUM(GT_BranchDefinition.RAREMETAL, "Lithium", false, new Color(0xF0328C), new Color(0xE1DCFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LITHIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALT), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SALTY, ALUMINIUM, 5); + tMutation.requireResource("blockLithium"); + } + ), + ELECTROTINE(GT_BranchDefinition.RAREMETAL, "Electrotine", false, new Color(0x1E90FF), new Color(0x3CB4C8), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ELECTROTINE), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONE), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, SPEED, Speed.SLOWER), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, GOLD, 5); + tMutation.requireResource("blockElectrotine"); + } + ), - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(BARNARDA.species, AMERICIUM.species, 3, 2); - if (Loader.isModLoaded("GalaxySpace")) { - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(32, "Barnarda C"));//Barnarda C Dim + //IC2 + COOLANT(GT_BranchDefinition.IC2, "Coolant", false, new Color(0x144F5A), new Color(0x2494A2), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 4), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.COOLANT), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOW); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.SNOW); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectGlacial); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Icy"), getSpecies(FORESTRY, "Glacial"), 10); + tMutation.requireResource(Block.getBlockFromItem(GT_ModHandler.getModItem("IC2", "fluidCoolant", 1).getItem()), 0); + tMutation.restrictTemperature(ICY); } - } - }, - BARNARDAE(GT_BranchDefinition.PLANET, "BarnardaE", false, 0x0D5A0D, 0x4c1f0a) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } + ), + ENERGY(GT_BranchDefinition.IC2, "Energy", false, new Color(0xC11F1F), new Color(0xEBB9B9), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 12), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(WARM); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.NETHER); + AlleleHelper.instance.set(template, FLOWERING, Flowering.AVERAGE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Demonic"), getSpecies(EXTRABEES, "volcanic"), 10); + tMutation.requireResource(Block.getBlockFromItem(GT_ModHandler.getModItem("IC2", "fluidHotCoolant", 1).getItem()), 0); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(128, "Boneyard Biome"));//Boneyard Biome + } + ), + LAPOTRON(GT_BranchDefinition.IC2, "Lapotron", false, new Color(0x6478FF), new Color(0x1414FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LAPIS), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LAPOTRON), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.SNOW); + AlleleHelper.instance.set(template, FLOWERING, Flowering.AVERAGE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(LAPIS, ENERGY, 6); + tMutation.requireResource("blockLapis"); + tMutation.restrictTemperature(ICY); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//moon dim + } + ), + PYROTHEUM(GT_BranchDefinition.IC2, "Pyrotheum", false, new Color(0xffebc4), new Color(0xe36400), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.ENERGY), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PYROTHEUM), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.NETHER); + AlleleHelper.instance.set(template, FLOWERING, Flowering.AVERAGE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, ENERGY, 4); + tMutation.restrictTemperature(HELLISH); + } + ), + CRYOTHEUM(GT_BranchDefinition.IC2, "Cryotheum", false, new Color(0x2660ff), new Color(0x5af7ff), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COOLANT), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CRYOTHEUM), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectSnowing); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.SNOW); + AlleleHelper.instance.set(template, FLOWERING, Flowering.AVERAGE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, COOLANT, 4); + tMutation.restrictTemperature(ICY); + } + ), + //Alloy + REDALLOY(GT_BranchDefinition.GTALLOY, "RedAlloy", false, new Color(0xE60000), new Color(0xB80000), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDALLOY), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(COPPER, REDSTONE, 10); + tMutation.requireResource("blockRedAlloy"); + } + ), + REDSTONEALLOY(GT_BranchDefinition.GTALLOY, "RedStoneAlloy", false, new Color(0xA50808), new Color(0xE80000), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.REDSTONEALLOY), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONE, REDALLOY, 8); + tMutation.requireResource("blockRedstoneAlloy"); + } + ), + CONDUCTIVEIRON(GT_BranchDefinition.GTALLOY, "ConductiveIron", false, new Color(0xCEADA3), new Color(0x817671), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CONDUCTIVEIRON), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(WARM); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONEALLOY, IRON, 8); + tMutation.requireResource("blockConductiveIron"); + } + ), + ENERGETICALLOY(GT_BranchDefinition.GTALLOY, "EnergeticAlloy", false, new Color(0xFF9933), new Color(0xFFAD5C), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENERGETICALLOY), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDSTONEALLOY, getSpecies(FORESTRY, "Demonic"), 9); + tMutation.requireResource("blockEnergeticAlloy"); + } + ), + VIBRANTALLOY(GT_BranchDefinition.GTALLOY, "VibrantAlloy", false, new Color(0x86A12D), new Color(0xC4F2AE), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.VIBRANTALLOY), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, FLOWERING, Flowering.FAST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ENERGETICALLOY, getSpecies(FORESTRY, "Phantasmal"), 6); + tMutation.requireResource("blockVibrantAlloy"); + tMutation.restrictTemperature(HOT, HELLISH); + } + ), + ELECTRICALSTEEL(GT_BranchDefinition.GTALLOY, "ElectricalSteel", false, new Color(0x787878), new Color(0xD8D8D8), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ELECTRICALSTEEL), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(STEEL, getSpecies(FORESTRY, "Demonic"), 9); + tMutation.requireResource("blockElectricalSteel"); + } + ), + DARKSTEEL(GT_BranchDefinition.GTALLOY, "DarkSteel", false, new Color(0x252525), new Color(0x443B44), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DARKSTEEL), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ELECTRICALSTEEL, getSpecies(FORESTRY, "Demonic"), 7); + tMutation.requireResource("blockDarkSteel"); + } + ), + PULSATINGIRON(GT_BranchDefinition.GTALLOY, "PulsatingIron", false, new Color(0x6DD284), new Color(0x006600), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 7), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PULSATINGIRON), 0.15f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(REDALLOY, getSpecies(FORESTRY, "Ended"), 9); + tMutation.requireResource("blockPulsatingIron"); + } + ), + STAINLESSSTEEL(GT_BranchDefinition.GTALLOY, "StainlessSteel", false, new Color(0xC8C8DC), new Color(0x778899), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STEEL), 0.10f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STAINLESSSTEEL), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CHROME), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(HOT); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(CHROME, STEEL, 9); + tMutation.requireResource("blockStainlessSteel"); + } + ), + ENDERIUM(GT_BranchDefinition.GTALLOY, "Enderium", false, new Color(0x599087), new Color(0x2E8B57), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDERIUM), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CHROME), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(HOT); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, GT_Bees.speedBlinding); + AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "teleport")); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(PLATINUM, getSpecies(FORESTRY, "Phantasmal"), 3); + tMutation.requireResource("blockEnderium"); + } + ), - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } + //thaumic + THAUMIUMDUST(GT_BranchDefinition.THAUMIC, "ThaumiumDust", true, new Color(0x7A007A), new Color(0x5C005C), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMIUMDUST), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectExploration); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.JUNGLE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "TCFire"), getSpecies(FORESTRY, "Edenic"), 10); + tMutation.requireResource("blockThaumium"); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest + } + ), + THAUMIUMSHARD(GT_BranchDefinition.THAUMIC, "ThaumiumShard", true, new Color(0x9966FF), new Color(0xAD85FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.THAUMIUMDUST), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMIUMSHARD), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.SNOW); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectGlacial); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(THAUMIUMDUST, getSpecies(MAGICBEES, "TCWater"), 10); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest + } + ), + AMBER(GT_BranchDefinition.THAUMIC, "Amber", true, new Color(0xEE7700), new Color(0x774B15), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.AMBER), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(THAUMIUMDUST, STICKYRESIN, 10); + tMutation.requireResource("blockAmber"); + } + ), + QUICKSILVER(GT_BranchDefinition.THAUMIC, "Quicksilver", true, new Color(0x7A007A), new Color(0x5C005C), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUICKSILVER), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.JUNGLE); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectMiasmic); + }, + dis -> dis.registerMutation(THAUMIUMDUST, SILVER, 10) + ), + SALISMUNDUS(GT_BranchDefinition.THAUMIC, "SalisMundus", true, new Color(0xF7ADDE), new Color(0x592582), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.JUNGLE); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectMiasmic); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(THAUMIUMDUST, THAUMIUMSHARD, 8); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(192, "Magical Forest"));//magical forest + } + ), + TAINTED(GT_BranchDefinition.THAUMIC, "Tainted", true, new Color(0x904BB8), new Color(0xE800FF), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 3), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.TAINTED), 0.20f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, CAVE_DWELLING, true); + AlleleHelper.instance.set(template, TOLERANT_FLYER, true); + AlleleHelper.instance.set(template, FERTILITY, Fertility.LOW); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(THAUMIUMDUST, THAUMIUMSHARD, 7); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(193, "Tainted Land"));//Tainted Land + } + ), + MITHRIL(GT_BranchDefinition.THAUMIC, "Mithril", true, new Color(0xF0E68C), new Color(0xFFFFD2), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLATINUM), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MITHRIL), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, CAVE_DWELLING, true); + AlleleHelper.instance.set(template, TOLERANT_FLYER, true); + AlleleHelper.instance.set(template, FERTILITY, Fertility.LOW); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(IO, PLATINUM, 7); + tMutation.requireResource(GregTech_API.sBlockMetal4, 10); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim + } + } + ), + ASTRALSILVER(GT_BranchDefinition.THAUMIC, "AstralSilver", true, new Color(0xAFEEEE), new Color(0xE6E6FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SILVER), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ASTRALSILVER), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, CAVE_DWELLING, true); + AlleleHelper.instance.set(template, TOLERANT_FLYER, true); + AlleleHelper.instance.set(template, FERTILITY, Fertility.LOW); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SILVER, IRON, 3); + tMutation.requireResource(GregTech_API.sBlockMetal1, 6); + } + ), + THAUMINITE(GT_BranchDefinition.THAUMIC, "Thauminite", true, new Color(0x2E2D79), new Color(0x7581E0), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "comb", 1, 19), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.THAUMINITE), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "TCOrder"), THAUMIUMDUST, 8); + if (Loader.isModLoaded("thaumicbases")) + tMutation.requireResource(GameRegistry.findBlock("thaumicbases", "thauminiteBlock"), 0); + } + ), + SHADOWMETAL(GT_BranchDefinition.THAUMIC, "ShadowMetal", true, new Color(0x100322), new Color(0x100342), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "comb", 1, 20), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SHADOWMETAL), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "TCChaos"), getSpecies(MAGICBEES, "TCVoid"), 6); + if (Loader.isModLoaded("TaintedMagic")) + tMutation.requireResource(GameRegistry.findBlock("TaintedMagic", "BlockShadowmetal"), 0); + } + ), + DIVIDED(GT_BranchDefinition.THAUMIC, "Unstable", true, new Color(0xF0F0F0), new Color(0xDCDCDC), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 61), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DIVIDED), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(DIAMOND, IRON, 3); + if (Loader.isModLoaded("ExtraUtilities")) + tMutation.requireResource(GameRegistry.findBlock("ExtraUtilities", "decorativeBlock1"), 5); + } + ), + SPARKELING(GT_BranchDefinition.THAUMIC, "NetherStar", true, new Color(0x7A007A), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("MagicBees", "miscResources", 1, 3), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SPARKELING), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + }, + template -> { + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(template, NOCTURNAL, true); + AlleleHelper.instance.set(template, CAVE_DWELLING, true); + AlleleHelper.instance.set(template, FLOWER_PROVIDER, Flowers.NETHER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectAggressive); + AlleleHelper.instance.set(template, FLOWERING, Flowering.AVERAGE); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "Withering"), getSpecies(MAGICBEES, "Draconic"), 1); + tMutation.requireResource(GregTech_API.sBlockGem3, 3); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(9, "END Biome"));//sky end biome + } + ), - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(BARNARDA.species, DIVIDED.species, 3, 2); - if (Loader.isModLoaded("GalaxySpace")) { - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(81, "Barnard E"));//"Barnard E Dim + //radiactive + URANIUM(GT_BranchDefinition.RADIOACTIVE, "Uranium", true, new Color(0x19AF19), new Color(0x169E16), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.URANIUM), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Avenging"), PLATINUM, 2); + tMutation.requireResource(GregTech_API.sBlockMetal7, 14); } - } - }, - BARNARDAF(GT_BranchDefinition.PLANET, "BarnardaF", false, 0x0D5A0D, 0x1e0b49) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.HOT); - } + ), + PLUTONIUM(GT_BranchDefinition.RADIOACTIVE, "Plutonium", true, new Color(0x570000), new Color(0x240000), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LEAD), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.PLUTONIUM), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(URANIUM, EMERALD, 2); + tMutation.requireResource(GregTech_API.sBlockMetal5, 13); + } + ), + NAQUADAH(GT_BranchDefinition.RADIOACTIVE, "Naquadah", false, new Color(0x003300), new Color(0x002400), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADAH), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(PLUTONIUM, IRIDIUM, 1); + tMutation.requireResource(GregTech_API.sBlockMetal4, 12); + } + ), + NAQUADRIA(GT_BranchDefinition.RADIOACTIVE, "Naquadria", false, new Color(0x000000), new Color(0x002400), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SLAG), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADAH), 0.20f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAQUADRIA), 0.15f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(PLUTONIUM, IRIDIUM, 8, 10); + tMutation.requireResource(GregTech_API.sBlockMetal4, 15); + } + ), + DOB(GT_BranchDefinition.RADIOACTIVE, "DOB", false, new Color(0x003300), new Color(0x002400), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.DOB), 0.75f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NAQUADAH, THAUMIUMSHARD, 1); + if (Loader.isModLoaded("AdvancedSolarPanel")) + tMutation.requireResource(GameRegistry.findBlock("AdvancedSolarPanel", "BlockAdvSolarPanel"), 2); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(9, "END Biome"));//sky end biome + } + ), + THORIUM(GT_BranchDefinition.RADIOACTIVE, "Thorium", false, new Color(0x005000), new Color(0x001E00), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.THORIUM), 0.75f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(COAL, URANIUM, 2).setIsSecret(); + tMutation.requireResource(GregTech_API.sBlockMetal7, 5); + } + ), + LUTETIUM(GT_BranchDefinition.RADIOACTIVE, "Lutetium", false, new Color(0xE6FFE6), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.LUTETIUM), 0.15f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(THORIUM, getSpecies(EXTRABEES, "rotten"), 1).setIsSecret(); + tMutation.requireResource(GregTech_API.sBlockMetal4, 3); + } + ), + AMERICIUM(GT_BranchDefinition.RADIOACTIVE, "Americium", false, new Color(0xE6E6FF), new Color(0xC8C8C8), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.AMERICUM), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(LUTETIUM, CHROME, 3, 4).setIsSecret(); + tMutation.requireResource(GregTech_API.sBlockMetal1, 2); + } + ), + NEUTRONIUM(GT_BranchDefinition.RADIOACTIVE, "Neutronium", false, new Color(0xFFF0F0), new Color(0xFAFAFA), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEUTRONIUM), 0.0001f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(NAQUADRIA, AMERICIUM, 1, 2).setIsSecret(); + tMutation.requireResource(GregTech_API.sBlockMetal5, 2); + } + ), + //Twilight + NAGA(GT_BranchDefinition.TWILIGHT, "Naga", true, new Color(0x0D5A0D), new Color(0x28874B), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.02f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.NAGA), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "Eldritch"), getSpecies(FORESTRY, "Imperial"), 8); + tMutation.restrictHumidity(DAMP); + } + ), + LICH(GT_BranchDefinition.TWILIGHT, "Lich", true, new Color(0xC5C5C5), new Color(0x5C605E), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.04f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LICH), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(MAGICBEES, "Supernatural"), NAGA, 7); + tMutation.restrictHumidity(ARID); + } + ), + HYDRA(GT_BranchDefinition.TWILIGHT, "Hydra", true, new Color(0x872836), new Color(0xB8132C), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.06f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.HYDRA), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(LICH, getSpecies(MAGICBEES, "TCFire"), 6); + tMutation.addMutationCondition(new GT_Bees.BiomeIDMutationCondition(138, "Undergarden"));//undergarden biome + } + ), + URGHAST(GT_BranchDefinition.TWILIGHT, "UrGhast", true, new Color(0xA7041C), new Color(0x7C0618), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.08f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.URGHAST), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + beeSpecies.setNocturnal(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.FAST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(HYDRA, THAUMIUMDUST, 5); + if (Loader.isModLoaded("Thaumcraft")) + tMutation.requireResource(GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 4); + tMutation.restrictTemperature(HELLISH); + } + ), + SNOWQUEEN(GT_BranchDefinition.TWILIGHT, "SnowQueen", true, new Color(0xD02001), new Color(0x9C0018), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALISMUNDUS), 0.15f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SNOWQUEEN), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + beeSpecies.setNocturnal(); + }, + template -> { + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(URGHAST, SALISMUNDUS, 4); + if (Loader.isModLoaded("thaumicbases")) + tMutation.requireResource(GameRegistry.findBlock("thaumicbases", "blockSalisMundus"), 0); + tMutation.restrictTemperature(ICY); + } + ), + //HEE + ENDDUST(GT_BranchDefinition.HEE, "End Dust", true, new Color(0xCC00FA), new Color(0x003A7D), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDDUST), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.NORMAL), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Ended"), STAINLESSSTEEL, 8); + + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "end_powder_ore"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(BARNARDA.species, NEUTRONIUM.species, 3, 2); - if (Loader.isModLoaded("GalaxySpace")) { - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaFgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(82, "Barnard F"));//"Barnard F Dim } - } - }, - VEGA(GT_BranchDefinition.PLANET, "Vega", false, 0x1A2036, 0xB5C0DE) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VEGA), 0.50f); - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1, 0), 0.05f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.COLD); - beeSpecies.setHasEffect(); - } + ), + ENDIUM(GT_BranchDefinition.HEE, "Endium", true, new Color(0xa0ffff), new Color(0x2F5A6C), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDIUM), 0.10f); + beeSpecies.addSpecialty(GT_Bees.propolis.getStackForType(PropolisType.Endium), 0.15f); + beeSpecies.addSpecialty(GT_Bees.drop.getStackForType(DropType.ENDERGOO), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.NORMAL), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Ended"), THAUMIUMDUST, 8); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource("blockHeeEndium"); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + STARDUST(GT_BranchDefinition.HEE, "Star Dust", true, new Color(0xffff00), new Color(0xDCBE13), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.STARDUST), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, GT_Bees.speedBlinding); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOWER); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Ended"), ZINC, 8); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "stardust_ore"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + ECTOPLASMA(GT_BranchDefinition.HEE, "Ectoplasma", true, new Color(0xDCB0E5), new Color(0x381C40), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ECTOPLASMA), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Ended"), ENDDUST, 5); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "spooky_log"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(MAKEMAKE.species, NAQUADAH.species, 2); - if (Loader.isModLoaded("GalaxySpace")) { - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "vegabgrunt"), 0); + } + ), + ARCANESHARDS(GT_BranchDefinition.HEE, "Arcane Shards", true, new Color(0x9010AD), new Color(0x333D82), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ARCANESHARD), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONG); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(THAUMIUMSHARD, ENDDUST, 5); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "laboratory_floor"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + DRAGONESSENCE(GT_BranchDefinition.HEE, "Dragonessence", true, new Color(0xFFA12B), new Color(0x911ECE), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DRAGONESSENCE), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectBeatific); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_3); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_3); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ECTOPLASMA, ARCANESHARDS, 4); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 1); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + FIREESSENCE(GT_BranchDefinition.HEE, "Fireessence", true, new Color(0xD41238), new Color(0xFFA157), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.FIREESSENSE), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.ELONGATED); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_3); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.DOWN_3); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(FIRESTONE, ARCANESHARDS, 4); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 2); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + ENDERMANHEAD(GT_BranchDefinition.HEE, "Enderman", true, new Color(0x161616), new Color(0x6200e7), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ENDERMAN), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "teleport")); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.UP_1); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ENDERIUM, STARDUST, 4); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "ender_goo"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + SILVERFISH(GT_BranchDefinition.HEE, "Silverfisch", true, new Color(0xEE053D), new Color(0x000000), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.SILVERFISH), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, getEffect(MAGICBEES, "SlowSpeed")); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.DOWN_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.DOWN_1); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(ECTOPLASMA, STARDUST, 5); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "ender_goo"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + RUNE(GT_BranchDefinition.HEE, "Rune", true, new Color(0xE31010), new Color(0x0104D9), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RUNEI), 0.0025f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.RUNEII), 0.00125f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, GT_Bees.superLife); + AlleleHelper.instance.set(template, EFFECT, getEffect(MAGICBEES, "SlowSpeed")); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.NONE); + + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(DRAGONESSENCE, STARDUST, 2).setIsSecret(); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("EnderStorage")) + tMutation.requireResource(GameRegistry.findBlock("EnderStorage", "enderChest"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + //Space Bees + SPACE(GT_BranchDefinition.SPACE, "Space", true, new Color(0x003366), new Color(0xC0C0C0), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.02f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> { + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(getSpecies(FORESTRY, "Industrious"), getSpecies(FORESTRY, "Heroic"), 10); + tMutation.restrictTemperature(ICY); + } + ), + METEORICIRON(GT_BranchDefinition.SPACE, "MeteoricIron", true, new Color(0x321928), new Color(0x643250), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.04f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.METEORICIRON), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + }, + template -> { + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SPACE, IRON, 9); + tMutation.requireResource(GregTech_API.sBlockMetal4, 7); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//Moon Dim + } + ), + DESH(GT_BranchDefinition.SPACE, "Desh", false, new Color(0x323232), new Color(0x282828), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.06f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.DESH), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectIgnition), + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(MARS, TITANIUM, 9); + tMutation.requireResource(GregTech_API.sBlockMetal2, 12); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(29, "Mars"));//Mars Dim + } + } + ), + LEDOX(GT_BranchDefinition.SPACE, "Ledox", false, new Color(0x0000CD), new Color(0x0074FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.10f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.LEDOX), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "freezing")), + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(CALLISTO, LEAD, 7); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Ledox"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(35, "Europa"));//Europa Dim + } + } + ), + CALLISTOICE(GT_BranchDefinition.SPACE, "CallistoIce", false, new Color(0x0074FF), new Color(0x1EB1FF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.10f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.CALLISTOICE), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "freezing")), + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(CALLISTO, getSpecies(EXTRABEES, "freezing"), 7); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.CallistoColdIce"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(45, "Callisto"));//Callisto Dim + } + } + ), + MYTRYL(GT_BranchDefinition.SPACE, "Mytryl", false, new Color(0xDAA520), new Color(0xF26404), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.16f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MYTRYL), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(IO, MITHRIL, 6); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Mytryl"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim + } + } + ), + QUANTIUM(GT_BranchDefinition.SPACE, "Quantium", false, new Color(0x00FF00), new Color(0x00D10B), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.16f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(VENUS, OSMIUM, 6); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Quantinum"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(39, "Venus"));//Venus Dim + } + } + ), + ORIHARUKON(GT_BranchDefinition.SPACE, "Oriharukon", false, new Color(0x228B22), new Color(0x677D68), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.26f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.ORIHARUKON), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> { + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(LEAD, OBERON, 5); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "metalsblock"), 6); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(46, "Oberon"));//Oberon Dim + } + } + ), + MYSTERIOUSCRYSTAL(GT_BranchDefinition.SPACE, "MysteriousCrystal", false, new Color(0x3CB371), new Color(0x16856C), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.42f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.MYSTERIOUSCRYSTAL), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(ENCELADUS, EMERALD, 3); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.MysteriousCrystal"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim + } + } + ), + BLACKPLUTONIUM(GT_BranchDefinition.SPACE, "BlackPlutonium", false, new Color(0x000000), new Color(0x323232), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SPACE), 0.68f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.BLACKPLUTONIUM), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + }, + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(PLUTO, PLUTONIUM, 2); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.BlackPlutonium"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(49, "Pluto"));//Pluto Dim + } + } + ), + TRINIUM(GT_BranchDefinition.SPACE, "Trinium", false, new Color(0xB0E0E6), new Color(0xC8C8D2), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TRINIUM), 0.75f); + beeSpecies.addSpecialty(GT_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, GT_Bees.speedBlinding), + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(ENCELADUS, IRIDIUM, 4); + tMutation.requireResource(GregTech_API.sBlockMetal4, 9); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim + } + } + ), + //Planet Line + MOON(GT_BranchDefinition.PLANET, "Moon", false, new Color(0x373735), new Color(0x7E7E78), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MOON), 0.50f); + if (Loader.isModLoaded("dreamcraft")) + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MoonStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SPACE, CLAY, 25); + if (Loader.isModLoaded("GalacticraftCore")) + tMutation.requireResource(GameRegistry.findBlock("GalacticraftCore", "tile.moonBlock"), 4); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(28, "Moon"));//Moon Dim + } + ), + MARS(GT_BranchDefinition.PLANET, "Mars", false, new Color(0x220D05), new Color(0x3A1505), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MarsStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MOON, IRON, 20); + if (Loader.isModLoaded("GalacticraftMars")) + tMutation.requireResource(GameRegistry.findBlock("GalacticraftMars", "tile.mars"), 5); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(29, "Mars"));//Mars Dim + } + ), + PHOBOS(GT_BranchDefinition.PLANET, "Phobos", true, new Color(0x220D05), new Color(0x7a5706), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.25f); + if (Loader.isModLoaded("dreamcraft")) + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PhobosStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MARS, MOON, 20); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "phobosblocks"), 2); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(38, "Phobos"));//Phobos Dim + } + ), + DEIMOS(GT_BranchDefinition.PLANET, "Deimos", true, new Color(0x220D05), new Color(0x7a3206), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MARS), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.DeimosStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MARS, SPACE, 20); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "deimosblocks"), 1); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(40, "Deimos"));//Deimos Dim + } + ), + CERES(GT_BranchDefinition.PLANET, "Ceres", true, new Color(0x3ca5b7), new Color(0x1e7267), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CeresStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MARS, METEORICIRON, 20); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ceresblocks"), 1); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(42, "Ceres"));//Ceres Dim + } + ), + JUPITER(GT_BranchDefinition.PLANET, "Jupiter", false, new Color(0x734B2E), new Color(0xD0CBC4), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoIceDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.GanymedeStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MARS, DESH, 15); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Ledox"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteriods"));//Asteriods Dim + } + ), + IO(GT_BranchDefinition.PLANET, "IO", true, new Color(0x734B2E), new Color(0xe5701b), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, getSpecies(EXTRABEES, "volcanic"), 15); + tMutation.restrictTemperature(HELLISH); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ioblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(36, "IO"));//IO Dim + } + ), + EUROPA(GT_BranchDefinition.PLANET, "Europa", true, new Color(0x5982ea), new Color(0x0b36a3), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1, 0), 0.10f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1, 0), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, IRON, 15); + tMutation.restrictTemperature(ICY); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "europagrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(35, "Europa"));//Europa Dim + } + ), + GANYMEDE(GT_BranchDefinition.PLANET, "Ganymede", true, new Color(0x3d1b10), new Color(0x190c07), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.GanymedeStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(COLD); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, TITANIUM, 15); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "ganymedeblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(43, "Ganymede"));//Ganymede Dim + } + ), + CALLISTO(GT_BranchDefinition.PLANET, "Callisto", true, new Color(0x0f333d), new Color(0x0d84a5), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.JUPITER), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1, 0), 0.10f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CallistoIceDust", 1, 0), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, getSpecies(EXTRABEES, "artic"), 15); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "callistoblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(45, "Callisto"));//Callisto Dim + } + ), + SATURN(GT_BranchDefinition.PLANET, "Saturn", false, new Color(0xD2A472), new Color(0xF8C37B), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusIceDust", 1, 0), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, LEDOX, 25, 2); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.Quantinum"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteriods"));//Asteriods Dim + } + ), + ENCELADUS(GT_BranchDefinition.PLANET, "Enceladus", true, new Color(0xD2A472), new Color(0x193fa0), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1, 0), 0.10f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.EnceladusIceDust", 1, 0), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SATURN, CHROME, 25, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "enceladusblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim + } + ), + TITAN(GT_BranchDefinition.PLANET, "Titan", true, new Color(0xa0641b), new Color(0x7c1024), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SATURN), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SATURN, NICKEL, 25, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "titanblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(44, "Titan"));//Titan Dim + } + ), + URANUS(GT_BranchDefinition.PLANET, "Uranus", false, new Color(0x75C0C9), new Color(0x84D8EC), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(SATURN, TRINIUM, 10); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "metalsblock"), 6); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteroids"));//Asteroids Dim + } + ), + MIRANDA(GT_BranchDefinition.PLANET, "Miranda", true, new Color(0x75C0C9), new Color(0x0d211c), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(URANUS, TIN, 10); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "mirandablocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(86, "Miranda"));//Miranda Dim + } + ), + OBERON(GT_BranchDefinition.PLANET, "Oberon", true, new Color(0x4A4033), new Color(0xB5A288), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.URANUS), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(URANUS, IRIDIUM, 10); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "oberonblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(46, "Oberon"));//Oberon Dim + } + ), + NEPTUNE(GT_BranchDefinition.PLANET, "Neptune", false, new Color(0x334CFF), new Color(0x576DFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(URANUS, ORIHARUKON, 7); + if (Loader.isModLoaded("dreamcraft")) + tMutation.requireResource(GameRegistry.findBlock("dreamcraft", "tile.MysteriousCrystal"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(30, "Asteroids"));//Asteroids Dim + } + ), + PROTEUS(GT_BranchDefinition.PLANET, "Proteus", true, new Color(0x334CFF), new Color(0x592610), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NEPTUNE, COPPER, 7); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "proteusblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(47, "Proteus"));//Proteus Dim + } + ), + TRITON(GT_BranchDefinition.PLANET, "Triton", true, new Color(0x334CFF), new Color(0x421118), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.NEPTUN), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NEPTUNE, GOLD, 7); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tritonblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(48, "Triton"));//Triton Dim + } + ), + PLUTO(GT_BranchDefinition.PLANET, "Pluto", false, new Color(0x34271E), new Color(0x69503D), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.PLUTO), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PlutoStoneDust", 1, 0), 0.10f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.PlutoIceDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NEPTUNE, PLUTONIUM, 5); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "plutoblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(49, "Pluto"));//Pluto Dim + } + ), + HAUMEA(GT_BranchDefinition.PLANET, "Haumea", false, new Color(0x1C1413), new Color(0x392B28), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.HAUMEA), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.HaumeaStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(ICY); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(PLUTO, NAQUADAH, 7, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "haumeablocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(83, "Haumea"));//Haumea Dim + } + ), + MAKEMAKE(GT_BranchDefinition.PLANET, "MakeMake", false, new Color(0x301811), new Color(0x120A07), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MAKEMAKE), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.MakeMakeStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(PLUTO, NAQUADRIA, 7, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "makemakegrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(25, "MakeMake"));//MakeMake Dim + } + ), + CENTAURI(GT_BranchDefinition.PLANET, "Centauri", false, new Color(0x2F2A14), new Color(0xB06B32), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CENTAURI), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1, 0), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MAKEMAKE, DESH, 3); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "acentauribbgrunt"), 0); tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim } - } - }, - VEGAB(GT_BranchDefinition.PLANET, "VegaB", false, 0x1A2036, 0x81e261) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VEGA), 0.50f); - if (Loader.isModLoaded("dreamcraft")) - beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1, 0), 0.10f); - beeSpecies.setHumidity(EnumHumidity.ARID); - beeSpecies.setTemperature(EnumTemperature.COLD); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(VEGA.species, NAQUADRIA.species, 2); - if (Loader.isModLoaded("GalaxySpace")) { - tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "vegabgrunt"), 0); - tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(84, "VegaB"));//VegaB Dim + ), + ACENTAURI(GT_BranchDefinition.PLANET, "aCentauri", false, new Color(0x2F2A14), new Color(0xa01e14), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.CENTAURI), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + new Consumer() { + @Override + public void accept(GT_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(CENTAURI, INFINITYCATALYST, 3); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "acentauribbgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(31, "aCentauri"));//aCentauri Dim + } } - } - }, - //Infinity Line - COSMICNEUTRONIUM(GT_BranchDefinition.PLANET, "CosmicNeutronium", false, 0x484848, 0x323232) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COSMICNEUTRONIUM), 0.25f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } - - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(NEUTRONIUM.species, BARNARDAF.species, 7,10); - if (Loader.isModLoaded("Avaritia")) - tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 0); - } - }, - INFINITYCATALYST(GT_BranchDefinition.PLANET, "InfinityCatalyst", false, 0xFFFFFF, 0xFFFFFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.INFINITYCATALYST), 0.0000005f); - beeSpecies.setHumidity(EnumHumidity.DAMP); - beeSpecies.setTemperature(EnumTemperature.HELLISH); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EnumBeeChromosome.EFFECT, getEffect(EXTRABEES, "blindness")); - } - - @Override - protected void registerMutations() { - IMutationCustom tMutation = registerMutation(DOB.species, COSMICNEUTRONIUM.species, 3, 10).setIsSecret(); - if (Loader.isModLoaded("Avaritia")) - tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 1); - } - }, - INFINITY(GT_BranchDefinition.PLANET, "Infinity", false, 0xFFFFFF, 0xFFFFFF) { - @Override - protected void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.INFINITY), 0.00000005f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - } - - @Override - protected void setAlleles(IAllele[] template) { - AlleleHelper.instance.set(template, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - } + ), + TCETI(GT_BranchDefinition.PLANET, "tCeti", false, new Color(0x46241A), new Color(0x7B412F), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TCETI), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MAKEMAKE, HAUMEA, 5, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tcetieblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim + } + ), + TCETIE(GT_BranchDefinition.PLANET, "tCetiE", false, new Color(0x2d561b), new Color(0x0c0f60), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.TCETI), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(TCETI, getSpecies(MAGICBEES, "TCWater"), 5, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "tcetieblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(85, "tCeti E"));//tCeti E Dim + } + ), + BARNARDA(GT_BranchDefinition.PLANET, "Barnarda", false, new Color(0x0D5A0D), new Color(0xE6C18D), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1, 0), 0.05f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MAKEMAKE, THORIUM, 3, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim + } + ), + BARNARDAC(GT_BranchDefinition.PLANET, "BarnardaC", false, new Color(0x0D5A0D), new Color(0x473f0a), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(BARNARDA, AMERICIUM, 3, 2); + if (Loader.isModLoaded("GalaxySpace")) { + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(32, "Barnarda C"));//Barnarda C Dim + } + } + ), + BARNARDAE(GT_BranchDefinition.PLANET, "BarnardaE", false, new Color(0x0D5A0D), new Color(0x4c1f0a), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(BARNARDA, DIVIDED, 3, 2); + if (Loader.isModLoaded("GalaxySpace")) { + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaEgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(81, "Barnard E"));//"Barnard E Dim + } + } + ), + BARNARDAF(GT_BranchDefinition.PLANET, "BarnardaF", false, new Color(0x0D5A0D), new Color(0x1e0b49), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.BARNARDA), 0.25f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HOT); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(BARNARDA, NEUTRONIUM, 3, 2); + if (Loader.isModLoaded("GalaxySpace")) { + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "barnardaFgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(82, "Barnard F"));//"Barnard F Dim + } + } + ), + VEGA(GT_BranchDefinition.PLANET, "Vega", false, new Color(0x1A2036), new Color(0xB5C0DE), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VEGA), 0.50f); + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1, 0), 0.05f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(COLD); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(MAKEMAKE, NAQUADAH, 2); + if (Loader.isModLoaded("GalaxySpace")) { + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "vegabgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(33, "Kuiper Belt"));//Kuiper Belt Dim + } + } + ), + VEGAB(GT_BranchDefinition.PLANET, "VegaB", false, new Color(0x1A2036), new Color(0x81e261), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VEGA), 0.50f); + if (Loader.isModLoaded("dreamcraft")) + beeSpecies.addSpecialty(GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1, 0), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(COLD); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(VEGA, NAQUADRIA, 2); + if (Loader.isModLoaded("GalaxySpace")) { + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "vegabgrunt"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(84, "VegaB"));//VegaB Dim + } + } + ), + MERCURY(GT_BranchDefinition.PLANET, "Mercury", false, new Color(0x4A4033), new Color(0xB5A288), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.MERCURY), 0.50f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, TUNGSTEN, 25, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "mercuryblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(37, "Mercury"));//Mercury Dim + } + ), + VENUS(GT_BranchDefinition.PLANET, "Venus", false, new Color(0x4A4033), new Color(0xB5A288), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.VENUS), 0.50f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(JUPITER, MITHRIL, 25, 2); + if (Loader.isModLoaded("GalaxySpace")) + tMutation.requireResource(GameRegistry.findBlock("GalaxySpace", "venusblocks"), 0); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(39, "Venus"));//Venus Dim + } + ), - @Override - protected void registerMutations() { - IBeeMutationCustom tMutation = registerMutation(INFINITYCATALYST.species, COSMICNEUTRONIUM.species, 1, 100); - if (Loader.isModLoaded("avaritiaddons")) - tMutation.requireResource(GameRegistry.findBlock("avaritiaddons", "InfinityChest"), 0); - } - }; + //Infinity Line + COSMICNEUTRONIUM(GT_BranchDefinition.PLANET, "CosmicNeutronium", false, new Color(0x484848), new Color(0x323232), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.COSMICNEUTRONIUM), 0.25f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NEUTRONIUM, BARNARDAF, 7, 10); + if (Loader.isModLoaded("Avaritia")) + tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 0); + } + ), + INFINITYCATALYST(GT_BranchDefinition.PLANET, "InfinityCatalyst", false, new Color(0xFFFFFF), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.INFINITYCATALYST), 0.0000005f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "blindness")); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(DOB, COSMICNEUTRONIUM, 3, 10).setIsSecret(); + if (Loader.isModLoaded("Avaritia")) + tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 1); + } + ), + INFINITY(GT_BranchDefinition.PLANET, "Infinity", false, new Color(0xFFFFFF), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.INFINITY), 0.00000005f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(INFINITYCATALYST, COSMICNEUTRONIUM, 1, 100); + if (Loader.isModLoaded("avaritiaddons")) + tMutation.requireResource(GameRegistry.findBlock("avaritiaddons", "InfinityChest"), 0); + } + ), + ; private final GT_BranchDefinition branch; private final GT_AlleleBeeSpecies species; - protected final static byte FORRESTRY = 0; - protected final static byte EXTRABEES = 1; - protected final static byte GENDUSTRY = 2; - protected final static byte MAGICBEES = 3; - protected final static byte GREGTECH = 4; - - + private final Consumer mSpeciesProperties; + private final Consumer mAlleles; + private final Consumer mMutations; private IAllele[] template; private IBeeGenome genome; - GT_BeeDefinition(GT_BranchDefinition branch, String binomial, boolean dominant, int primary, int secondary) { + GT_BeeDefinition(GT_BranchDefinition branch, + String binomial, + boolean dominant, + Color primary, + Color secondary, + Consumer aSpeciesProperties, + Consumer aAlleles, + Consumer aMutations + ) { + this.mAlleles = aAlleles; + this.mMutations = aMutations; + this.mSpeciesProperties = aSpeciesProperties; String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH); String species = WordUtils.capitalize(lowercaseName); String uid = "gregtech.bee.species" + species; String description = "for.description." + species; String name = "for.bees.species." + lowercaseName; - GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName,species,true); + GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true); this.branch = branch; this.species = new GT_AlleleBeeSpecies(uid, dominant, name, "GTNH", description, branch.getBranch(), binomial, primary, secondary); @@ -3455,12 +2616,22 @@ public enum GT_BeeDefinition implements IBeeDefinition { protected static IAlleleBeeEffect getEffect(byte modid, String name) { String s; - switch(modid) { - case EXTRABEES: s = "extrabees.effect." + name;break; - case GENDUSTRY: s = "gendustry.effect." + name;break; - case MAGICBEES: s = "magicbees.effect" + name;break; - case GREGTECH: s = "gregtech.effect" + name;break; - default: s = "forestry.effect" + name;break; + switch (modid) { + case EXTRABEES: + s = "extrabees.effect." + name; + break; + case GENDUSTRY: + s = "gendustry.effect." + name; + break; + case MAGICBEES: + s = "magicbees.effect" + name; + break; + case GREGTECH: + s = "gregtech.effect" + name; + break; + default: + s = "forestry.effect" + name; + break; } return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s); @@ -3468,12 +2639,22 @@ public enum GT_BeeDefinition implements IBeeDefinition { protected static IAlleleFlowers getFlowers(byte modid, String name) { String s; - switch(modid) { - case EXTRABEES: s = "extrabees.flower." + name;break; - case GENDUSTRY: s = "gendustry.flower." + name;break; - case MAGICBEES: s = "magicbees.flower" + name;break; - case GREGTECH: s = "gregtech.flower" + name;break; - default: s = "forestry.flowers" + name;break; + switch (modid) { + case EXTRABEES: + s = "extrabees.flower." + name; + break; + case GENDUSTRY: + s = "gendustry.flower." + name; + break; + case MAGICBEES: + s = "magicbees.flower" + name; + break; + case GREGTECH: + s = "gregtech.flower" + name; + break; + default: + s = "forestry.flowers" + name; + break; } return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s); @@ -3481,16 +2662,26 @@ public enum GT_BeeDefinition implements IBeeDefinition { protected static IAlleleBeeSpecies getSpecies(byte modid, String name) { String s; - switch(modid) { - case EXTRABEES: s = "extrabees.species." + name;break; - case GENDUSTRY: s = "gendustry.bee." + name;break; - case MAGICBEES: s = "magicbees.species" + name;break; - case GREGTECH: s = "gregtech.species" + name;break; - default: s = "forestry.species" + name;break; + switch (modid) { + case EXTRABEES: + s = "extrabees.species." + name; + break; + case GENDUSTRY: + s = "gendustry.bee." + name; + break; + case MAGICBEES: + s = "magicbees.species" + name; + break; + case GREGTECH: + s = "gregtech.species" + name; + break; + default: + s = "forestry.species" + name; + break; } IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s); - if (ret == null){ + if (ret == null) { ret = NAQUADRIA.species; } @@ -3498,17 +2689,23 @@ public enum GT_BeeDefinition implements IBeeDefinition { } - protected abstract void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies); + protected final void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { + this.mSpeciesProperties.accept(beeSpecies); + } - protected abstract void setAlleles(IAllele[] template); + protected final void setAlleles(IAllele[] template) { + this.mAlleles.accept(template); + } - protected abstract void registerMutations(); + protected final void registerMutations() { + this.mMutations.accept(this); + } private void init() { setSpeciesProperties(species); template = branch.getTemplate(); - AlleleHelper.instance.set(template, EnumBeeChromosome.SPECIES, species); + AlleleHelper.instance.set(template, SPECIES, species); setAlleles(template); genome = BeeManager.beeRoot.templateAsGenome(template); @@ -3517,20 +2714,39 @@ public enum GT_BeeDefinition implements IBeeDefinition { } protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) { - return new GT_Bee_Mutation(parent1,parent2,this.getTemplate(),chance,1f); + return registerMutation(parent1, parent2, chance, 1f); + } + + protected final IBeeMutationCustom registerMutation(GT_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) { + return registerMutation(parent1, parent2, chance, 1f); + } + + protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GT_BeeDefinition parent2, int chance) { + return registerMutation(parent1, parent2, chance, 1f); + } + + protected final IBeeMutationCustom registerMutation(GT_BeeDefinition parent1, GT_BeeDefinition parent2, int chance) { + return registerMutation(parent1, parent2, chance, 1f); } /** * Diese neue Funtion erlaubt Mutationsraten unter 1%. Setze dazu die Mutationsrate als Bruch mit chance / chancedivider * This new function allows Mutation percentages under 1%. Set them as a fraction with chance / chancedivider - * @param parent1 - * @param parent2 - * @param chance - * @param chancedivider - * @return */ protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) { - return new GT_Bee_Mutation(parent1,parent2,this.getTemplate(),chance,chancedivider); + return new GT_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider); + } + + protected final IBeeMutationCustom registerMutation(GT_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) { + return registerMutation(parent1.species, parent2, chance, chancedivider); + } + + protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GT_BeeDefinition parent2, int chance, float chancedivider) { + return registerMutation(parent1, parent2.species, chance, chancedivider); + } + + protected final IBeeMutationCustom registerMutation(GT_BeeDefinition parent1, GT_BeeDefinition parent2, int chance, float chancedivider) { + return registerMutation(parent1.species, parent2, chance, chancedivider); } @Override @@ -3550,12 +2766,10 @@ public enum GT_BeeDefinition implements IBeeDefinition { @Override public final ItemStack getMemberStack(EnumBeeType beeType) { - IBee bee = getIndividual(); - return BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); + return BeeManager.beeRoot.getMemberStack(getIndividual(), beeType.ordinal()); } public final IBeeDefinition getRainResist() { return new BeeVariation.RainResist(this); } - -} +} \ No newline at end of file diff --git a/src/main/java/gregtech/loaders/misc/GT_BranchDefinition.java b/src/main/java/gregtech/loaders/misc/GT_BranchDefinition.java index 01c9982358..bc95782cdf 100644 --- a/src/main/java/gregtech/loaders/misc/GT_BranchDefinition.java +++ b/src/main/java/gregtech/loaders/misc/GT_BranchDefinition.java @@ -6,178 +6,160 @@ import forestry.api.genetics.IAllele; import forestry.api.genetics.IClassification; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.alleles.AlleleHelper; -import forestry.core.genetics.alleles.EnumAllele; import java.util.Arrays; +import java.util.function.Consumer; -import static gregtech.loaders.misc.GT_BeeDefinition.*; - +import static forestry.api.apiculture.EnumBeeChromosome.*; +import static forestry.core.genetics.alleles.EnumAllele.*; +import static gregtech.loaders.misc.GT_BeeDefinition.getEffect; +import static gregtech.loaders.misc.GT_BeeDefinition.getFlowers; +import static gregtech.loaders.misc.GT_BeeDefinitionReference.EXTRABEES; public enum GT_BranchDefinition { - ORGANIC("Fuelis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_2); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.WHEAT); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOW); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - } - }, - IC2("Industrialis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.SNOW); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOW); - } - }, - GTALLOY("Amalgamis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - } - }, - THAUMIC("Arcanis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - } - }, - GEM("Ornamentis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.NETHER); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - } - }, - METAL("Metaliferis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.CAVE_DWELLING, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.JUNGLE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWER); - } - }, - RAREMETAL("Mineralis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.CACTI); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FAST); - } - }, - RADIOACTIVE("Criticalis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.END); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.AVERAGE); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, GT_Bees.speedBlinding); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, getEffect(EXTRABEES, "radioactive")); - } - }, - TWILIGHT("Nemoris Obscuri") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTER); - } - }, - HEE("Finis Expansiones") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_2); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.BOTH_2); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOW); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGER); - } - }, - SPACE("Cosmicis") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.NOCTURNAL, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.LONGEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.FAST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGEST); - } - }, - PLANET("Planetaris") { - @Override - protected void setBranchProperties(IAllele[] alleles) { - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TOLERANT_FLYER, true); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.FASTEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.NORMAL); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.FASTEST); - AlleleHelper.instance.set(alleles, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGER); - } - }; + ORGANIC("Fuelis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.WHEAT); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(alleles, SPEED, Speed.SLOWEST); + } + ), + IC2("Industrialis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.UP_1); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.SNOW); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTER); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(alleles, SPEED, Speed.SLOW); + } + ), + GTALLOY("Amalgamis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.VANILLA); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.AVERAGE); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(alleles, SPEED, Speed.FAST); + } + ), + THAUMIC("Arcanis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTER); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.LONGEST); + } + ), + GEM("Ornamentis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.NETHER); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.AVERAGE); + } + ), + METAL("Metaliferis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(alleles, CAVE_DWELLING, true); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.JUNGLE); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOWER); + } + ), + RAREMETAL("Mineralis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.DOWN_1); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.CACTI); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FAST); + } + ), + RADIOACTIVE("Criticalis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.END); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.AVERAGE); + AlleleHelper.instance.set(alleles, SPEED, GT_Bees.speedBlinding); + AlleleHelper.instance.set(alleles, SPEED, getEffect(EXTRABEES, "radioactive")); + } + ), + TWILIGHT("Nemoris Obscuri", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, NOCTURNAL, false); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.VANILLA); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTER); + } + ), + HEE("Finis Expansiones", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, NOCTURNAL, true); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGER); + } + ), + SPACE("Cosmicis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); + AlleleHelper.instance.set(alleles, NOCTURNAL, true); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTEST); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.LONGEST); + AlleleHelper.instance.set(alleles, SPEED, Speed.FAST); + AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGEST); + } + ), + PLANET("Planetaris", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTEST); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.NORMAL); + AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGER); + } + ), + ; private static IAllele[] defaultTemplate; private final IClassification branch; + private final Consumer mBranchProperties; - GT_BranchDefinition(String scientific) { - branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(), scientific); + GT_BranchDefinition(String scientific, Consumer aBranchProperties) { + this.branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(), scientific); + this.mBranchProperties = aBranchProperties; } private static IAllele[] getDefaultTemplate() { if (defaultTemplate == null) { defaultTemplate = new IAllele[EnumBeeChromosome.values().length]; - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.NORMAL); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.NOCTURNAL, false); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.TOLERANT_FLYER, false); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.CAVE_DWELLING, false); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.FLOWERING, EnumAllele.Flowering.SLOWEST); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.AVERAGE); - AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.EFFECT, AlleleEffect.effectNone); + AlleleHelper.instance.set(defaultTemplate, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(defaultTemplate, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(defaultTemplate, FERTILITY, Fertility.NORMAL); + AlleleHelper.instance.set(defaultTemplate, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(defaultTemplate, NOCTURNAL, false); + AlleleHelper.instance.set(defaultTemplate, HUMIDITY_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(defaultTemplate, TOLERANT_FLYER, false); + AlleleHelper.instance.set(defaultTemplate, CAVE_DWELLING, false); + AlleleHelper.instance.set(defaultTemplate, FLOWER_PROVIDER, Flowers.VANILLA); + AlleleHelper.instance.set(defaultTemplate, FLOWERING, Flowering.SLOWEST); + AlleleHelper.instance.set(defaultTemplate, TERRITORY, Territory.AVERAGE); + AlleleHelper.instance.set(defaultTemplate, EFFECT, AlleleEffect.effectNone); } return Arrays.copyOf(defaultTemplate, defaultTemplate.length); } - protected void setBranchProperties(IAllele[] template) { - + protected final void setBranchProperties(IAllele[] template) { + this.mBranchProperties.accept(template); } public final IAllele[] getTemplate() { @@ -189,5 +171,4 @@ public enum GT_BranchDefinition { public final IClassification getBranch() { return branch; } - -} +} \ No newline at end of file -- cgit From 87abc3b419dfe42fb1c0cf943deaeb2e3037e19c Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 23 Oct 2020 01:14:15 +0800 Subject: Actually hide filled volumetric flask in NEI Previously this is called too early that many fluid are simply not yet registered. Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../java/gregtech/common/items/GT_VolumetricFlask.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index d0132b1fdd..8fe075ad58 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -2,6 +2,7 @@ package gregtech.common.items; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; @@ -43,17 +44,17 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain setMaxStackSize(16); setNoRepair(); if (Loader.isModLoaded("NotEnoughItems")) { - for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) { - if (fluid != null) { - ItemStack stack = new ItemStack(this); - setCapacity(stack, getMaxCapacity()); - fill(stack, new FluidStack(fluid, Integer.MAX_VALUE), true); - codechicken.nei.api.API.hideItem(stack); - } - } + hideItemInNEI(); } } + @Optional.Method(modid = "NotEnoughItems") + private void hideItemInNEI() { + codechicken.nei.api.API.addItemFilter( + () -> aStack -> aStack.getItem() == this && this.getFluid(aStack) != null + ); + } + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (!world.isRemote && isEmpty(stack) && getMovingObjectPositionFromPlayer(world, player, true) == null) player.openGui(GT_Values.GT, 1010, world, 0, 0, 0); -- cgit From 153ee9bf191586265d846c8f224e64f5fae0a18b Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 25 Oct 2020 03:38:00 +0800 Subject: Move the hide to proper place & use proper api Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/common/items/GT_VolumetricFlask.java | 10 ---------- src/main/java/gregtech/nei/NEI_GT_Config.java | 7 +++++-- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index 8fe075ad58..a7bd63f0a6 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -43,16 +43,6 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain unlocalFlaskName = unlocalized; setMaxStackSize(16); setNoRepair(); - if (Loader.isModLoaded("NotEnoughItems")) { - hideItemInNEI(); - } - } - - @Optional.Method(modid = "NotEnoughItems") - private void hideItemInNEI() { - codechicken.nei.api.API.addItemFilter( - () -> aStack -> aStack.getItem() == this && this.getFluid(aStack) != null - ); } public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { diff --git a/src/main/java/gregtech/nei/NEI_GT_Config.java b/src/main/java/gregtech/nei/NEI_GT_Config.java index 36db6879db..8f6c0385b9 100644 --- a/src/main/java/gregtech/nei/NEI_GT_Config.java +++ b/src/main/java/gregtech/nei/NEI_GT_Config.java @@ -2,6 +2,7 @@ package gregtech.nei; import codechicken.nei.api.IConfigureNEI; import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; public class NEI_GT_Config @@ -16,8 +17,10 @@ public class NEI_GT_Config new GT_NEI_DefaultHandler(tMap); } } - if(FMLCommonHandler.instance().getEffectiveSide().isClient()) - ALH=new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes); + if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + ALH = new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes); + codechicken.nei.api.API.addItemListEntry(ItemList.VOLUMETRIC_FLASK.get(1)); + } sIsAdded = true; } -- cgit From 1683c8aa42e2cef678be65dade6b748125a11c06 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 25 Oct 2020 03:41:12 +0800 Subject: Organize import Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/common/items/GT_VolumetricFlask.java | 2 -- src/main/java/gregtech/nei/NEI_GT_Config.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index a7bd63f0a6..5ab6b3395e 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -1,8 +1,6 @@ package gregtech.common.items; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; diff --git a/src/main/java/gregtech/nei/NEI_GT_Config.java b/src/main/java/gregtech/nei/NEI_GT_Config.java index 8f6c0385b9..d1db906fd0 100644 --- a/src/main/java/gregtech/nei/NEI_GT_Config.java +++ b/src/main/java/gregtech/nei/NEI_GT_Config.java @@ -17,7 +17,7 @@ public class NEI_GT_Config new GT_NEI_DefaultHandler(tMap); } } - if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { ALH = new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes); codechicken.nei.api.API.addItemListEntry(ItemList.VOLUMETRIC_FLASK.get(1)); } -- cgit From 388f542576c2652971c24e9d92922ca94ce256cb Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 28 Oct 2020 22:34:56 +0800 Subject: Fix ore not synced to client in some cases Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../java/gregtech/common/blocks/GT_TileEntity_Ores.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 6c4a03420d..b7387f23af 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -132,7 +132,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) { - if ((this.mBlocked == (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1)) ? 1 : 0) == 0) { + /** + * mBlocked == true means every surrounding block is solid, so this ore is hidden and no need to display it to client + * here we check if surrounding has changed. if yes then send a packet and update the state, otherwise do nothing. + */ + if (this.mBlocked != ( + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord) && + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord) && + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord) && + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord) && + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1) && + GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1) + )) { + this.mBlocked = !this.mBlocked; GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); } } -- cgit From ccc5048f488fb110099efd0bcf9b8f308ba67e6c Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 29 Oct 2020 01:22:31 +0800 Subject: Fix ore not synced to client in some cases (again) Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index b7387f23af..2eb100599b 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -132,19 +132,14 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) { - /** - * mBlocked == true means every surrounding block is solid, so this ore is hidden and no need to display it to client - * here we check if surrounding has changed. if yes then send a packet and update the state, otherwise do nothing. - */ - if (this.mBlocked != ( + if (!(this.mBlocked = ( GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord) && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord) && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord) && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord) && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1) && GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1) - )) { - this.mBlocked = !this.mBlocked; + ))) { GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); } } -- cgit From e13b3764e3e452ba14a96f49fdc32a520c7f2085 Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Tue, 3 Nov 2020 03:25:11 -0500 Subject: Added IV HOG only LCE --- src/main/java/gregtech/api/enums/ItemList.java | 2 + src/main/java/gregtech/api/enums/Textures.java | 3 + .../gregtech/common/blocks/GT_Block_Casings8.java | 6 +- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 289 +++++++++++++++++++++ .../preload/GT_Loader_MetaTileEntities.java | 7 +- .../MACHINE_CASING_EXTREME_ENGINE_INTAKE.png | Bin 0 -> 585 bytes .../OVERLAY_FRONT_EXTREME_DIESEL_ENGINE.png | Bin 0 -> 439 bytes .../OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE.png | Bin 0 -> 457 bytes .../gui/multimachines/LargeExtremeDieselEngine.png | Bin 0 -> 1673 bytes 9 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_EXTREME_ENGINE_INTAKE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/gui/multimachines/LargeExtremeDieselEngine.png (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 6f7a0567a1..8830ab50a5 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -1427,6 +1427,7 @@ public enum ItemList implements IItemContainer { Casing_Turbine2, Casing_Turbine3, Casing_EngineIntake, + Casing_ExtremeEngineIntake, Casing_Coil_Cupronickel, Casing_Coil_Kanthal, @@ -1570,6 +1571,7 @@ public enum ItemList implements IItemContainer { CuringOven, Machine_Multi_Assemblyline, Machine_Multi_DieselEngine, + Machine_Multi_ExtremeDieselEngine, QuantumEye, QuantumStar, Gravistar, diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 7b229550ff..38001faebb 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -267,6 +267,7 @@ public class Textures { MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL, MACHINE_CASING_ENGINE_INTAKE, + MACHINE_CASING_EXTREME_ENGINE_INTAKE,//changed color in a terrible way MACHINE_CASING_CHEMICALLY_INERT, MACHINE_COIL_CUPRONICKEL, @@ -854,6 +855,8 @@ public class Textures { OVERLAY_FRONT_OIL_DRILL, OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE, OVERLAY_FRONT_DIESEL_ENGINE, + OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE, + OVERLAY_FRONT_EXTREME_DIESEL_ENGINE, OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE, OVERLAY_FRONT_PYROLYSE_OVEN, diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java index 8d2c976b1b..0f3aac4518 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -15,18 +15,20 @@ public class GT_Block_Casings8 //WATCH OUT FOR TEXTURE ID's public GT_Block_Casings8() { super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE); - for (int i = 0; i < 4; i = (i + 1)) { + for (int i = 0; i < 5; i = (i + 1)) { Textures.BlockIcons.casingTexturePages[1][i+48] = new GT_CopiedBlockTexture(this, 6, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "PTFE Pipe Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mining Neutronium Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Mining Black Plutonium Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Extreme Engine Intake Casing"); ItemList.Casing_Chemically_Inert.set(new ItemStack(this, 1, 0)); ItemList.Casing_Pipe_Polytetrafluoroethylene.set(new ItemStack(this, 1, 1)); ItemList.Casing_MiningNeutronium.set(new ItemStack(this, 1, 2)); ItemList.Casing_MiningBlackPlutonium.set(new ItemStack(this, 1, 3)); + ItemList.Casing_ExtremeEngineIntake.set(new ItemStack(this, 1, 4)); } @Override @@ -41,6 +43,8 @@ public class GT_Block_Casings8 return Textures.BlockIcons.MACHINE_CASING_MINING_NEUTRONIUM.getIcon(); case 3: return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_EXTREME_ENGINE_INTAKE.getIcon();//changed color in a terrible way } return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java new file mode 100644 index 0000000000..f38f0a1de2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -0,0 +1,289 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Collection; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_MultiBlockBase { + protected int fuelConsumption = 0; + protected int fuelValue = 0; + protected int fuelRemaining = 0; + protected boolean boostEu = false; + + public GT_MetaTileEntity_ExtremeDieselEngine(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_ExtremeDieselEngine(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Extreme Combustion Engine", + "Size(WxHxD): 3x3x4, Controller (front centered)", + "3x3x4 of Robust Tungstensteel Machine Casing (hollow, Min 16!)", + "2x Titanium Gear Box Machine Casing inside the Hollow Casing",//todo + "8x Extreme Engine Intake Casing (around controller)", + "2x Input Hatch (HOG/Lubricant) (one of the Casings next to a Gear Box)", + "1x Input Hatch (Optional, for Liquid Oxygen) (one of the Casings next to a Gear Box)", + "1x Maintenance Hatch (one of the Casings next to a Gear Box)", + "1x Muffler Hatch (top middle back, above the rear Gear Box)", + "1x Dynamo Hatch (back centered)", + "Engine Intake Casings must not be obstructed in front (only air blocks)", + "Supply High Octane Gasoline and 8000L of Lubricant per hour to run.", + "Supply 320L of Liquid Oxygen per second to boost output (optional).", + "Default: Produces 8192EU/t at 100% efficiency", + "Boosted: Produces 32768EU/t at 400% efficiency", + "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60]};//controller texture? where do I find this? Copied plasma turbine + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return getMaxEfficiency(aStack) > 0; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png");//change + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList tFluids = getStoredFluids(); + Collection tRecipeList = GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList; + + if(tFluids.contains(Materials.GasolinePremium.getFluid(4L))) { //Does input hatch contain HOG? + for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches + for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes dd. Can't remove because I suck at coding + FluidStack tLiquid; + + if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null) { //Create fluidstack from current recipe + if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a diesel fluid + fuelConsumption = tLiquid.amount = boostEu ? (8192 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption + if(depleteInput(tLiquid)) { //Deplete that amount ^Doesn't give bonus to fuel usage anymore + boostEu = depleteInput(Materials.LiquidOxygen.getGas(16L));//x8, and LOX instead + + if(tFluids.contains(Materials.Lubricant.getFluid(8L))) { //Has lubricant? + //Deplete Lubricant. 8000L should = 1 hour of runtime (if baseEU = 8192) + if(mRuntime % 72 == 0 || mRuntime == 0) depleteInput(Materials.Lubricant.getFluid(boostEu ? 16 : 8));//x8 + } else return false; + + fuelValue = aFuel.mSpecialValue; + fuelRemaining = hatchFluid1.amount; //Record available fuel + this.mEUt = mEfficiency < 2000 ? 0 : 8192; //Output 0 if startup is less than 20% + this.mProgresstime = 1; //will output 8192 normally, 32768 boosted + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 15; + return true; + } + } + } + } + } + } + this.mEUt = 0; + this.mEfficiency = 0; + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + byte tSide = getBaseMetaTileEntity().getBackFacing(); + int tX = getBaseMetaTileEntity().getXCoord(); + int tY = getBaseMetaTileEntity().getYCoord(); + int tZ = getBaseMetaTileEntity().getZCoord(); + + if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 1) != getGearboxBlock() && getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 2) != getGearboxBlock()) { + return false; + } + if(getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 1) != getGearboxMeta() && getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 2) != getGearboxMeta()) { + return false; + } + for (byte i = -1; i < 2; i = (byte) (i + 1)) { + for (byte j = -1; j < 2; j = (byte) (j + 1)) { + if ((i != 0) || (j != 0)) { + for (byte k = 0; k < 4; k = (byte) (k + 1)) { + + final int fX = tX - (tSide == 5 ? 1 : tSide == 4 ? -1 : i), + fZ = tZ - (tSide == 2 ? -1 : tSide == 3 ? 1 : i), + aY = tY + j, + aX = tX + (tSide == 5 ? k : tSide == 4 ? -k : i), + aZ = tZ + (tSide == 2 ? -k : tSide == 3 ? k : i); + + final Block frontAir = getBaseMetaTileEntity().getBlock(fX, aY, fZ); + final String frontAirName = frontAir.getUnlocalizedName(); + if(!(getBaseMetaTileEntity().getAir(fX, aY, fZ) || frontAirName.equalsIgnoreCase("tile.air") || frontAirName.equalsIgnoreCase("tile.railcraft.residual.heat"))) { + return false; //Fail if vent blocks are obstructed + } + + if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) { + if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } else if (!addMufflerToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? 2 : tSide == 4 ? -2 : 0), tY + 1, tZ + (tSide == 3 ? 2 : tSide == 2 ? -2 : 0)), getCasingTextureIndex())) { + return false; //Fail if no muffler top middle back + } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ))) { + return false; + } + } else if (k == 0) { + if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getIntakeBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getIntakeMeta())) { + return false; + } + } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } else { + return false; + } + } + } + } + } + this.mDynamoHatches.clear(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3); + if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { + if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) { + this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity()); + ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).updateTexture(getCasingTextureIndex()); + } else { + return false; + } + } + return true; + } + + public Block getCasingBlock() {//changed to RTSMC + return GregTech_API.sBlockCasings4; + } + + public byte getCasingMeta() {//same + return 0; + } + + public Block getIntakeBlock() { + return GregTech_API.sBlockCasings8;//added new + } + + public byte getIntakeMeta() {//same + return 4; + } + + public Block getGearboxBlock() { + return GregTech_API.sBlockCasings2; + } + + public byte getGearboxMeta() { + return 4; + } + + public byte getCasingTextureIndex() {//should be what hatches/busses change to? + return 60; + } + + private boolean addToMachineList(IGregTechTileEntity tTileEntity) { + return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ExtremeDieselEngine(this.mName); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 1; + } + + public int getMaxEfficiency(ItemStack aStack) { + return boostEu ? 40000 : 10000;//4x output if boosted instead of x3 + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 192;//x8 + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return true; + } + + @Override + public String[] getInfoData() { + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + } + } + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + + return new String[]{ + EnumChatFormatting.BLUE+"Extreme Diesel Engine"+EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + getIdealStatus() == getRepairStatus() ? + EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : + EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.engine.output")+": " +EnumChatFormatting.RED+(-mEUt*mEfficiency/10000)+EnumChatFormatting.RESET+" EU/t", + StatCollector.translateToLocal("GT5U.engine.consumption")+": " +EnumChatFormatting.YELLOW+fuelConsumption+EnumChatFormatting.RESET+" L/t", + StatCollector.translateToLocal("GT5U.engine.value")+": " +EnumChatFormatting.YELLOW+fuelValue+EnumChatFormatting.RESET+" EU/L", + StatCollector.translateToLocal("GT5U.turbine.fuel")+": " +EnumChatFormatting.GOLD+fuelRemaining+EnumChatFormatting.RESET+" L", + StatCollector.translateToLocal("GT5U.engine.efficiency")+": " +EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.YELLOW+" %", + StatCollector.translateToLocal("GT5U.multiblock.pollution")+": " + EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + + }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + +} diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index 21746cb215..ef66fcd1d1 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -1253,10 +1253,15 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI ItemList.Machine_Multi_Assemblyline.set(new GT_MetaTileEntity_AssemblyLine(1170, "multimachine.assemblyline", "Assembling Line").getStackForm(1L)); GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_Assemblyline.get(1L), bitsd, new Object[]{aTextWireCoil, "EME", aTextWireCoil, 'M', ItemList.Hull_IV, 'W', ItemList.Casing_Assembler, 'E', OrePrefixes.circuit.get(Materials.Elite), 'C', ItemList.Robot_Arm_IV}); - + ItemList.Machine_Multi_DieselEngine.set(new GT_MetaTileEntity_DieselEngine(1171, "multimachine.dieselengine", "Combustion Engine").getStackForm(1L)); GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_DieselEngine.get(1L), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_EV, 'P', ItemList.Electric_Piston_EV, 'E', ItemList.Electric_Motor_EV, 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGt.get(Materials.Titanium)}); GT_ModHandler.addCraftingRecipe(ItemList.Casing_EngineIntake.get(1L), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.Titanium), 'F', ItemList.Casing_StableTitanium, 'P', OrePrefixes.rotor.get(Materials.Titanium)}); + + //add recipe here, also # is meta (for controller at least). How do I find the next open #? + ItemList.Machine_Multi_ExtremeDieselEngine.set(new GT_MetaTileEntity_ExtremeDieselEngine(5000, "multimachine.extremedieselengine", "Extreme Combustion Engine").getStackForm(1L)); + GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_ExtremeDieselEngine.get(1L), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_IV, 'P', ItemList.Electric_Piston_IV, 'E', ItemList.Electric_Motor_IV, 'C', OrePrefixes.circuit.get(Materials.Master), 'W', OrePrefixes.cableGt01.get(Materials.HSSG), 'G', OrePrefixes.gearGt.get(Materials.TungstenSteel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Casing_ExtremeEngineIntake.get(1L), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.TungstenSteel), 'F', ItemList.Casing_RobustTungstenSteel, 'P', OrePrefixes.rotor.get(Materials.TungstenSteel)}); ItemList.Machine_Multi_Cleanroom.set(new GT_MetaTileEntity_Cleanroom(1172, "multimachine.cleanroom", "Cleanroom Controller").getStackForm(1)); //If Cleanroom is enabled, add a recipe, else hide from NEI. diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_EXTREME_ENGINE_INTAKE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_EXTREME_ENGINE_INTAKE.png new file mode 100644 index 0000000000..b9f96fbceb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_EXTREME_ENGINE_INTAKE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE.png new file mode 100644 index 0000000000..bc1dd3f5f0 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE.png new file mode 100644 index 0000000000..b57178136f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/multimachines/LargeExtremeDieselEngine.png b/src/main/resources/assets/gregtech/textures/gui/multimachines/LargeExtremeDieselEngine.png new file mode 100644 index 0000000000..cfe27fccf1 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/multimachines/LargeExtremeDieselEngine.png differ -- cgit From 9db3e6c47eb404abffe662573d7b1d7fa5302db6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 10 Nov 2020 17:40:35 +0100 Subject: Cleanroom Callback Rework --- .../metatileentity/IMachineCallback.java | 7 +++ .../GT_MetaTileEntity_BasicMachine.java | 49 +++++++++++++++----- .../multi/GT_MetaTileEntity_Cleanroom.java | 53 +++++++++++++--------- 3 files changed, 77 insertions(+), 32 deletions(-) create mode 100644 src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java new file mode 100644 index 0000000000..9306ef28f3 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java @@ -0,0 +1,7 @@ +package gregtech.api.interfaces.metatileentity; + +public interface IMachineCallback { + Machinetype getCallbackBase(); + void setCallbackBase(Machinetype callback); + Class getType(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 1c5b90f7db..97daa6fc71 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -7,6 +7,7 @@ import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMachineCallback; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; @@ -15,6 +16,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +39,8 @@ import static gregtech.api.enums.GT_Values.debugCleanroom; * This is the main construct for my Basic Machines such as the Automatic Extractor * Extend this class to make a simple Machine */ -public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank { +public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank implements IMachineCallback { + /** * return values for checkRecipe() */ @@ -51,8 +54,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; public FluidStack mOutputFluid; - public String mGUIName = "", mNEIName = ""; - public GT_MetaTileEntity_MultiBlockBase mCleanroom; + public String mGUIName, mNEIName; + + + @Deprecated + public GT_MetaTileEntity_Cleanroom mCleanroom; /** * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered */ @@ -125,6 +131,21 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return true; } + @Override + public GT_MetaTileEntity_Cleanroom getCallbackBase() { + return this.mCleanroom; + } + + @Override + public void setCallbackBase(GT_MetaTileEntity_Cleanroom callback) { + this.mCleanroom = callback; + } + + @Override + public Class getType() { + return GT_MetaTileEntity_Cleanroom.class; + } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[14][17][]; @@ -449,7 +470,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); else if (mOutputFluid.isFluidEqual(getDrainableStack())) getDrainableStack().amount += mOutputFluid.amount; - for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null; + Arrays.fill(mOutputItems, null); mOutputFluid = null; mEUt = 0; mProgresstime = 0; @@ -518,7 +539,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B startProcess(); } else { mMaxProgresstime = 0; - for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null; + Arrays.fill(mOutputItems, null); mOutputFluid = null; } } @@ -584,7 +605,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B //Long EUt calculation long xEUt=aEUt; //Isnt too low EUt check? - long tempEUt = xEUt mCleanroom.mEfficiency) + if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000) > getCallbackBase().mEfficiency) { if (debugCleanroom) { GT_Log.out.println( "BasicMachine: Voiding output due to efficiency failure. mEfficiency = " + - mCleanroom.mEfficiency + getCallbackBase().mEfficiency ); } mOutputItems[i] = null; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 6ceebc3877..21a407f6e2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -5,10 +5,10 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMachineCallback; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; @@ -16,9 +16,9 @@ import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import static gregtech.api.enums.GT_Values.debugCleanroom; -import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { private int mHeight = -1; @@ -207,24 +207,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { return false; } - for (int dX = -x + 1; dX <= x - 1; dX++) { - for (int dZ = -z + 1; dZ <= z - 1; dZ++) { - for (int dY = -1; dY >= y + 1; dY--) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if (tTileEntity != null) { - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Machine detected, adding pointer back to cleanroom" - ); - } - ((GT_MetaTileEntity_BasicMachine) aMetaTileEntity).mCleanroom = this; - } - } - } - } - } + + setCallbacks(x, y, z, aBaseMetaTileEntity); if (doorState) { this.mEfficiency = Math.max(0, this.mEfficiency - 200); @@ -240,7 +224,34 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas return mPlascreteCount>=20 && mGlassCount < (int) Math.floor(ratio); } - + + private void setCallbacks(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity){ + for (int dX = -x + 1; dX <= x - 1; dX++) + for (int dZ = -z + 1; dZ <= z - 1; dZ++) + for (int dY = -1; dY >= y + 1; dY--) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); + + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + + if (iMetaTileEntity instanceof IMachineCallback) + checkAndSetCallback((IMachineCallback) iMetaTileEntity); + + } else if (tTileEntity instanceof IMachineCallback) + checkAndSetCallback((IMachineCallback) tTileEntity); + } + } + + @SuppressWarnings("unchecked") + private void checkAndSetCallback(IMachineCallback iMachineCallback) { + if (debugCleanroom) + GT_Log.out.println( + "Cleanroom: IMachineCallback detected, checking for cleanroom: " + (iMachineCallback.getType() == this.getClass()) + ); + if (iMachineCallback.getType() == this.getClass()) + ((IMachineCallback) iMachineCallback).setCallbackBase(this); + } + @Override public boolean allowGeneralRedstoneOutput(){ return true; -- cgit From 4e739e177b0b1fe242b0cfecb25f0b5b0e855932 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 13 Nov 2020 14:27:28 +0300 Subject: LCR was forming w/o energy and maintenance hatches --- .../machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index 13764b928e..fad880e5e4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -190,7 +190,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu } } - return casingAmount >= 8 && hasHeatingCoil; + return casingAmount >= 8 && hasHeatingCoil && !mEnergyHatches.isEmpty() && !mMaintenanceHatches.isEmpty(); } @Override -- cgit From adb69633efde93f7a07d38c629621e60c82d76ba Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 13 Nov 2020 18:02:35 +0300 Subject: Single block miner optimization --- .../machines/basic/GT_MetaTileEntity_Miner.java | 72 ++++++++-------------- 1 file changed, 27 insertions(+), 45 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 44db32e6b9..b57f8ebba4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -21,6 +21,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.FakePlayer; import java.util.ArrayList; @@ -33,7 +34,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { private static final Block MINING_PIPE_BLOCK = GT_Utility.getBlockFromStack(MINING_PIPE); private static final Block MINING_PIPE_TIP_BLOCK = GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); - int drillX, drillY, drillZ; + int drillY = 0; boolean isPickingPipes; boolean waitMiningPipe; final static int[] RADIUS = new int[]{8, 8, 16, 24, 32}; //Miner radius per tier @@ -41,6 +42,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { final static int[] ENERGY = new int[]{8, 8, 32, 128, 512}; //Miner energy consumption per tier private int radiusConfig; //Miner configured radius + private final ArrayList oreBlockPositions = new ArrayList<>(); public GT_MetaTileEntity_Miner(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, @@ -165,50 +167,35 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } return; } - if (drillY == 0) { + if (drillY == 0 || oreBlockPositions.isEmpty()) { moveOneDown(aBaseMetaTileEntity); - return; - } - if (drillZ > radiusConfig) { - moveOneDown(aBaseMetaTileEntity); - return; - } - while (drillZ <= radiusConfig) { - while (drillX <= radiusConfig) { - Block block = aBaseMetaTileEntity.getBlockOffset(drillX, drillY, drillZ); - int blockMeta = aBaseMetaTileEntity.getMetaIDOffset(drillX, drillY, drillZ); - if (block instanceof GT_Block_Ores_Abstract) { - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(drillX, drillY, drillZ); - if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) { - mineBlock(aBaseMetaTileEntity, drillX, drillY, drillZ); - if (debugBlockMiner) { - GT_Log.out.println("MINER: Mining GT ore block at " + drillX + " " + drillY + " " + drillZ); - } - return; - } else { - if (debugBlockMiner) { - GT_Log.out.println("MINER: Not natural ore, will not mine"); - } - } - } else { - ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta)); - if (association != null && association.mPrefix.toString().startsWith("ore")) { - mineBlock(aBaseMetaTileEntity, drillX, drillY, drillZ); - if (debugBlockMiner) { - GT_Log.out.println("MINER: Mining oredict ore block at " + drillX + " " + drillY + " " + drillZ); - } - return; - } - } - drillX++; + } else { + ChunkPosition oreBlockPos = oreBlockPositions.remove(0); + mineBlock(aBaseMetaTileEntity, oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); + if (debugBlockMiner) { + GT_Log.out.println("MINER: Mining GT ore block at " + oreBlockPos.chunkPosX + " " + drillY + " " + oreBlockPos.chunkPosZ); } - drillX = -radiusConfig; - drillZ++; } } } } - + private void fillOreList(IGregTechTileEntity aBaseMetaTileEntity) { + for (int z = -radiusConfig; z <= radiusConfig; ++z) { + for (int x = -radiusConfig; x <= radiusConfig; ++x) { + Block block = aBaseMetaTileEntity.getBlockOffset(x, drillY, z); + int blockMeta = aBaseMetaTileEntity.getMetaIDOffset(x, drillY, z); + if (block instanceof GT_Block_Ores_Abstract) { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, drillY, z); + if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) + oreBlockPositions.add(new ChunkPosition(x, drillY, z)); + } else { + ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta)); + if (association != null && association.mPrefix.toString().startsWith("ore")) + oreBlockPositions.add(new ChunkPosition(x, drillY, z)); + } + } + } + } @Override public long maxEUStore() { return mTier == 1 ? 4096 : V[mTier] * 64; @@ -253,8 +240,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } aBaseMetaTileEntity.getWorld().setBlock(xCoord, yCoord + drillY - 1, zCoord, MINING_PIPE_TIP_BLOCK); drillY--; - drillZ = -RADIUS[mTier]; - drillX = -RADIUS[mTier]; + fillOreList(aBaseMetaTileEntity); return true; } @@ -284,9 +270,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setBoolean("isPickingPipe", isPickingPipes); - aNBT.setInteger("drillX", drillX); aNBT.setInteger("drillY", drillY); - aNBT.setInteger("drillZ", drillZ); aNBT.setInteger("radiusConfig", radiusConfig); } @@ -294,9 +278,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); isPickingPipes = aNBT.getBoolean("isPickingPipe"); - drillX = aNBT.getInteger("drillX"); drillY = aNBT.getInteger("drillY"); - drillZ = aNBT.getInteger("drillZ"); if (aNBT.hasKey("radiusConfig")) radiusConfig = aNBT.getInteger("radiusConfig"); } -- cgit From 38b8f59deee780993ba088b6e4829bed97d949ed Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 13 Nov 2020 20:18:53 +0300 Subject: Handle restart and radius change --- .../tileentities/machines/basic/GT_MetaTileEntity_Miner.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index b57f8ebba4..67683e4635 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } return true; } - + @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); @@ -111,8 +111,14 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { radiusConfig = 0; } GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (radiusConfig * 2 + 1) + "x" + (radiusConfig * 2 + 1));//TODO Add translation support + oreBlockPositions.clear(); + fillOreList(getBaseMetaTileEntity()); } } + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + fillOreList(aBaseMetaTileEntity); + } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { @@ -180,6 +186,8 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } } private void fillOreList(IGregTechTileEntity aBaseMetaTileEntity) { + if (drillY == 0) + return; for (int z = -radiusConfig; z <= radiusConfig; ++z) { for (int x = -radiusConfig; x <= radiusConfig; ++x) { Block block = aBaseMetaTileEntity.getBlockOffset(x, drillY, z); -- cgit From b0b861120f91a2bf060c0fc6c6a2c0b20bce06df Mon Sep 17 00:00:00 2001 From: repo_alt Date: Sat, 14 Nov 2020 01:48:21 +0300 Subject: Miners may actually detect ores by the oredict https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/5468 --- src/main/java/gregtech/api/util/GT_Utility.java | 8 ++++++++ .../machines/basic/GT_MetaTileEntity_Miner.java | 19 ++++--------------- .../multi/GT_MetaTileEntity_OreDrillingPlantBase.java | 16 ++-------------- 3 files changed, 14 insertions(+), 29 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index a65ed00aed..cf7b86fe94 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -65,6 +65,7 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fluids.*; import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.oredict.OreDictionary; import java.lang.reflect.Constructor; import java.lang.reflect.Field; @@ -2489,5 +2490,12 @@ public class GT_Utility { public static boolean isPartOfOrePrefix(ItemStack aStack, OrePrefixes aPrefix){ return GT_OreDictUnificator.getAssociation(aStack) != null ? GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix) : false; } + public static boolean isOre(ItemStack aStack) { + for (int id: OreDictionary.getOreIDs(aStack)) { + if (OreDictionary.getOreName(id).startsWith("ore")) + return true; + } + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 67683e4635..0db6b09a73 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -6,19 +6,14 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.ItemData; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkPosition; @@ -192,15 +187,8 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { for (int x = -radiusConfig; x <= radiusConfig; ++x) { Block block = aBaseMetaTileEntity.getBlockOffset(x, drillY, z); int blockMeta = aBaseMetaTileEntity.getMetaIDOffset(x, drillY, z); - if (block instanceof GT_Block_Ores_Abstract) { - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, drillY, z); - if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) - oreBlockPositions.add(new ChunkPosition(x, drillY, z)); - } else { - ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta)); - if (association != null && association.mPrefix.toString().startsWith("ore")) - oreBlockPositions.add(new ChunkPosition(x, drillY, z)); - } + if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + oreBlockPositions.add(new ChunkPosition(x, drillY, z)); } } } @@ -253,7 +241,8 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } public void mineBlock(IGregTechTileEntity aBaseMetaTileEntity, int x, int y, int z) { - if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z, true)); + if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z, true)) + return; ArrayList drops = getBlockDrops(aBaseMetaTileEntity.getBlockOffset(x, y, z), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z); if (drops.size() > 0) mOutputItems[0] = drops.get(0); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 3c59bee520..3bfb18be2b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -11,8 +11,6 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -318,17 +316,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile Block block = getBaseMetaTileEntity().getBlock(x, y, z); int blockMeta = getBaseMetaTileEntity().getMetaID(x, y, z); ChunkPosition blockPos = new ChunkPosition(x, y, z); - if (oreBlockPositions.contains(blockPos)) - return; - if (block instanceof GT_Block_Ores_Abstract) { - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z); - if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) - oreBlockPositions.add(blockPos); - } else { - ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta)); - if (association != null && association.mPrefix.toString().startsWith("ore")) - oreBlockPositions.add(blockPos); - } + if (!oreBlockPositions.contains(blockPos) && GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + oreBlockPositions.add(blockPos); } protected abstract int getRadiusInChunks(); @@ -337,7 +326,6 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile protected String[] getDescriptionInternal(String tierSuffix) { String casings = getCasingBlockItem().get(0).getDisplayName(); - int d = getRadiusInChunks() * 2; return new String[]{ "Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : ""), "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", -- cgit From 5b19a45b3a5278213da2181c11c9b3084f0e4a14 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 15 Nov 2020 14:33:11 +0800 Subject: Clean up Extreme Diesel Engine Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/GT_Mod.java | 1 + src/main/java/gregtech/api/util/GT_Recipe.java | 1 + .../multi/GT_MetaTileEntity_DieselEngine.java | 7 +- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 152 ++------------------- .../postload/GT_ExtremeDieselFuelLoader.java | 19 +++ 5 files changed, 42 insertions(+), 138 deletions(-) create mode 100644 src/main/java/gregtech/loaders/postload/GT_ExtremeDieselFuelLoader.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 27932b98c2..55ee8f3c55 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -936,6 +936,7 @@ public class GT_Mod implements IGT_Mod { Items.diamond_axe.setMaxDamage(768); Items.diamond_hoe.setMaxDamage(768); } + new GT_ExtremeDieselFuelLoader().run(); GT_Log.out.println("GT_Mod: Adding buffered Recipes."); GT_ModHandler.stopBufferingCraftingRecipes(); diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 2ae67a572a..abbb6aef1b 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -615,6 +615,7 @@ public class GT_Recipe implements Comparable { public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.uuamplifier", "Amplifabricator", null, RES_PATH_GUI + "basicmachines/Amplifabricator", 1, 0, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.massfab", "Mass Fabrication", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 0, 1, 0, 10, E, 1, E, true, true); public static final GT_Recipe_Map_Fuel sDieselFuels = new GT_Recipe_Map_Fuel(new HashSet<>(20), "gt.recipe.dieselgeneratorfuel", "Diesel Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); + public static final GT_Recipe_Map_Fuel sExtremeDieselFuels = new GT_Recipe_Map_Fuel(new HashSet<>(20), "gt.recipe.extremedieselgeneratorfuel", "Extreme Diesel Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GT_Recipe_Map_Fuel sTurbineFuels = new GT_Recipe_Map_Fuel(new HashSet<>(25), "gt.recipe.gasturbinefuel", "Gas Turbine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel(new HashSet<>(10), "gt.recipe.thermalgeneratorfuel", "Thermal Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false); public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<>(15), "gt.recipe.semifluidboilerfuels", "Semifluid Boiler Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index c37a5a9976..a957535990 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -74,10 +74,15 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png"); } + // can't use getRecipeMap() or else the fluid hatch will reject oxygen + protected GT_Recipe.GT_Recipe_Map_Fuel getFuelMap() { + return GT_Recipe.GT_Recipe_Map.sDieselFuels; + } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tFluids = getStoredFluids(); - Collection tRecipeList = GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList; + Collection tRecipeList = getFuelMap().mRecipeList; if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel? for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index f38f0a1de2..b13ed587e3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -25,7 +25,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine { protected int fuelConsumption = 0; protected int fuelValue = 0; protected int fuelRemaining = 0; @@ -39,6 +39,7 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Mul super(aName); } + @Override public String[] getDescription() { return new String[]{ "Controller Block for the Extreme Combustion Engine", @@ -59,6 +60,12 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Mul "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; } + @Override + protected GT_Recipe.GT_Recipe_Map_Fuel getFuelMap() { + return GT_Recipe.GT_Recipe_Map.sExtremeDieselFuels; + } + + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE)}; @@ -67,181 +74,58 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Mul } @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return getMaxEfficiency(aStack) > 0; - } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png");//change } - - @Override - public boolean checkRecipe(ItemStack aStack) { - ArrayList tFluids = getStoredFluids(); - Collection tRecipeList = GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList; - - if(tFluids.contains(Materials.GasolinePremium.getFluid(4L))) { //Does input hatch contain HOG? - for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches - for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes dd. Can't remove because I suck at coding - FluidStack tLiquid; - - if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null) { //Create fluidstack from current recipe - if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a diesel fluid - fuelConsumption = tLiquid.amount = boostEu ? (8192 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption - if(depleteInput(tLiquid)) { //Deplete that amount ^Doesn't give bonus to fuel usage anymore - boostEu = depleteInput(Materials.LiquidOxygen.getGas(16L));//x8, and LOX instead - if(tFluids.contains(Materials.Lubricant.getFluid(8L))) { //Has lubricant? - //Deplete Lubricant. 8000L should = 1 hour of runtime (if baseEU = 8192) - if(mRuntime % 72 == 0 || mRuntime == 0) depleteInput(Materials.Lubricant.getFluid(boostEu ? 16 : 8));//x8 - } else return false; - - fuelValue = aFuel.mSpecialValue; - fuelRemaining = hatchFluid1.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 8192; //Output 0 if startup is less than 20% - this.mProgresstime = 1; //will output 8192 normally, 32768 boosted - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 15; - return true; - } - } - } - } - } - } - this.mEUt = 0; - this.mEfficiency = 0; - return false; - } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - byte tSide = getBaseMetaTileEntity().getBackFacing(); - int tX = getBaseMetaTileEntity().getXCoord(); - int tY = getBaseMetaTileEntity().getYCoord(); - int tZ = getBaseMetaTileEntity().getZCoord(); - - if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 1) != getGearboxBlock() && getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 2) != getGearboxBlock()) { - return false; - } - if(getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 1) != getGearboxMeta() && getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 2) != getGearboxMeta()) { - return false; - } - for (byte i = -1; i < 2; i = (byte) (i + 1)) { - for (byte j = -1; j < 2; j = (byte) (j + 1)) { - if ((i != 0) || (j != 0)) { - for (byte k = 0; k < 4; k = (byte) (k + 1)) { - - final int fX = tX - (tSide == 5 ? 1 : tSide == 4 ? -1 : i), - fZ = tZ - (tSide == 2 ? -1 : tSide == 3 ? 1 : i), - aY = tY + j, - aX = tX + (tSide == 5 ? k : tSide == 4 ? -k : i), - aZ = tZ + (tSide == 2 ? -k : tSide == 3 ? k : i); - - final Block frontAir = getBaseMetaTileEntity().getBlock(fX, aY, fZ); - final String frontAirName = frontAir.getUnlocalizedName(); - if(!(getBaseMetaTileEntity().getAir(fX, aY, fZ) || frontAirName.equalsIgnoreCase("tile.air") || frontAirName.equalsIgnoreCase("tile.railcraft.residual.heat"))) { - return false; //Fail if vent blocks are obstructed - } - - if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) { - if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else if (!addMufflerToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? 2 : tSide == 4 ? -2 : 0), tY + 1, tZ + (tSide == 3 ? 2 : tSide == 2 ? -2 : 0)), getCasingTextureIndex())) { - return false; //Fail if no muffler top middle back - } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ))) { - return false; - } - } else if (k == 0) { - if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getIntakeBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getIntakeMeta())) { - return false; - } - } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else { - return false; - } - } - } - } - } - this.mDynamoHatches.clear(); - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3); - if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { - if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) { - this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity()); - ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).updateTexture(getCasingTextureIndex()); - } else { - return false; - } - } - return true; - } - public Block getCasingBlock() {//changed to RTSMC return GregTech_API.sBlockCasings4; } + @Override public byte getCasingMeta() {//same return 0; } + @Override public Block getIntakeBlock() { return GregTech_API.sBlockCasings8;//added new } + @Override public byte getIntakeMeta() {//same return 4; } + @Override public Block getGearboxBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getGearboxMeta() { return 4; } + @Override public byte getCasingTextureIndex() {//should be what hatches/busses change to? return 60; } - private boolean addToMachineList(IGregTechTileEntity tTileEntity) { - return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ExtremeDieselEngine(this.mName); } @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 1; - } - public int getMaxEfficiency(ItemStack aStack) { return boostEu ? 40000 : 10000;//4x output if boosted instead of x3 } @Override public int getPollutionPerTick(ItemStack aStack) { - return 192;//x8 - } - - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return true; + return super.getPollutionPerTick(aStack) * 8;//x8 } @Override @@ -280,10 +164,4 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Mul }; } - - @Override - public boolean isGivingInformation() { - return true; - } - } diff --git a/src/main/java/gregtech/loaders/postload/GT_ExtremeDieselFuelLoader.java b/src/main/java/gregtech/loaders/postload/GT_ExtremeDieselFuelLoader.java new file mode 100644 index 0000000000..9828ea33af --- /dev/null +++ b/src/main/java/gregtech/loaders/postload/GT_ExtremeDieselFuelLoader.java @@ -0,0 +1,19 @@ +package gregtech.loaders.postload; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Recipe; + +public class GT_ExtremeDieselFuelLoader implements Runnable { + @Override + public void run() { + GT_Log.out.println("GT_Mod: Adding extreme diesel fuel."); + for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList) { + if (r.mFluidInputs.length == 1 && Materials.GasolinePremium.getFluid(1).isFluidEqual(r.mFluidInputs[0])) { + GT_Recipe.GT_Recipe_Map.sExtremeDieselFuels.add(r); + return; + } + } + GT_Log.out.println("GT_Mod: No extreme diesel fuel found."); + } +} -- cgit From 997abcd915717c11dd7bd1423e41512cb1446e53 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Mon, 16 Nov 2020 00:40:58 +0100 Subject: use moveMultipleItemStacks to variuos functions --- .../implementations/GT_MetaPipeEntity_Item.java | 2 +- .../GT_MetaTileEntity_BasicMachine.java | 16 ++++++++--- .../implementations/GT_MetaTileEntity_Buffer.java | 4 +-- .../GT_MetaTileEntity_Hatch_OutputBus.java | 11 +++++--- .../gregtech/common/covers/GT_Cover_Conveyor.java | 32 +++++++++++++++------- 5 files changed, 44 insertions(+), 21 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index 650e9a031e..c73e95e95b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -270,7 +270,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide); if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) { if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser)) || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) { - return GT_Utility.moveOneItemStack(aSender, tInventory, (byte) 6, GT_Utility.getOppositeSide(aSide), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1) > 0; + return GT_Utility.moveMultipleItemStacks(aSender, tInventory, (byte) 6, GT_Utility.getOppositeSide(aSide), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,1) > 0; } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 97daa6fc71..2c632c596b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -32,6 +32,7 @@ import java.util.Arrays; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -510,10 +511,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); - for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { - tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); - if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true); - } + long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored(); + int tMaxStacks = (int)(tStoredEnergy/64l); + if (tMaxStacks > mOutputItems.length) + tMaxStacks = mOutputItems.length; + + int tCost = moveMultipleItemStacks(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,tMaxStacks); + aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCost, true); +// for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { +// tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); +// if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true); +// } } if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 645836a801..7284cd3c01 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -259,9 +259,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { int tCost; if( bStockingMode ) - tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1); + tCost = GT_Utility.moveMultipleItemStacks(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1,1); else - tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, (byte) 64, (byte) 1, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize); + tCost = GT_Utility.moveMultipleItemStacks(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, (byte) 64, (byte) 1, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize,1); if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { mSuccess = 50; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java index 6c56ac6a74..1dafbcce5a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java @@ -12,6 +12,8 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import static gregtech.api.util.GT_Utility.*; + public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, getSlots(aTier), new String[]{"Item Output for Multiblocks", @@ -112,10 +114,11 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch { if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick&0x7)==0) { IInventory tTileEntity =aBaseMetaTileEntity.getIInventoryAtSide(aBaseMetaTileEntity.getFrontFacing()); if(tTileEntity!=null){ - for (ItemStack aMInventory : mInventory) - GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity, - aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), - null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + moveMultipleItemStacks(aBaseMetaTileEntity,tTileEntity,aBaseMetaTileEntity.getFrontFacing(),aBaseMetaTileEntity.getBackFacing(),null,false,(byte)64,(byte)1,(byte)64,(byte)1,mInventory.length); + +// GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity, +// aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), +// null, false, (byte) 64, (byte) 1, (byte)( 64 * aBaseMetaTileEntity.getSizeInventory()), (byte) 1); } } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 303f358a34..aee46b7aab 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -14,6 +14,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; + public class GT_Cover_Conveyor extends GT_CoverBehavior { public final int mTickRate; private final int mMaxStacks; @@ -42,19 +44,29 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { boolean costsEnergy = ((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L); byte moved; - for(int i=0 ; i < this.mMaxStacks ; i++) { - // Costs energy but we don't have enough, bail - if ((costsEnergy && !aTileEntity.isUniversalEnergyStored(256L))) - break; - moved = GT_Utility.moveOneItemStack(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + if (costsEnergy) { + long tStoredEnergy = aTileEntity.getUniversalEnergyStored(); + int tMaxStacks = (int)(tStoredEnergy/(4*64*this.mMaxStacks)); + if (tMaxStacks > this.mMaxStacks) + tMaxStacks = this.mMaxStacks; + int tCost = moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,tMaxStacks); + aTileEntity.decreaseStoredEnergyUnits(4 * tCost, true); + } else { + moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,this.mMaxStacks); + } - if(moved == 0) - break; - if (costsEnergy) - aTileEntity.decreaseStoredEnergyUnits(4 * moved, true); - } +// for(int i=0 ; i < this.mMaxStacks ; i++) { +// // Costs energy but we don't have enough, bail +// if ((costsEnergy && !aTileEntity.isUniversalEnergyStored(256L))) +// break; +// +// moved = GT_Utility.moveOneItemStack(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); +// +// if(moved == 0) +// break; +// } return aCoverVariable; } -- cgit From cd5e797dc31ceb771c8903d1c2cb2a5b42e35e60 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Mon, 16 Nov 2020 11:49:53 +0300 Subject: GT ore blocks in world are not recognized as an oredicted stack --- build.properties | 2 +- .../machines/basic/GT_MetaTileEntity_Miner.java | 15 +++++++++++++-- .../multi/GT_MetaTileEntity_OreDrillingPlantBase.java | 13 +++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/build.properties b/build.properties index f6dca043e1..85d8779c47 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.33.55 +gt.version=5.09.33.56 ae2.version=rv3-beta-22 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 0db6b09a73..69543a7196 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -9,11 +9,15 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.GT_TileEntity_Ores; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkPosition; @@ -187,7 +191,11 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { for (int x = -radiusConfig; x <= radiusConfig; ++x) { Block block = aBaseMetaTileEntity.getBlockOffset(x, drillY, z); int blockMeta = aBaseMetaTileEntity.getMetaIDOffset(x, drillY, z); - if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + if (block instanceof GT_Block_Ores_Abstract) { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, drillY, z); + if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) + oreBlockPositions.add(new ChunkPosition(x, drillY, z)); + } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) oreBlockPositions.add(new ChunkPosition(x, drillY, z)); } } @@ -241,8 +249,11 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } public void mineBlock(IGregTechTileEntity aBaseMetaTileEntity, int x, int y, int z) { - if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z, true)) + if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z, true)) { + if (debugBlockMiner) + GT_Log.out.println("MINER: FakePlayer cannot mine block at " + (aBaseMetaTileEntity.getXCoord() + x) + ", " + (aBaseMetaTileEntity.getYCoord() + y) + ", " + (aBaseMetaTileEntity.getZCoord() + z)); return; + } ArrayList drops = getBlockDrops(aBaseMetaTileEntity.getBlockOffset(x, y, z), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z); if (drops.size() > 0) mOutputItems[0] = drops.get(0); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 3bfb18be2b..5ead0bf896 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -11,6 +11,9 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.GT_TileEntity_Ores; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -316,8 +319,14 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile Block block = getBaseMetaTileEntity().getBlock(x, y, z); int blockMeta = getBaseMetaTileEntity().getMetaID(x, y, z); ChunkPosition blockPos = new ChunkPosition(x, y, z); - if (!oreBlockPositions.contains(blockPos) && GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) - oreBlockPositions.add(blockPos); + if (!oreBlockPositions.contains(blockPos)) { + if (block instanceof GT_Block_Ores_Abstract) { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z); + if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) + oreBlockPositions.add(blockPos); + } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + oreBlockPositions.add(blockPos); + } } protected abstract int getRadiusInChunks(); -- cgit From ee64e377c1e4bfd6f027ba5c06bfb7f351789a0f Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 19 Nov 2020 05:13:34 +0800 Subject: Fix wrong fuel consumption in extreme LCE Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../multi/GT_MetaTileEntity_DieselEngine.java | 41 +++++++++++++++++++--- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 20 +++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index a957535990..0fb7df8428 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -79,6 +79,37 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return GT_Recipe.GT_Recipe_Map.sDieselFuels; } + /** + * The nominal energy output + * This can be further multiplied by {@link #getMaxEfficiency(ItemStack)} when boosted + */ + protected int getNominalOutput() { + return 2048; + } + + /** + * x times fuel will be consumed when boosted + * This will however NOT increase power output + * Go tweak {@link #getMaxEfficiency(ItemStack)} and {@link #getNominalOutput()} instead + */ + protected int getBoostFactor() { + return 2; + } + + /** + * x times of additive will be consumed when boosted + */ + protected int getAdditiveFactor() { + return 1; + } + + /** + * Efficiency will increase by this amount every tick + */ + protected int getEfficiencyIncrease() { + return 15; + } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tFluids = getStoredFluids(); @@ -90,21 +121,21 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock FluidStack tLiquid; if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null) { //Create fluidstack from current recipe if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a diesel fluid - fuelConsumption = tLiquid.amount = boostEu ? (4096 / aFuel.mSpecialValue) : (2048 / aFuel.mSpecialValue); //Calc fuel consumption + fuelConsumption = tLiquid.amount = boostEu ? (getBoostFactor() * getNominalOutput() / aFuel.mSpecialValue) : (getNominalOutput() / aFuel.mSpecialValue); //Calc fuel consumption if(depleteInput(tLiquid)) { //Deplete that amount - boostEu = depleteInput(Materials.Oxygen.getGas(2L)); + boostEu = depleteInput(Materials.Oxygen.getGas(2L * getAdditiveFactor())); if(tFluids.contains(Materials.Lubricant.getFluid(1L))) { //Has lubricant? //Deplete Lubricant. 1000L should = 1 hour of runtime (if baseEU = 2048) - if(mRuntime % 72 == 0 || mRuntime == 0) depleteInput(Materials.Lubricant.getFluid(boostEu ? 2 : 1)); + if(mRuntime % 72 == 0 || mRuntime == 0) depleteInput(Materials.Lubricant.getFluid((boostEu ? 2L : 1L) * getAdditiveFactor())); } else return false; fuelValue = aFuel.mSpecialValue; fuelRemaining = hatchFluid1.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + this.mEUt = mEfficiency < 2000 ? 0 : getNominalOutput(); //Output 0 if startup is less than 20% this.mProgresstime = 1; this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 15; + this.mEfficiencyIncrease = getEfficiencyIncrease(); return true; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index b13ed587e3..e528e1e19e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -118,6 +118,26 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die return new GT_MetaTileEntity_ExtremeDieselEngine(this.mName); } + @Override + protected int getNominalOutput() { + return 8192; + } + + @Override + protected int getBoostFactor() { + return 4; + } + + @Override + protected int getAdditiveFactor() { + return 8; + } + + @Override + protected int getEfficiencyIncrease() { + return 20; + } + @Override public int getMaxEfficiency(ItemStack aStack) { return boostEu ? 40000 : 10000;//4x output if boosted instead of x3 -- cgit From 1b9937c81851ba63aaab8706f1c6e4651494e63a Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 19 Nov 2020 05:26:22 +0800 Subject: Extreme LCE now uses LOX Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java | 6 +++++- .../machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 0fb7df8428..dfd7288f22 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -87,6 +87,10 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return 2048; } + protected Materials getBooster() { + return Materials.Oxygen; + } + /** * x times fuel will be consumed when boosted * This will however NOT increase power output @@ -123,7 +127,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a diesel fluid fuelConsumption = tLiquid.amount = boostEu ? (getBoostFactor() * getNominalOutput() / aFuel.mSpecialValue) : (getNominalOutput() / aFuel.mSpecialValue); //Calc fuel consumption if(depleteInput(tLiquid)) { //Deplete that amount - boostEu = depleteInput(Materials.Oxygen.getGas(2L * getAdditiveFactor())); + boostEu = depleteInput(getBooster().getGas(2L * getAdditiveFactor())); if(tFluids.contains(Materials.Lubricant.getFluid(1L))) { //Has lubricant? //Deplete Lubricant. 1000L should = 1 hour of runtime (if baseEU = 2048) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index e528e1e19e..eddf59b360 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -128,6 +128,11 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die return 4; } + @Override + protected Materials getBooster() { + return Materials.LiquidOxygen; + } + @Override protected int getAdditiveFactor() { return 8; -- cgit From 26fa46e05a12d507b484c86935574a078b58164b Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Wed, 18 Nov 2020 22:12:43 -0500 Subject: Add new method of displaying MB tooltips. LCR as example for now --- .../api/util/GT_Multiblock_Tooltip_Builder.java | 309 +++++++++++++++++++++ .../GT_MetaTileEntity_LargeChemicalReactor.java | 40 ++- src/main/resources/assets/gregtech/lang/en_US.lang | 21 ++ 3 files changed, 356 insertions(+), 14 deletions(-) create mode 100644 src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java new file mode 100644 index 0000000000..c8914c0b7d --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -0,0 +1,309 @@ +package gregtech.api.util; + +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +/** + * This makes it easier to build multi tooltips, with a standardized format.
+ * Info section order should be:
+ * addMachineType
+ * addInfo, for what it does, special notes, etc.
+ * addSeparator, if you need it
+ * addPollutionAmount
+ *
+ * Structure order should be:
+ * beginStructureBlock
+ * addController
+ * addCasingInfo
+ * addOtherStructurePart, for secondary structure block info (pipes, coils, etc)
+ * addEnergyHatch/addDynamoHatch
+ * addMaintenanceHatch
+ * addMufflerHatch
+ * addInputBus/addInputHatch/addOutputBus/addOutputHatch, in that order
+ * Use addStructureInfo for any comments on nonstandard structure info wherever needed + *
+ * toolTipFinisher
+ *
+ * Originally created by kekzdealer + */ +public class GT_Multiblock_Tooltip_Builder { + private static final String TAB = " "; + private static final String COLON = ": "; + + private final List iLines; + private final List sLines; + + private String[] iArray; + private String[] sArray; + + //Localized tooltips + private static final String TT_machineType = StatCollector.translateToLocal("GT5U.MBTT.MachineType"); + private static final String TT_dimensions = StatCollector.translateToLocal("GT5U.MBTT.Dimensions"); + private static final String TT_structure = StatCollector.translateToLocal("GT5U.MBTT.Structure"); + private static final String TT_controller = StatCollector.translateToLocal("GT5U.MBTT.Controller"); + private static final String TT_minimum = StatCollector.translateToLocal("GT5U.MBTT.Minimum"); + private static final String TT_maintenancehatch = StatCollector.translateToLocal("GT5U.MBTT.MaintenanceHatch"); + private static final String TT_energyhatch = StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"); + private static final String TT_dynamohatch = StatCollector.translateToLocal("GT5U.MBTT.DynamoHatch"); + private static final String TT_mufflerhatch = StatCollector.translateToLocal("GT5U.MBTT.MufflerHatch"); + private static final String TT_inputbus = StatCollector.translateToLocal("GT5U.MBTT.InputBus"); + private static final String TT_inputhatch = StatCollector.translateToLocal("GT5U.MBTT.InputHatch"); + private static final String TT_outputbus = StatCollector.translateToLocal("GT5U.MBTT.OutputBus"); + private static final String TT_outputhatch = StatCollector.translateToLocal("GT5U.MBTT.OutputHatch"); + private static final String TT_causes = StatCollector.translateToLocal("GT5U.MBTT.Causes"); + private static final String TT_pps = StatCollector.translateToLocal("GT5U.MBTT.PPS"); + private static final String TT_hold = StatCollector.translateToLocal("GT5U.MBTT.Hold"); + private static final String TT_todisplay = StatCollector.translateToLocal("GT5U.MBTT.Display"); + private static final String TT_mod = StatCollector.translateToLocal("GT5U.MBTT.Mod"); + + public GT_Multiblock_Tooltip_Builder() { + iLines = new LinkedList<>(); + sLines = new LinkedList<>(); + } + + /** + * Add a line telling you what the machine type is. Usually, this will be the name of a SB version.
+ * Machine Type: machine + * + * @param machine + * Name of the machine type + * + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addMachineType(String machine) { + iLines.add(TT_machineType + EnumChatFormatting.YELLOW + machine + EnumChatFormatting.RESET); + return this; + } + + /** + * Add a basic line of information about this structure + * + * @param info + * The line to be added. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addInfo(String info) { + iLines.add(info); + return this; + } + + /** + * Add a separator line like this:
+ * ----------------------------------------- + * + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addSeparator() { + iLines.add("-----------------------------------------"); + return this; + } + + /** + * Add a line telling you what the machine type is. Usually, this will be the name of a SB version.
+ * Machine Type: machine + * + * @param machine + * Name of the machine type + * + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) { + iLines.add(TT_causes + " " + EnumChatFormatting.DARK_PURPLE + pollution + " " + TT_pps + EnumChatFormatting.RESET); + return this; + } + + /** + * Begin adding structural information by adding a line about the structure's dimensions + * and then inserting a "Structure:" line. + * + * @param w + * Structure width. + * @param h + * Structure height. + * @param l + * Structure depth/length. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder beginStructureBlock(int w, int h, int l) { + sLines.add(TT_dimensions + w + "x" + h + "x" + l + " (WxHxL)"); + sLines.add(TT_structure); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Controller: info + * @param info + * Positional information. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addController(String info) { + sLines.add(TAB + TT_controller + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)minCountx casingName (minimum) + * @param casingName + * Name of the Casing. + * @param minCount + * Minimum needed for valid structure check. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addCasingInfo(String casingName, int minCount) { + sLines.add(TAB + minCount +"x " + casingName + " " + TT_minimum); + return this; + } + + /** + * Use this method to add a structural part that isn't covered by the other methods.
+ * (indent)name: info + * @param name + * Name of the hatch or other component. + * @param info + * Positional information. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info) { + sLines.add(TAB + name + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Maintenance Hatch: info + * @param info + * Positional information. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info) { + sLines.add(TAB + TT_maintenancehatch + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Muffler Hatch: info + * @param info + * Location where the hatch goes + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info) { + sLines.add(TAB + TT_mufflerhatch + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Energy Hatch: info + * @param info + * Positional information. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info) { + sLines.add(TAB + TT_energyhatch + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Dynamo Hatch: info + * @param info + * Positional information. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info) { + sLines.add(TAB + TT_dynamohatch + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Input Bus: info + * @param info + * Location where the bus goes + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addInputBus(String info) { + sLines.add(TAB + TT_inputbus + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Input Hatch: info + * @param info + * Location where the hatch goes + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addInputHatch(String info) { + sLines.add(TAB + TT_inputhatch + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Output Bus: info + * @param info + * Location where the bus goes + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOutputBus(String info) { + sLines.add(TAB + TT_outputbus + info); + return this; + } + + /** + * Add a line of information about the structure:
+ * (indent)Output Hatch: info + * @param info + * Location where the bus goes + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOutputHatch(String info) { + sLines.add(TAB + TT_outputhatch + info); + return this; + } + + /** + * Use this method to add non-standard structural info.
+ * (indent)info + * @param info + * The line to be added. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addStructureInfo(String info) { + sLines.add(TAB + info); + return this; + } + + /** + * Call at the very end.
+ * Adds a final line with the mod name and information on how to display the structure guidelines.
+ * Ends the building process. + * + * @param mod + * Name of the mod that adds this multiblock machine + */ + public void toolTipFinisher(String mod) { + iLines.add(TT_hold + " " + EnumChatFormatting.BOLD + "[LSHIFT]" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + " " + TT_todisplay); + iLines.add(TT_mod + " " + EnumChatFormatting.GREEN + mod + EnumChatFormatting.RESET); + iArray = new String[iLines.size()]; + sArray = new String[sLines.size()]; + iLines.toArray(iArray); + sLines.toArray(sArray); + } + + public String[] getInformation() { + return iArray; + } + + public String[] getStructureInformation() { + return sArray; + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index fad880e5e4..c5f1852629 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -18,6 +19,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase { private final int CASING_INDEX = 176; @@ -37,20 +40,29 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu @Override public String[] getDescription() { - return new String[] { - "Controller block for the Large Chemical Reactor", - "Has the same recipes as the Chemical Reactor", - "Does not lose efficiency when overclocked", - "Accepts fluids instead of fluid cells", - "Size(WxHxD): 3x3x3", - "3x3x3 of Chemically Inert Machine Casings (hollow, min 8!)", - "Controller (Front centered)", - "1x PTFE Pipe Machine Casing (inside the hollow casings)", - "1x Cupronickel Coil Block (next to PTFE Pipe Machine Casing)", - "1x Input Bus/Hatch (Any inert casing)", - "1x Output Bus/Hatch (Any inert casing)", - "1x Maintenance Hatch (Any inert casing)", - "1x Energy Hatch (Any inert casing)"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Chemical Reactor") + .addInfo("Controller block for the Large Chemical Reactor") + .addInfo("Does not lose efficiency when overclocked") + .addInfo("Accepts fluids instead of fluid cells") + .beginStructureBlock(3, 3, 3) + .addController("Front centered") + .addCasingInfo("Chemically Inert Machine Casings", 8) + .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") + .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing") + .addEnergyHatch("Any Casing") + .addMaintenanceHatch("Any Casing") + .addInputBus("Any Casing") + .addInputHatch("Any Casing") + .addOutputBus("Any Casing") + .addOutputHatch("Any Casing") + .addStructureInfo("You can have multiple I/O hatches/busses") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 88616c6041..53970634f9 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -1,3 +1,24 @@ +# Multiblock Tooltip Builder Keywords +# Context can be found in the class gregtech.api.util.GT_Multiblock_Tooltip_Builder +GT5U.MBTT.MachineType=Machine Type: +GT5U.MBTT.Dimensions=Dimensions: +GT5U.MBTT.Structure=Structure: +GT5U.MBTT.Controller=Controller: +GT5U.MBTT.Minimum=(minimum) +GT5U.MBTT.MaintenanceHatch=Maintenance Hatch: +GT5U.MBTT.MufflerHatch=Muffler Hatch: +GT5U.MBTT.EnergyHatch=Energy Hatch: +GT5U.MBTT.DynamoHatch=Dynamo Hatch: +GT5U.MBTT.InputBus=Input Bus/ses: +GT5U.MBTT.InputHatch=Input Hatch/es: +GT5U.MBTT.OutputBus=Output Bus/ses: +GT5U.MBTT.OutputHatch=Output Hatch/es: +GT5U.MBTT.Causes=Causes: +GT5U.MBTT.PPS=pollution per second +GT5U.MBTT.Hold=Hold +GT5U.MBTT.Display=to display structure guidelines +GT5U.MBTT.Mod=Added by + GT5U.turbine.running.true=Turbine running GT5U.turbine.running.false=Turbine stopped GT5U.turbine.maintenance.false=No Maintainance issues -- cgit From 9d13d05f76fb34c5827959acb802b519531d3289 Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Thu, 19 Nov 2020 23:28:05 -0500 Subject: Change all the multi tooltips over. Also changed tooltip class a bit --- .../api/util/GT_Multiblock_Tooltip_Builder.java | 75 ++++++++++++++++------ .../multi/GT_MetaTileEntity_AssemblyLine.java | 42 ++++++++---- .../GT_MetaTileEntity_BrickedBlastFurnace.java | 29 +++++++-- .../GT_MetaTileEntity_BronzeBlastFurnace.java | 5 +- .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 31 ++++++--- .../multi/GT_MetaTileEntity_Cleanroom.java | 43 ++++++++----- .../GT_MetaTileEntity_ConcreteBackfiller2.java | 42 ++++++++---- .../GT_MetaTileEntity_ConcreteBackfillerBase.java | 38 ++++++++--- .../multi/GT_MetaTileEntity_DieselEngine.java | 47 +++++++++----- .../multi/GT_MetaTileEntity_DistillationTower.java | 35 ++++++---- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 48 +++++++++----- .../multi/GT_MetaTileEntity_FusionComputer1.java | 33 ++++++++-- .../multi/GT_MetaTileEntity_FusionComputer2.java | 34 +++++++--- .../multi/GT_MetaTileEntity_FusionComputer3.java | 34 +++++++--- .../multi/GT_MetaTileEntity_HeatExchanger.java | 37 ++++++++--- .../GT_MetaTileEntity_ImplosionCompressor.java | 35 ++++++---- .../multi/GT_MetaTileEntity_LargeBoiler.java | 44 ++++++++----- .../GT_MetaTileEntity_LargeChemicalReactor.java | 21 +++--- .../multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 33 ++++++---- .../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 35 ++++++---- .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 32 ++++++--- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 35 ++++++---- .../multi/GT_MetaTileEntity_MultiFurnace.java | 37 +++++++---- .../multi/GT_MetaTileEntity_OilCracker.java | 38 +++++++---- .../multi/GT_MetaTileEntity_OilDrillBase.java | 39 +++++++---- .../GT_MetaTileEntity_OreDrillingPlantBase.java | 46 ++++++++----- .../multi/GT_MetaTileEntity_ProcessingArray.java | 39 +++++++---- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 44 ++++++++----- .../multi/GT_MetaTileEntity_VacuumFreezer.java | 30 ++++++--- src/main/resources/assets/gregtech/lang/en_US.lang | 27 ++++---- 30 files changed, 766 insertions(+), 342 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java index c8914c0b7d..e30fe5d606 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -25,7 +25,7 @@ import net.minecraft.util.StatCollector; * addInputBus/addInputHatch/addOutputBus/addOutputHatch, in that order
* Use addStructureInfo for any comments on nonstandard structure info wherever needed *
- * toolTipFinisher
+ * toolTipFinisher goes at the very end
*
* Originally created by kekzdealer */ @@ -42,6 +42,7 @@ public class GT_Multiblock_Tooltip_Builder { //Localized tooltips private static final String TT_machineType = StatCollector.translateToLocal("GT5U.MBTT.MachineType"); private static final String TT_dimensions = StatCollector.translateToLocal("GT5U.MBTT.Dimensions"); + private static final String TT_hollow = StatCollector.translateToLocal("GT5U.MBTT.Hollow"); private static final String TT_structure = StatCollector.translateToLocal("GT5U.MBTT.Structure"); private static final String TT_controller = StatCollector.translateToLocal("GT5U.MBTT.Controller"); private static final String TT_minimum = StatCollector.translateToLocal("GT5U.MBTT.Minimum"); @@ -74,7 +75,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addMachineType(String machine) { - iLines.add(TT_machineType + EnumChatFormatting.YELLOW + machine + EnumChatFormatting.RESET); + iLines.add(TT_machineType + COLON + EnumChatFormatting.YELLOW + machine + EnumChatFormatting.RESET); return this; } @@ -111,7 +112,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) { - iLines.add(TT_causes + " " + EnumChatFormatting.DARK_PURPLE + pollution + " " + TT_pps + EnumChatFormatting.RESET); + iLines.add(TT_causes + COLON + EnumChatFormatting.DARK_PURPLE + pollution + " " + EnumChatFormatting.GRAY + TT_pps); return this; } @@ -125,12 +126,50 @@ public class GT_Multiblock_Tooltip_Builder { * Structure height. * @param l * Structure depth/length. + * @param hollow + * T/F, adds a (hollow) comment if true * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder beginStructureBlock(int w, int h, int l) { - sLines.add(TT_dimensions + w + "x" + h + "x" + l + " (WxHxL)"); - sLines.add(TT_structure); - return this; + public GT_Multiblock_Tooltip_Builder beginStructureBlock(int w, int h, int l, boolean hollow) { + if (hollow) { + sLines.add(TT_dimensions + COLON + w + "x" + h + "x" + l + " (WxHxL) " + TT_hollow); + } + else { + sLines.add(TT_dimensions + COLON + w + "x" + h + "x" + l + " (WxHxL)"); + } + sLines.add(TT_structure + COLON); + return this; + } + + /** + * Begin adding structural information by adding a line about the structure's dimensions
+ * and then inserting a "Structure:" line. Variable version displays min and max + * + * @param wmin + * Structure min width. + * @param wmax + * Structure max width. + * @param hmin + * Structure min height. + * @param hmax + * Structure max height. + * @param lmin + * Structure min depth/length. + * @param lmax + * Structure max depth/length. + * @param hollow + * T/F, adds a (hollow) comment if true + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin, int lmax, boolean hollow) { + if (hollow) { + sLines.add(TT_dimensions + COLON + wmin + "-" + wmax + "x" + hmin + "-" + hmax + "x" + lmin + "-" + lmax + " (WxHxL) " + TT_hollow); + } + else { + sLines.add(TT_dimensions + COLON + wmin + "-" + wmax + "x" + hmin + "-" + hmax + "x" + lmin + "-" + lmax + " (WxHxL)"); + } + sLines.add(TT_structure + COLON); + return this; } /** @@ -141,7 +180,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addController(String info) { - sLines.add(TAB + TT_controller + info); + sLines.add(TAB + TT_controller + COLON + info); return this; } @@ -169,7 +208,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info) { - sLines.add(TAB + name + info); + sLines.add(TAB + name + COLON + info); return this; } @@ -181,7 +220,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info) { - sLines.add(TAB + TT_maintenancehatch + info); + sLines.add(TAB + TT_maintenancehatch + COLON + info); return this; } @@ -193,7 +232,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info) { - sLines.add(TAB + TT_mufflerhatch + info); + sLines.add(TAB + TT_mufflerhatch + COLON + info); return this; } @@ -205,7 +244,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info) { - sLines.add(TAB + TT_energyhatch + info); + sLines.add(TAB + TT_energyhatch + COLON + info); return this; } @@ -217,7 +256,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info) { - sLines.add(TAB + TT_dynamohatch + info); + sLines.add(TAB + TT_dynamohatch + COLON + info); return this; } @@ -229,7 +268,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addInputBus(String info) { - sLines.add(TAB + TT_inputbus + info); + sLines.add(TAB + TT_inputbus + COLON + info); return this; } @@ -241,7 +280,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addInputHatch(String info) { - sLines.add(TAB + TT_inputhatch + info); + sLines.add(TAB + TT_inputhatch + COLON + info); return this; } @@ -253,7 +292,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addOutputBus(String info) { - sLines.add(TAB + TT_outputbus + info); + sLines.add(TAB + TT_outputbus + COLON + info); return this; } @@ -265,7 +304,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addOutputHatch(String info) { - sLines.add(TAB + TT_outputhatch + info); + sLines.add(TAB + TT_outputhatch + COLON + info); return this; } @@ -291,7 +330,7 @@ public class GT_Multiblock_Tooltip_Builder { */ public void toolTipFinisher(String mod) { iLines.add(TT_hold + " " + EnumChatFormatting.BOLD + "[LSHIFT]" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + " " + TT_todisplay); - iLines.add(TT_mod + " " + EnumChatFormatting.GREEN + mod + EnumChatFormatting.RESET); + iLines.add(TT_mod + COLON + EnumChatFormatting.GREEN + mod + EnumChatFormatting.GRAY); iArray = new String[iLines.size()]; sArray = new String[sLines.size()]; iLines.toArray(iArray); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 67ce33f104..c90df2a7a7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -2,6 +2,8 @@ package gregtech.common.tileentities.machines.multi; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -14,6 +16,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -42,17 +45,34 @@ public class GT_MetaTileEntity_AssemblyLine } public String[] getDescription() { - return new String[]{"Assembling Line", - "Size: 3x(5-16)x4, variable length", - "From Bottom to Top, Left to Right", - "Layer 1 - Solid Steel Machine Casing, Input Bus (last is Output Bus), Solid Steel Machine Casing", - " - Casings can be replaced by Maint or Input Hatch", - "Layer 2 - Reinforced Glass, Assembling Line Casing, Reinforced Glass", - "Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing", - "Layer 4 - Empty, Solid Steel Machine Casing, Empty - Casing can be replaced by Energy Hatch", - "Up to 16 repeating slices, First replaces 1 Grate with Assembly Line,", - "Last has Output Bus instead of Input Bus", - "Optional - Replace 1x Grate with Data Access Hatch next to the Controller"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Assembling Line") + .addInfo("Controller block for the Assembling Line") + .addInfo("Used to make complex machine parts (LuV+)") + .addInfo("Does not make Assembler items") + .addSeparator() + .beginVariableStructureBlock(5, 15, 4, 4, 3, 3, false)//? + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input Bus (last is Output Bus), Solid Steel Machine Casing") + .addStructureInfo("Layer 2 - Reinforced Glass, Assembling Line Casing, Reinforced Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") + .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") + .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes, aside from the last") + .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller") + .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller")//TT + + .addController("Either Grate on layer 3 of the first slice") + .addEnergyHatch("Any layer 4 casing") + .addMaintenanceHatch("Any layer 1 casing") + .addInputBus("As specified on layer 1") + .addInputHatch("Any layer 1 casing") + .addOutputBus("Replaces Input Bus on final slice") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index 95b45e2cc4..eb1ce1348f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -1,11 +1,14 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace{ @@ -26,13 +29,25 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri } public String[] getDescription() { - return new String[]{ - "Controller Block for the Bricked Blast Furnace", - "Controller has to be placed in the (front) center of the second layer", - "Useable for Steel and general Pyrometallurgy", - "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", - "Built from 32 Firebricks", - "Causes 200 Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller Block for the Bricked Blast Furnace") + .addInfo("Usable for Steel and general Pyrometallurgy") + .addInfo("Has a useful interface, unlike other gregtech multis") + .addPollutionAmount(200) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front center") + .addOtherStructurePart("Firebricks", "Everything except the controller") + .addStructureInfo("The top block is also empty") + .addStructureInfo("You can share the walls of GT multis, so") + .addStructureInfo("each additional one costs less, up to 4") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 0ca5b79d68..af388a790d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -27,12 +27,13 @@ public class GT_MetaTileEntity_BronzeBlastFurnace } public String[] getDescription() { - return new String[]{ + return new String[]{"Disabled"}; + /*return new String[]{ "Controller Block for the Bronze Blast Furnace", "Useable for Steel and general Pyrometallurgy", "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", "Built from 32 Bronze Plated Bricks", - "Causes 200 Pollution per second"}; + "Causes 200 Pollution per second"};*/ } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 8be3b10f54..8459f5e84b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -2,6 +2,8 @@ package gregtech.common.tileentities.machines.multi; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; @@ -10,6 +12,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.common.GT_Pollution; import net.minecraft.block.Block; @@ -38,15 +41,25 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } public String[] getDescription() { - return new String[]{ - "Controller for the Charcoal Pit", - "Converts Logs into Brittle Charcoal blocks", - "Max Size(WxHxD): 11x6x11, Controller (Top layer, centered)", - "11x1x11 of Bricks (Bottom layer only)", - "11x5x11 of Logs (Above bottom Brick layer)", - "Only grass/dirt can touch Log blocks", - "No air between logs allowed", - "Causes 100 Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Charcoal Pile Igniter") + .addInfo("Controller for the Charcoal Pit") + .addInfo("Converts Logs into Brittle Charcoal blocks") + .addInfo("Will automatically start when valid") + .addPollutionAmount(100) + .addSeparator() + .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) + .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") + .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") + .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") + .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") + .addStructureInfo("No air between logs allowed") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 21a407f6e2..606c63110f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -12,6 +12,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; @@ -20,6 +21,8 @@ import net.minecraft.tileentity.TileEntity; import static gregtech.api.enums.GT_Values.debugCleanroom; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { private int mHeight = -1; @@ -38,21 +41,31 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the Cleanroom", - "Min(WxHxD): 3x4x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", - "Controller (Top center)", - "Top besides contoller and edges: Filter Machine Casing", - "1 Reinforced Door (keep closed for 100% efficency)", - "1x LV or 1x MV Energy Hatch, 1x Maintainance Hatch", - "Up to 10 Machine Hull Item & Energy transfer through walls", - "Remaining Blocks: Plascrete, 20 min", - GT_Values.cleanroomGlass+"% of the Plascrete can be Reinforced Glass (min 20 Plascrete still apply)", - "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked", - "An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV", - "2 LV batteries + 1 LV generator or 1 MV generator", - "Time required to reach full efficiency is propotional to the height of empty space within.", - "Make sure your Energy Hatch matches!"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Cleanroom") + .addInfo("Controller block for the Cleanroom") + .addInfo("Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked")//? + .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") + .addInfo("2 LV batteries + 1 LV generator or 1 MV generator")//? + .addInfo("Time required to reach full efficiency is propotional to the height of empty space within") + .addInfo("Make sure your Energy Hatch matches! ?") + .addSeparator() + .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) + .addController("Top center") + .addCasingInfo("Plascrete", 20) + .addStructureInfo(GT_Values.cleanroomGlass+"% of the Plascrete can be replaced with Reinforced Glass")//check + .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") + .addEnergyHatch("LV or MV, any casing")//check + .addMaintenanceHatch("Any casing") + .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") + .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") + .addStructureInfo("You can also use Diodes for more power") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java index 0a68bd7b03..ed6c028243 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java @@ -4,9 +4,12 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import static gregtech.api.enums.GT_Values.VN; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_ConcreteBackfillerBase { public GT_MetaTileEntity_ConcreteBackfiller2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -19,18 +22,33 @@ public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_Con @Override public String[] getDescription() { String casings = getCasingBlockItem().get(0).getDisplayName(); - return new String[]{ - "Controller Block for the Advanced Concrete Backfiller", - "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", - "1x Input Hatch (One of base casings)", - "1x Maintenance Hatch (One of base casings)", - "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Put Programmed Circuits into Data Access to config radius", - "Radius = (total config value)x2 blocks", - "Default 64, Maximum 128",}; + + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Concrete Backfiller") + .addInfo("Controller Block for the Advanced Concrete Backfiller") + .addInfo("Will fill in areas below it with light concrete. This goes through walls") + .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") + .addInfo("Will pull back the pipes after it finishes that layer") + .addInfo("Put Programmed Circuits into a Data Access Hatch to config radius. Buggy") + .addInfo("Radius = (total config value)x2 blocks. Default 64, Maximum 128")//broken + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addStructureInfo("Data Access Hatch: Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("GT Concrete, any base casing") + .addOutputBus("Mining Pipes, optional, any base casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index a70b5d76b8..a65f4d0e86 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -4,12 +4,15 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.VN; +import org.lwjgl.input.Keyboard; + public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTileEntity_DrillerBase { private int mLastXOff = 0, mLastZOff = 0; @@ -24,16 +27,31 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi protected String[] getDescriptionInternal(String tierSuffix) { String casings = getCasingBlockItem().get(0).getDisplayName(); - return new String[]{ - "Controller Block for the Concrete Backfiller " + (tierSuffix != null ? tierSuffix : ""), - "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", - "1x Input Hatch (One of base casings)", - "1x Maintenance Hatch (One of base casings)", - "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Radius is " + getRadius() + " blocks"}; + + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Concrete Backfiller") + .addInfo("Controller Block for the Concrete Backfiller " + (tierSuffix != null ? tierSuffix : ""))//Unused? + .addInfo("Will fill in areas below it with light concrete. This goes through walls") + .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") + .addInfo("Will pull back the pipes after it finishes that layer") + .addInfo("Radius is " + getRadius() + " blocks") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("GT Concrete, any base casing") + .addOutputBus("Mining Pipes, optional, any base casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index c37a5a9976..36e607ce93 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -3,6 +3,8 @@ package gregtech.common.tileentities.machines.multi; import java.util.ArrayList; import java.util.Collection; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -15,6 +17,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynam import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -40,22 +43,34 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock } public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Combustion Engine", - "Size(WxHxD): 3x3x4, Controller (front centered)", - "3x3x4 of Stable Titanium Machine Casing (hollow, Min 16!)", - "2x Titanium Gear Box Machine Casing inside the Hollow Casing", - "8x Engine Intake Machine Casing (around controller)", - "2x Input Hatch (Fuel/Lubricant) (one of the Casings next to a Gear Box)", - "1x Maintenance Hatch (one of the Casings next to a Gear Box)", - "1x Muffler Hatch (top middle back, next to the rear Gear Box)", - "1x Dynamo Hatch (back centered)", - "Engine Intake Casings must not be obstructed in front (only air blocks)", - "Supply Flammable Fuels and 1000L of Lubricant per hour to run.", - "Supply 40L of Oxygen per second to boost output (optional).", - "Default: Produces 2048EU/t at 100% efficiency", - "Boosted: Produces 6144EU/t at 150% efficiency", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Combustion Generator") + .addInfo("Controller block for the Large Combustion Engine") + .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") + .addInfo("Supply 40L/s of Oxygen to boost output (optional)") + .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") + .addInfo("You need to wait for it to reach 300% to output full power") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfo("Stable Titanium Machine Casing", 16) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center") + .addMaintenanceHatch("One of the casings next to a Gear Box") + .addMufflerHatch("Top middle back, above the rear Gear Box") + .addInputHatch("Diesel Fuel, next to a Gear Box") + .addInputHatch("Lubricant, next to a Gear Box") + .addInputHatch("Oxygen, optional, next to a Gear Box") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 45ba3c97f5..12ab91d876 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -10,6 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -20,6 +21,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_MultiBlockBase { private static final int CASING_INDEX = 49; @@ -38,18 +41,26 @@ public class GT_MetaTileEntity_DistillationTower } public String[] getDescription() { - return new String[]{ - "Controller Block for the Distillation Tower", - "Size(WxHxD): 3xhx3 (Hollow), with h ranging from 3 to 12", - "Controller (Front bottom)", - "1x Input Hatch (Any bottom layer casing)", - "2-11x Output Hatch (One per layer except bottom layer)", - "1x Output Bus (Any bottom layer casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Fluids are only put out at the correct height", - "The correct height equals the slot number in the NEI recipe", - "Clean Stainless Steel Machine Casings for the rest (7 x h - 5 at least!)"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Distillery") + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("2-11x Output Hatches (One per layer except bottom layer)") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index df3dea34fa..061db80ece 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -5,6 +5,8 @@ import static gregtech.api.enums.GT_Values.VN; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -18,6 +20,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -47,22 +50,35 @@ public class GT_MetaTileEntity_ElectricBlastFurnace } public String[] getDescription() { - return new String[]{ - "Controller Block for the Blast Furnace", - "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", - "16x Heating Coils (Two middle Layers, hollow)", - "1x Input Hatch/Bus (Any bottom layer casing)", - "1x Output Hatch/Bus (Any bottom layer casing)", - "1x Energy Hatch (Any bottom layer casing)", - "1x Maintenance Hatch (Any bottom layer casing)", - "1x Muffler Hatch (Top middle)", - "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", - " Recovery scales with Muffler Hatch tier", - "Heat Proof Machine Casings for the rest", - "Each 900K over the min. Heat Capacity multiplies eu/t by 0.95", - "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", - "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller block for the Electric Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") + .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") + .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 0) + .addOtherStructurePart("Heating Coils (any tier)", "Two middle Layers") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle") + .addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Gasses, Any top layer casing") + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .addOutputHatch("Platline fluids, Any bottom layer casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 77290441cd..9da832c81a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -1,10 +1,13 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer { @@ -48,13 +51,29 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC } public String[] getDescription() { - return new String[]{ - "It's over 9000!!!", - "LuV Machine Casings around Superconducting Coil Blocks", - "2-16 Input Hatches", "1-16 Output Hatches", - "1-16 Energy Hatches", - "All Hatches must be LuV or better", - "2048EU/t and 10mio EU Cap per Energy Hatch"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk I") + .addInfo("2048EU/t and 10M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("LuV Machine Casing", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be LuV or better") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index c091d637bc..7a363f8f6f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -1,10 +1,13 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer { @@ -48,14 +51,29 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC } public String[] getDescription() { - return new String[]{ - "It's over 9000!!!", - "Fusion Machine Casings around Fusion Coil Blocks", - "2-16 Input Hatches", - "1-16 Output Hatches", - "1-16 Energy Hatches", - "All Hatches must be ZPMV or better", - "4096EU/t and 20mio EU Cap per Energy Hatch"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk II") + .addInfo("4096EU/t and 20M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("Fusion Machine Casing", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be ZPM or better") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index bc50b5ee5f..a575427791 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -1,10 +1,13 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer { @@ -48,14 +51,29 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC } public String[] getDescription() { - return new String[]{ - "A SUN DOWN ON EARTH", - "Fusion Machine Casings MK II around Fusion 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"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("A SUN DOWN ON EARTH") + .addInfo("Controller block for the Fusion Reactor Mk III") + .addInfo("8192EU/t and 40M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("Fusion Machine Casing Mk II", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be UV or better") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index 4dcd9121a8..dfa58c6407 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -13,6 +15,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -41,16 +44,30 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc } public String[] getDescription() { - return new String[]{ - "Controller Block for the Heat Exchanger", - "Size(WxHxD): 3x4x3, Controller (Front middle at bottom)", - "3x3x4 of Stable Titanium Machine Casings (hollow, Min 20!)", - "2x Titanium Pipe Casing (Inside the Hollow Machine Casings)", - "1x Distillated Water Input (Any casing)", - "1x Steam Output (Any casing)", - "1x Hot Fluid Input (Bottom center)", - "1x Cold Fluid Output (Top Center)", - "1x Maintenance Hatch (Any casing)"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Heat Exchanger") + .addInfo("Controller Block for the Large Heat Exchanger") + .addInfo("More complicated than a Fusion Reactor. Seriously") + .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") + .addInfo("Read the wiki article to understand how it works") + .addInfo("Then go to the Discord to understand the wiki") + .addSeparator() + .beginStructureBlock(3, 4, 3, false) + .addController("Front bottom") + .addCasingInfo("Stable Titanium Machine Casing", 20) + .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") + .addMaintenanceHatch("Any casing") + .addInputHatch("Hot fluid, bottom center") + .addInputHatch("Distilled water, any casing") + .addOutputHatch("Cold fluid, top center") + .addOutputHatch("Steam/SH Steam, any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index edce80fdf4..9e002badbf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -17,6 +18,8 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { @@ -32,17 +35,27 @@ public class GT_MetaTileEntity_ImplosionCompressor } public String[] getDescription() { - return new String[]{ - "Controller Block for the Implosion Compressor", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Muffler Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Solid Steel Machine Casings for the rest (16 at least!)", - "Casings can be replaced with Explosion Warning Signs", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Implosion Compressor") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Solid Steel Machine Casing", 16) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addMufflerHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 0781397ecc..551abdf38a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -18,6 +18,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_MultiBlockBase { private boolean firstRun = true; @@ -35,22 +37,32 @@ public abstract class GT_MetaTileEntity_LargeBoiler } public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Boiler", - "Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s", - "A programmed circuit in the main block throttles the boiler (-1000L/s per config)", - "Size(WxHxD): 3x5x3, Controller (Front middle in Fireboxes)", - "3x1x3 of "+getCasingMaterial()+" Fire Boxes (Bottom layer, Min 3)", - "3x4x3 of "+getCasingMaterial()+" " +getCasingBlockType()+ " Casings (Above Fireboxes, hollow, Min 24!)", - "3 "+getCasingMaterial()+" Pipe Casing Blocks (Inside the Hollow Casing)", - "1x Input Fuel Hatch/Bus (Any Firebox)", - "1x Input Water Hatch (Any Firebox)", - "1x Output Hatch (Any Casing)", - "1x Maintenance Hatch (Any Firebox)", - "1x Muffler Hatch (Any Firebox)", - String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()), - "Causes up to " + 20 * getPollutionPerTick(null) + " Pollution per second" -}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Boiler") + .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler") + .addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? + .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") + .addInfo(String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()))//? check semifluid again + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 5, 3, false) + .addController("Front bottom") + .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24)//? + .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") + .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") + .addMaintenanceHatch("Any firebox") + .addMufflerHatch("Any firebox") + .addInputBus("Solid fuel, Any firebox") + .addInputHatch("Liquid fuel, Any firebox") + .addStructureInfo("You can use either, or both") + .addInputHatch("Water, Any firebox") + .addOutputHatch("Steam, any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public abstract String getCasingMaterial(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index c5f1852629..d462b9a36d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -45,18 +45,19 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu .addInfo("Controller block for the Large Chemical Reactor") .addInfo("Does not lose efficiency when overclocked") .addInfo("Accepts fluids instead of fluid cells") - .beginStructureBlock(3, 3, 3) - .addController("Front centered") - .addCasingInfo("Chemically Inert Machine Casings", 8) + .addSeparator() + .beginStructureBlock(3, 3, 3, false) + .addController("Front center") + .addCasingInfo("Chemically Inert Machine Casing", 8) .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing") - .addEnergyHatch("Any Casing") - .addMaintenanceHatch("Any Casing") - .addInputBus("Any Casing") - .addInputHatch("Any Casing") - .addOutputBus("Any Casing") - .addOutputHatch("Any Casing") - .addStructureInfo("You can have multiple I/O hatches/busses") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addInputHatch("Any casing") + .addOutputBus("Any casing") + .addOutputHatch("Any casing") + .addStructureInfo("You can have multiple hatches/busses") .toolTipFinisher("Gregtech"); if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return tt.getInformation(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 4bd44ef80c..6c482db6e7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -3,12 +3,15 @@ package gregtech.common.tileentities.machines.multi; import java.util.ArrayList; import java.util.Collection; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; @@ -31,18 +34,26 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.casingTexturePages[0][58]}; } - public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Gas Turbine", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Gas Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Muffler Hatch (Side centered)", - "1x Dynamo Hatch (Back centered)", - "Stainless Steel Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Produces " + getPollutionPerTick(null)*20 + " pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Gas Turbine") + .addInfo("Controller block for the Large Gas Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Stainless Steel Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addMufflerHatch("Side centered") + .addInputHatch("Gas Fuel, Side centered") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public int getFuelValue(FluidStack aLiquid) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index c6f6e36c44..2355b89fa8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -4,6 +4,8 @@ import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; @@ -12,6 +14,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -38,17 +41,27 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La } public String[] getDescription() { - return new String[]{ - "Controller Block for the Large High Pressure Steam Turbine", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Superheated Steam Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Dynamo Hatch (Back centered)", - "1x Output Hatch for Steam (Side centered)", - "Titanium Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor and fitting", - "Use screwdriver to adjust fitting of turbine"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Steam Turbine") + .addInfo("Controller block for the Large High Pressure Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Steam as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Titanium Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Superheated Steam, Side centered") + .addOutputHatch("Steam, Side centered") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index be62ff2d97..bb5134097a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -3,6 +3,8 @@ package gregtech.common.tileentities.machines.multi; import java.util.ArrayList; import java.util.Collection; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -10,6 +12,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; @@ -33,17 +36,26 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU5) : Textures.BlockIcons.casingTexturePages[0][60]}; } - public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Plasma Generator", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Plasma Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Output Hatch (Side centered, optional)", - "1x Dynamo Hatch (Back centered)", - "Tungstensteel Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Plasma Turbine") + .addInfo("Controller block for the Large Plasma Generator") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Use your Fusion Reactor to produce the Plasma") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Tungstensteel Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Plasma Fluid, Side centered") + .addOutputHatch("Molten Fluid, optional, Side centered") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public int getFuelValue(FluidStack aLiquid) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 2943f6f946..20bcbf10d0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -4,6 +4,8 @@ import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; @@ -12,6 +14,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -40,17 +43,27 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg } public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Steam Turbine", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Steam Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Dynamo Hatch (Back centered)", - "1x Output Hatch for Distilled Water (Side centered)", - "Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor and fitting", - "Use screwdriver to adjust fitting of turbine"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Steam Turbine") + .addInfo("Controller block for the Large Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Distilled Water as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Steam, Side centered") + .addOutputHatch("Distilled Water, Side centered") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index cdc68702d2..5eca30def1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -4,6 +4,8 @@ import static gregtech.api.enums.GT_Values.VN; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -15,6 +17,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffl import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -41,18 +44,28 @@ public class GT_MetaTileEntity_MultiFurnace } public String[] getDescription() { - return new String[]{ - "Controller Block for the Multi Smelter", - "Smelts up to 8-128 Items at once", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front middle at bottom)", - "8x Heating Coils (Middle layer, hollow)", - "1x Input Bus (One of bottom)", - "1x Output Bus (One of bottom)", - "1x Maintenance Hatch (One of bottom)", - "1x Muffler Hatch (Top middle)", - "1x Energy Hatch (One of bottom)", - "Heat Proof Machine Casings for the rest", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Furnace") + .addInfo("Controller Block for the Multi Smelter") + .addInfo("Smelts up to 8-128 items at once") + .addInfo("Items smelted increases with coil tier") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 8) + .addOtherStructurePart("Heating Coils (any tier)", "Middle layer") + .addEnergyHatch("Any bottom casing") + .addMaintenanceHatch("Any bottom casing") + .addMufflerHatch("Top Middle") + .addInputBus("Any bottom casing") + .addOutputBus("Any bottom casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index 9519d901d7..e4ad65e4a4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -11,6 +11,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -20,6 +21,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase { private ForgeDirection orientation; private int controllerX, controllerZ; @@ -33,18 +36,29 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa } public String[] getDescription() { - return new String[]{ - "Controller Block for the Oil Cracking Unit", - "Thermally cracks heavy hydrocarbons into lighter fractions", - "Size(WxHxD): 5x3x3 (Hollow), Controller (Front center)", - "Ring of 8 Cupronickel Coils (Each side of Controller)", - "1x Hydrocarbon Input Bus/Hatch (Any left/right side casing)", - "1x Steam/Hydrogen Input Hatch (Any middle ring casing)", - "1x Cracked Hydrocarbon Output Hatch (Any left/right side casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Clean Stainless Steel Machine Casings for the rest (18 at least!)", - "Input/Output Hatches must be on opposite sides"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Cracker") + .addInfo("Controller block for the Oil Cracking Unit") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Place the appropriate circuit in the controller") + .addSeparator() + .beginStructureBlock(5, 3, 3, true) + .addController("Front center") + .addCasingInfo("Clean Stainless Steel Machine Casing", 18) + .addOtherStructurePart("2 Rings of 8 Cupronickel Coils", "Each side of the controller") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Steam/Hydrogen, Any middle ring casing") + .addInputHatch("Any left/right side casing") + .addOutputHatch("Any left/right side casing") + .addStructureInfo("Input/Output Hatches must be on opposite sides!") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java index 76f8e7f87f..a7a7023d34 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java @@ -3,6 +3,7 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -16,6 +17,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + import static gregtech.api.enums.GT_Values.VN; import static gregtech.api.enums.GT_Values.debugDriller; import static gregtech.common.GT_UndergroundOil.undergroundOil; @@ -55,18 +58,30 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D protected String[] getDescriptionInternal(String tierSuffix) { String casings = getCasingBlockItem().get(0).getDisplayName(); - return new String[]{ - "Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : ""), - "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", - "1x Output Hatch (One of base casings)", - "1x Maintenance Hatch (One of base casings)", - "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Working on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks", - "Use Screwdriver to configure range", - "Use Programmed Circuits to ignore near exhausted oil field"}; + + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Pump") + .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") + .addInfo("Use a Screwdriver to configure range") + .addInfo("Use Programmed Circuits to ignore near exhausted oil field") + .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.")//doesn't work + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes or Circuits, optional, any base casing") + .addOutputHatch("Any base casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 5ead0bf896..2e367e63e8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.IChunkLoader; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ChunkManager; import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -32,6 +33,8 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import org.lwjgl.input.Keyboard; + import static gregtech.api.enums.GT_Values.VN; public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_DrillerBase implements IChunkLoader { @@ -335,22 +338,33 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile protected String[] getDescriptionInternal(String tierSuffix) { String casings = getCasingBlockItem().get(0).getDisplayName(); - return new String[]{ - "Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : ""), - "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", - "1x Input Hatch for drilling fluid (Any bottom layer casing)", - "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)", - "1x Output Bus (Any bottom layer casing)", - "1x Maintenance Hatch (Any bottom layer casing)", - "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Use Screwdriver to configure block radius", - "Use Soldering iron to turn off chunk mode", - "Maximum radius is " + (getRadiusInChunks() << 4) + " blocks", - "In chunk mode working area center is the chunk corner nearest to the drill", - "Fortune bonus of " + (mTier + 3)}; + + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Miner") + .addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Use a Screwdriver to configure block radius") + .addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks") + .addInfo("Use Soldering iron to turn off chunk mode") + .addInfo("In chunk mode, working area center is the chunk corner nearest to the drill") + .addInfo("Gives ~3x as much crushed ore vs normal processing") + .addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("Drilling Fluid, any base casing") + .addOutputBus("Any base casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 850908104b..2496d02a42 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -12,6 +12,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_ProcessingArray_Manager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; @@ -25,6 +26,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.ArrayUtils; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; import java.util.Arrays; @@ -54,18 +56,31 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } public String[] getDescription() { - return new String[]{ - "Controller Block for the Processing Array", - "Runs supplied machines as if placed in the world", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", - "1x Input Hatch/Bus (Any casing)", - "1x Output Hatch/Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Robust Tungstensteel Machine Casings for the rest (14 at least!)", - "Place up to 64 Single Block GT Machines into the Controller Inventory", - "Use screwdriver to enable separate input busses", - "Maximal overclockedness of machines inside: Tier 9"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Processing Array") + .addInfo("Runs supplied machines as if placed in the world") + .addInfo("Place up to 64 singleblock GT machines into the controller") + .addInfo("Note that tou still need to supply power to them all") + .addInfo("Use a screwdriver to enable separate input busses") + .addInfo("Maximal overclockedness of machines inside: Tier 9") + .addInfo("Doesn't work on certain machines, deal with it") + .addInfo("Use it if you hate GT++, or want even more speed later on") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 14) + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addInputHatch("Any casing") + .addOutputBus("Any casing") + .addOutputHatch("Any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index eee88dfb21..1d9b360338 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -10,6 +10,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.loaders.oreprocessing.ProcessingLog; @@ -23,6 +24,8 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import java.util.Arrays; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase { private int coilMetaID; @@ -38,21 +41,32 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock } public String[] getDescription() { - return new String[]{ - "Controller Block for the Pyrolyse Oven", - "Industrial Charcoal producer and Oil from Plants", - "Size(WxHxD): 5x4x5, Controller (Bottom center)", - "3x1x3 of Heating Coils (At the center of the bottom layer)", - "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)", - "1x Output Hatch/Bus (Any bottom layer casing)", - "1x Maintenance Hatch (Any bottom layer casing)", - "1x Muffler Hatch (Centered 3x1x3 area in Top layer)", - "1x Energy Hatch (Any bottom layer casing)", - "Pyrolyse Oven Casings for the rest (60 at least!)", - "Processing speed scales linearly with Coil tier:", - "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", - "EU/t is not affected by Coil tier", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Coke Oven") + .addInfo("Controller block for the Pyrolyse Oven") + .addInfo("Industrial Charcoal producer") + .addInfo("Processing speed scales linearly with Coil tier:") + .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.") + .addInfo("EU/t is not affected by Coil tier") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(5, 4, 5, true) + .addController("Front center") + .addCasingInfo("Pyrolyse Oven Casing", 60) + .addOtherStructurePart("Heating Coils (any tier)", "Center 3x1x3 of the bottom layer") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Center 3x1x3 area in top layer") + .addInputBus("Center 3x1x3 area in top layer") + .addInputHatch("Center 3x1x3 area in top layer") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Any bottom layer casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index 834b97aa9d..bf4b1e9db7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -16,6 +17,8 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import org.lwjgl.input.Keyboard; + public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) { @@ -31,15 +34,24 @@ public class GT_MetaTileEntity_VacuumFreezer } public String[] getDescription() { - return new String[]{ - "Controller Block for the Vacuum Freezer", - "Super cools hot ingots and cells", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Frost Proof Machine Casings for the rest (16 at least!)"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Vacuum Freezer") + .addInfo("Controller Block for the Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Frost Proof Machine Casing", 16) + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 53970634f9..c3c5a574af 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -1,19 +1,20 @@ # Multiblock Tooltip Builder Keywords # Context can be found in the class gregtech.api.util.GT_Multiblock_Tooltip_Builder -GT5U.MBTT.MachineType=Machine Type: -GT5U.MBTT.Dimensions=Dimensions: -GT5U.MBTT.Structure=Structure: -GT5U.MBTT.Controller=Controller: +GT5U.MBTT.MachineType=Machine Type +GT5U.MBTT.Dimensions=Dimensions +GT5U.MBTT.Hollow=(Hollow) +GT5U.MBTT.Structure=Structure +GT5U.MBTT.Controller=Controller GT5U.MBTT.Minimum=(minimum) -GT5U.MBTT.MaintenanceHatch=Maintenance Hatch: -GT5U.MBTT.MufflerHatch=Muffler Hatch: -GT5U.MBTT.EnergyHatch=Energy Hatch: -GT5U.MBTT.DynamoHatch=Dynamo Hatch: -GT5U.MBTT.InputBus=Input Bus/ses: -GT5U.MBTT.InputHatch=Input Hatch/es: -GT5U.MBTT.OutputBus=Output Bus/ses: -GT5U.MBTT.OutputHatch=Output Hatch/es: -GT5U.MBTT.Causes=Causes: +GT5U.MBTT.MaintenanceHatch=Maintenance Hatch +GT5U.MBTT.MufflerHatch=Muffler Hatch +GT5U.MBTT.EnergyHatch=Energy Hatch +GT5U.MBTT.DynamoHatch=Dynamo Hatch +GT5U.MBTT.InputBus=Input Bus +GT5U.MBTT.InputHatch=Input Hatch +GT5U.MBTT.OutputBus=Output Bus +GT5U.MBTT.OutputHatch=Output Hatch +GT5U.MBTT.Causes=Causes GT5U.MBTT.PPS=pollution per second GT5U.MBTT.Hold=Hold GT5U.MBTT.Display=to display structure guidelines -- cgit From dda943791049670692f1da6400c9c00fcbbeab71 Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Fri, 20 Nov 2020 00:43:45 -0500 Subject: Fixes boosting not working. Also getInfoData too --- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index eddf59b360..f6bf2527f5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,7 +1,7 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; +//import java.util.ArrayList; +//import java.util.Collection; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -10,26 +10,26 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +//import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +//import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +//import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; +//import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine { - protected int fuelConsumption = 0; - protected int fuelValue = 0; - protected int fuelRemaining = 0; - protected boolean boostEu = false; + //protected int fuelConsumption = 0; + //protected int fuelValue = 0; + //protected int fuelRemaining = 0; + //protected boolean boostEu = false; public GT_MetaTileEntity_ExtremeDieselEngine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); -- cgit From 820e2aa78e955a6bdf528112a1eb4d89174558d7 Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Fri, 20 Nov 2020 01:03:17 -0500 Subject: Remove unnecessary stuff/comments. Change meta # --- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 38 +++++++--------------- .../preload/GT_Loader_MetaTileEntities.java | 3 +- 2 files changed, 13 insertions(+), 28 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index f6bf2527f5..0daaf9cb51 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,8 +1,5 @@ package gregtech.common.tileentities.machines.multi; -//import java.util.ArrayList; -//import java.util.Collection; - import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -10,26 +7,17 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -//import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -//import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -//import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -//import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine { - //protected int fuelConsumption = 0; - //protected int fuelValue = 0; - //protected int fuelRemaining = 0; - //protected boolean boostEu = false; public GT_MetaTileEntity_ExtremeDieselEngine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -41,11 +29,11 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public String[] getDescription() { - return new String[]{ + return new String[]{//change to new format after it's approved "Controller Block for the Extreme Combustion Engine", "Size(WxHxD): 3x3x4, Controller (front centered)", "3x3x4 of Robust Tungstensteel Machine Casing (hollow, Min 16!)", - "2x Titanium Gear Box Machine Casing inside the Hollow Casing",//todo + "2x Titanium Gear Box Machine Casing inside the Hollow Casing", "8x Extreme Engine Intake Casing (around controller)", "2x Input Hatch (HOG/Lubricant) (one of the Casings next to a Gear Box)", "1x Input Hatch (Optional, for Liquid Oxygen) (one of the Casings next to a Gear Box)", @@ -70,31 +58,31 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE)}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60]};//controller texture? where do I find this? Copied plasma turbine + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png");//change + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeExtremeDieselEngine.png"); } @Override - public Block getCasingBlock() {//changed to RTSMC + public Block getCasingBlock() { return GregTech_API.sBlockCasings4; } @Override - public byte getCasingMeta() {//same + public byte getCasingMeta() { return 0; } @Override public Block getIntakeBlock() { - return GregTech_API.sBlockCasings8;//added new + return GregTech_API.sBlockCasings8; } @Override - public byte getIntakeMeta() {//same + public byte getIntakeMeta() { return 4; } @@ -109,7 +97,7 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die } @Override - public byte getCasingTextureIndex() {//should be what hatches/busses change to? + public byte getCasingTextureIndex() { return 60; } @@ -145,12 +133,12 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public int getMaxEfficiency(ItemStack aStack) { - return boostEu ? 40000 : 10000;//4x output if boosted instead of x3 + return boostEu ? 40000 : 10000; } @Override public int getPollutionPerTick(ItemStack aStack) { - return super.getPollutionPerTick(aStack) * 8;//x8 + return super.getPollutionPerTick(aStack) * 8; } @Override @@ -170,8 +158,7 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - - + return new String[]{ EnumChatFormatting.BLUE+"Extreme Diesel Engine"+EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + @@ -186,7 +173,6 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die StatCollector.translateToLocal("GT5U.turbine.fuel")+": " +EnumChatFormatting.GOLD+fuelRemaining+EnumChatFormatting.RESET+" L", StatCollector.translateToLocal("GT5U.engine.efficiency")+": " +EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.YELLOW+" %", StatCollector.translateToLocal("GT5U.multiblock.pollution")+": " + EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" - }; } } diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index ef66fcd1d1..7132321048 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -1258,8 +1258,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_DieselEngine.get(1L), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_EV, 'P', ItemList.Electric_Piston_EV, 'E', ItemList.Electric_Motor_EV, 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGt.get(Materials.Titanium)}); GT_ModHandler.addCraftingRecipe(ItemList.Casing_EngineIntake.get(1L), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.Titanium), 'F', ItemList.Casing_StableTitanium, 'P', OrePrefixes.rotor.get(Materials.Titanium)}); - //add recipe here, also # is meta (for controller at least). How do I find the next open #? - ItemList.Machine_Multi_ExtremeDieselEngine.set(new GT_MetaTileEntity_ExtremeDieselEngine(5000, "multimachine.extremedieselengine", "Extreme Combustion Engine").getStackForm(1L)); + ItemList.Machine_Multi_ExtremeDieselEngine.set(new GT_MetaTileEntity_ExtremeDieselEngine(2105, "multimachine.extremedieselengine", "Extreme Combustion Engine").getStackForm(1L)); GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_ExtremeDieselEngine.get(1L), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_IV, 'P', ItemList.Electric_Piston_IV, 'E', ItemList.Electric_Motor_IV, 'C', OrePrefixes.circuit.get(Materials.Master), 'W', OrePrefixes.cableGt01.get(Materials.HSSG), 'G', OrePrefixes.gearGt.get(Materials.TungstenSteel)}); GT_ModHandler.addCraftingRecipe(ItemList.Casing_ExtremeEngineIntake.get(1L), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.TungstenSteel), 'F', ItemList.Casing_RobustTungstenSteel, 'P', OrePrefixes.rotor.get(Materials.TungstenSteel)}); -- cgit From 38c96445dcfdb37e745f035653b9335e1d1555d6 Mon Sep 17 00:00:00 2001 From: Prometheus0000 Date: Sat, 21 Nov 2020 20:51:03 -0500 Subject: Change comments to english (#350) --- .../machines/multi/GT_MetaTileEntity_PyrolyseOven.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 1d9b360338..c2e13a815f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -165,8 +165,8 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock for (int j = -2; j < 3; j++) { for (int h = 0; h < 4; h++) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he - if (h == 0) {// innen boden (Cupronickel oder Kanthal coils) + if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// inner 3x3 without height + if (h == 0) {// inner floor (Cupronickel or Kanthal coils) if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings5) { return false; } @@ -181,7 +181,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return false; } } - } else if (h == 3) {// innen decke (ulv casings + input + muffler) + } else if (h == 3) {// inner ceiling (ulv casings + input + muffler) if ((!addInputToMachineList(tTileEntity, CASING_INDEX)) && (!addMufflerToMachineList(tTileEntity, CASING_INDEX))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; @@ -190,13 +190,13 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return false; } } - } else {// innen air + } else {// inside air if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) { return false; } } - } else {// Aeusserer 5x5 ohne hoehe - if (h == 0) {// aussen boden (controller, output, energy, maintainance, rest ulv casings) + } else {// outer 5x5 without height + if (h == 0) {// outer floor (controller, output, energy, maintainance, rest ulv casings) if ((!addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) && (!addOutputToMachineList(tTileEntity, CASING_INDEX)) && (!addEnergyInputToMachineList(tTileEntity, CASING_INDEX))) { if ((xDir + i != 0) || (zDir + j != 0)) {//no controller if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { @@ -207,7 +207,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock } } } - } else {// au�en �ber boden (ulv casings) + } else {// outer above floor (ulv casings) if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; } -- cgit From 1ea00822d47d9bd706d5c513cbb45163a99bc3e4 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Wed, 25 Nov 2020 18:04:54 +0100 Subject: fix(GT)rename Field Generator Tiers --- .../common/items/GT_MetaGenerated_Item_01.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 57654ec43b..d512e11960 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -663,16 +663,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star", new Object[0])); ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star", new Object[0])); - ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (Tier I)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); - ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (Tier II)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); - ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (Tier III)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); - ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (Tier IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); - ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (Tier V)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); - ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (Tier VI)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); - ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (Tier VII)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); - ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (Tier VIII)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); - ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (Tier IX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); - ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (Tier X)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); + ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (Tier 1-LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); + ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (Tier 2-MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); + ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (Tier 3-HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); + ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (Tier 4-EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); + ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (Tier 5-IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); + ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (Tier 6-LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); + ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (Tier 7-ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); + ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (Tier 8-UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); + ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (Tier 9-UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); + ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (Tier 10-UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)})); ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)})); -- cgit From 865c1397e5db0f88e8a3241873c33d4ae3ccd7de Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Wed, 25 Nov 2020 19:30:15 +0100 Subject: remove the tier --- .../common/items/GT_MetaGenerated_Item_01.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index d512e11960..ad2457b721 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -663,16 +663,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star", new Object[0])); ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star", new Object[0])); - ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (Tier 1-LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); - ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (Tier 2-MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); - ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (Tier 3-HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); - ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (Tier 4-EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); - ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (Tier 5-IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); - ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (Tier 6-LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); - ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (Tier 7-ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); - ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (Tier 8-UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); - ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (Tier 9-UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); - ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (Tier 10-UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); + ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); + ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); + ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); + ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); + ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); + ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); + ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); + ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); + ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); + ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)})); ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)})); -- cgit From 5b1f943957d3ded24f5c0f371f43d6f62f3864f0 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Fri, 27 Nov 2020 01:26:01 +0100 Subject: feat(gregtech): visual programmed circuit (#355) * feat(gregtech): visual programmed circuit Add: Feature a configuration display for the programmed circuit (integrated circuit). Address feature request https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6993 * fix(bug): potential out of bound index --- .../gregtech/common/items/GT_IntegratedCircuit_Item.java | 14 ++++++++++++++ .../gregtech/textures/items/gt.integrated_circuit/0.png | Bin 0 -> 614 bytes .../gregtech/textures/items/gt.integrated_circuit/1.png | Bin 0 -> 602 bytes .../gregtech/textures/items/gt.integrated_circuit/10.png | Bin 0 -> 624 bytes .../gregtech/textures/items/gt.integrated_circuit/11.png | Bin 0 -> 612 bytes .../gregtech/textures/items/gt.integrated_circuit/12.png | Bin 0 -> 626 bytes .../gregtech/textures/items/gt.integrated_circuit/13.png | Bin 0 -> 625 bytes .../gregtech/textures/items/gt.integrated_circuit/14.png | Bin 0 -> 615 bytes .../gregtech/textures/items/gt.integrated_circuit/15.png | Bin 0 -> 622 bytes .../gregtech/textures/items/gt.integrated_circuit/16.png | Bin 0 -> 624 bytes .../gregtech/textures/items/gt.integrated_circuit/17.png | Bin 0 -> 615 bytes .../gregtech/textures/items/gt.integrated_circuit/18.png | Bin 0 -> 625 bytes .../gregtech/textures/items/gt.integrated_circuit/19.png | Bin 0 -> 624 bytes .../gregtech/textures/items/gt.integrated_circuit/2.png | Bin 0 -> 613 bytes .../gregtech/textures/items/gt.integrated_circuit/20.png | Bin 0 -> 623 bytes .../gregtech/textures/items/gt.integrated_circuit/21.png | Bin 0 -> 619 bytes .../gregtech/textures/items/gt.integrated_circuit/22.png | Bin 0 -> 623 bytes .../gregtech/textures/items/gt.integrated_circuit/23.png | Bin 0 -> 620 bytes .../gregtech/textures/items/gt.integrated_circuit/24.png | Bin 0 -> 624 bytes .../gregtech/textures/items/gt.integrated_circuit/3.png | Bin 0 -> 609 bytes .../gregtech/textures/items/gt.integrated_circuit/4.png | Bin 0 -> 610 bytes .../gregtech/textures/items/gt.integrated_circuit/5.png | Bin 0 -> 610 bytes .../gregtech/textures/items/gt.integrated_circuit/6.png | Bin 0 -> 613 bytes .../gregtech/textures/items/gt.integrated_circuit/7.png | Bin 0 -> 602 bytes .../gregtech/textures/items/gt.integrated_circuit/8.png | Bin 0 -> 614 bytes .../gregtech/textures/items/gt.integrated_circuit/9.png | Bin 0 -> 610 bytes 26 files changed, 14 insertions(+) create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 92eb3af4d2..ee69c90be1 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -7,6 +7,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; @@ -15,13 +16,17 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import java.lang.reflect.Array; import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; public class GT_IntegratedCircuit_Item extends GT_Generic_Item { private final static String aTextEmptyRow = " "; + protected IIcon[] mIconDamage = new IIcon[25]; public GT_IntegratedCircuit_Item() { super("integrated_circuit", "Programmed Circuit", ""); setHasSubtypes(true); @@ -93,9 +98,13 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { aList.add(new ItemStack(this, 1, 0)); } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); + for (int i=0; i < mIconDamage.length; i++) { + mIconDamage[i] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); + } if (GregTech_API.sPostloadFinished) { GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); GT_FML_LOGGER.info("GT_Mod: Starting Item Icon Load Phase"); @@ -109,4 +118,9 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase"); } } + + @Override + public IIcon getIconFromDamage(int damage) { + return (damage < mIconDamage.length ? mIconDamage[damage] : mIcon); + } } diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png new file mode 100644 index 0000000000..e35727ec34 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png new file mode 100644 index 0000000000..d2b07c8a6c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png new file mode 100644 index 0000000000..d3648dbd35 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png new file mode 100644 index 0000000000..ccf9f81399 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png new file mode 100644 index 0000000000..3150356e16 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png new file mode 100644 index 0000000000..0f5d3c1ca5 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png new file mode 100644 index 0000000000..8109357533 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png new file mode 100644 index 0000000000..1bc89f80b2 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png new file mode 100644 index 0000000000..4cf2f0d825 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png new file mode 100644 index 0000000000..3ac05fd824 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png new file mode 100644 index 0000000000..b668f379cf Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png new file mode 100644 index 0000000000..d13a9415cd Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png new file mode 100644 index 0000000000..b31f73a4f7 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png new file mode 100644 index 0000000000..5858bc43b8 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png new file mode 100644 index 0000000000..e7d903a404 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png new file mode 100644 index 0000000000..45d56bb2e7 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png new file mode 100644 index 0000000000..5d2a8f638a Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png new file mode 100644 index 0000000000..78f30e2299 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png new file mode 100644 index 0000000000..996887e4ef Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png new file mode 100644 index 0000000000..0ef50ef775 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png new file mode 100644 index 0000000000..2b67a655f5 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png new file mode 100644 index 0000000000..a30a06a13c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png new file mode 100644 index 0000000000..e5dfc35674 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png new file mode 100644 index 0000000000..0ed9386325 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png new file mode 100644 index 0000000000..97398ff800 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png differ -- cgit From a2fedcfca3d60025533363a9ba776971f0a4bc9e Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Fri, 27 Nov 2020 04:27:24 +0100 Subject: minor fix on getIconFromDamage check damage >0 (#356) * fix(getIconFromDamage): add check damage >0 --- src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index ee69c90be1..7217d6e51e 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -121,6 +121,6 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { @Override public IIcon getIconFromDamage(int damage) { - return (damage < mIconDamage.length ? mIconDamage[damage] : mIcon); + return (damage > 0 && damage < mIconDamage.length ? mIconDamage[damage] : mIcon); } } -- cgit From 40825d1c13494be652d48ccf6f3ea7c489ee9042 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Sat, 28 Nov 2020 23:42:48 +0100 Subject: add caching to boxinator + other optimazation --- .../basic/GT_MetaTileEntity_Boxinator.java | 51 ++++++++++++++++++---- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 938c2d6900..f883968e35 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -14,6 +14,10 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine { + ItemStack aInputCache; + ItemStack aOutputCache; + int aTypeCache = 0; + public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)}); } @@ -34,28 +38,54 @@ public class GT_MetaTileEntity_Boxinator return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } + private boolean hasValidCache(ItemStack mItem,int mType) { + if (aInputCache != null + && aOutputCache != null + && aTypeCache == mType + && aInputCache.isItemEqual(mItem) + && ItemStack.areItemStackTagsEqual(mItem,aInputCache)) + return true; + // clear cache if it was invalid + aInputCache = null; + aOutputCache = null; + aTypeCache = 0; + return false; + } + + private void cacheItem(ItemStack mInputItem,ItemStack mOutputItem,int mType) { + aTypeCache = mType; + aOutputCache = mOutputItem.copy(); + aInputCache = mInputItem.copy(); + } + public int checkRecipe() { int tCheck = super.checkRecipe(); if (tCheck != DID_NOT_FIND_RECIPE) { return tCheck; } - if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null)) { - if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0)}); + ItemStack tSlot0 = getInputAt(0); + ItemStack tSlot1 = getInputAt(1); + if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) { + if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { + boolean tIsCached = hasValidCache(tSlot0,1); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { - getInputAt(0).stackSize -= 1; + tSlot0.stackSize -= 1; calculateOverclockedNess(32,16); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],1); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } - if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0)}); + if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { + boolean tIsCached = hasValidCache(tSlot0,2); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, null, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { getInputAt(0).stackSize -= 4; @@ -63,13 +93,16 @@ public class GT_MetaTileEntity_Boxinator //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],2); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } - if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0)}); + if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { + boolean tIsCached = hasValidCache(tSlot0,3); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { getInputAt(0).stackSize -= 9; @@ -77,6 +110,8 @@ public class GT_MetaTileEntity_Boxinator //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],3); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } -- cgit From f135c8b48b11fcfc92bc985aca43c62a687a77e2 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Sun, 29 Nov 2020 01:38:47 +0100 Subject: fix(itegrated_circuit): starts at 0 --- src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 7217d6e51e..2d470f027d 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -18,7 +18,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.lang.reflect.Array; import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; @@ -121,6 +120,6 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { @Override public IIcon getIconFromDamage(int damage) { - return (damage > 0 && damage < mIconDamage.length ? mIconDamage[damage] : mIcon); + return (damage >= 0 && damage < mIconDamage.length ? mIconDamage[damage] : mIcon); } } -- cgit From 17264dc7d11c23071f3a7b2cb361a35330740de2 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Sun, 29 Nov 2020 22:46:39 +0100 Subject: fix over filling quantumchest --- .../tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 6d97d9011d..257fa10bfa 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -91,7 +91,11 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti ItemStack stack = getItemStack(); if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (count <= getMaxItemCount() || mVoidOverflow ) { + if (mVoidOverflow) { + mInventory[0] = null; + count = getMaxItemCount(); + } + else if (count <= getMaxItemCount()) { mInventory[0] = null; } else { mInventory[0].stackSize = (count - getMaxItemCount()); -- cgit From 4f4059914a8f00ae984b812cf34bc16ff71dbd79 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Mon, 30 Nov 2020 00:34:37 +0100 Subject: fix(integrated_circuit): mask comparison mode bits from damage (#359) --- src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 2d470f027d..710dc0bf8f 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -120,6 +120,7 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { @Override public IIcon getIconFromDamage(int damage) { - return (damage >= 0 && damage < mIconDamage.length ? mIconDamage[damage] : mIcon); + byte circuitMode = ((byte) (damage & 0xFF)); // Mask out the MSB Comparison Mode Bits. See: getModeString + return mIconDamage[circuitMode < mIconDamage.length ? circuitMode : 0]; } } -- cgit From fa11fa346c5e0bfa192558249acd417c6661a4f6 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Mon, 30 Nov 2020 20:15:34 +0100 Subject: ony set to max if it has to much --- .../storage/GT_MetaTileEntity_DigitalChestBase.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 257fa10bfa..606733658b 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -91,14 +91,15 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti ItemStack stack = getItemStack(); if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (mVoidOverflow) { - mInventory[0] = null; - count = getMaxItemCount(); - } - else if (count <= getMaxItemCount()) { + + if (count <= getMaxItemCount()) { mInventory[0] = null; } else { - mInventory[0].stackSize = (count - getMaxItemCount()); + if (mVoidOverflow) { + mInventory[0] = null; + } else { + mInventory[0].stackSize = (count - getMaxItemCount()); + } count = getMaxItemCount(); } } -- cgit From 28eaa261e316518d83460b94c7b3678ac00acf7e Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 4 Dec 2020 00:06:25 +0300 Subject: Non-GT ores support for the seismic prospector (GT++, BW(?)) --- .../basic/GT_MetaTileEntity_AdvSeismicProspector.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 46ea555ad0..28f661c339 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -216,12 +216,13 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } } else { int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(x, y, z); - ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) - return tAssotiation.mMaterial.mMaterial.mDefaultLocalName; + ItemStack is = new ItemStack(tBlock, 1, tMetaID); + ItemData association = GT_OreDictUnificator.getAssociation(is); + if ((association != null) && (association.mPrefix.toString().startsWith("ore"))) + return association.mMaterial.mMaterial.mDefaultLocalName; + else if (GT_Utility.isOre(is)) + return tBlock.getLocalizedName(); } - return null; } -- cgit From c681266385d0516b0683716358fa6fb19b148991 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Mon, 7 Dec 2020 02:41:56 +0300 Subject: Drilling plant uses absolute coordinates where single block uses relative --- build.properties | 2 +- .../machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/build.properties b/build.properties index fdeac78135..c5aaaee51d 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.33.58 +gt.version=5.09.33.59 ae2.version=rv3-beta-22 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 2e367e63e8..e34ed7466f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -324,7 +324,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile ChunkPosition blockPos = new ChunkPosition(x, y, z); if (!oreBlockPositions.contains(blockPos)) { if (block instanceof GT_Block_Ores_Abstract) { - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z); + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z); if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) oreBlockPositions.add(blockPos); } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) -- cgit From c4178e75b713cb064c6a8787e76c69f5b357b4e7 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Mon, 7 Dec 2020 05:05:49 +0100 Subject: add simple allowPutStack cache --- .../basic/GT_MetaTileEntity_Boxinator.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index f883968e35..6895310b46 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; @@ -38,7 +39,7 @@ public class GT_MetaTileEntity_Boxinator return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } - private boolean hasValidCache(ItemStack mItem,int mType) { + private boolean hasValidCache(ItemStack mItem,int mType,boolean mClearOnFailure) { if (aInputCache != null && aOutputCache != null && aTypeCache == mType @@ -46,9 +47,11 @@ public class GT_MetaTileEntity_Boxinator && ItemStack.areItemStackTagsEqual(mItem,aInputCache)) return true; // clear cache if it was invalid - aInputCache = null; - aOutputCache = null; - aTypeCache = 0; + if (mClearOnFailure) { + aInputCache = null; + aOutputCache = null; + aTypeCache = 0; + } return false; } @@ -67,7 +70,7 @@ public class GT_MetaTileEntity_Boxinator ItemStack tSlot1 = getInputAt(1); if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) { if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { - boolean tIsCached = hasValidCache(tSlot0,1); + boolean tIsCached = hasValidCache(tSlot0,1,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -84,7 +87,7 @@ public class GT_MetaTileEntity_Boxinator return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { - boolean tIsCached = hasValidCache(tSlot0,2); + boolean tIsCached = hasValidCache(tSlot0,2,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, null, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -101,7 +104,7 @@ public class GT_MetaTileEntity_Boxinator return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { - boolean tIsCached = hasValidCache(tSlot0,3); + boolean tIsCached = hasValidCache(tSlot0,3,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -123,8 +126,11 @@ public class GT_MetaTileEntity_Boxinator public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) { - if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), getInputAt(1)}) != null) { + ItemStack tInput1 = getInputAt(1); + if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { + if (hasValidCache(aStack,aTypeCache,false)) + return true; + if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), tInput1}) != null) { return true; } if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null) -- cgit From f12aaa607ca30ff0ca36ff27ecb1cd6572a3f062 Mon Sep 17 00:00:00 2001 From: Ethryan Date: Mon, 7 Dec 2020 12:15:58 +0100 Subject: Fix Hermetic Casing Name [#7062](https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/7062) --- src/main/java/gregtech/common/blocks/GT_Block_Casings6.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java index 2cba79d6e3..d7e8ad23f0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java @@ -26,7 +26,7 @@ public class GT_Block_Casings6 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Hermetic Casing V"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Hermetic Casing VI"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Hermetic Casing VII"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hermetic Casing VII"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hermetic Casing VIII"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Hermetic Casing IX"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Hermetic Casing X"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Hermetic Casing XI"); -- cgit From 438dd05bb8afb55ae4ba76484ecc84e9e2819a76 Mon Sep 17 00:00:00 2001 From: Prometheus0000000 Date: Wed, 9 Dec 2020 22:31:37 -0500 Subject: Update ECE TT --- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 48 ++++++++++++++-------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index 0daaf9cb51..363d689c84 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.machines.multi; +import org.lwjgl.input.Keyboard; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -10,6 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; @@ -29,23 +32,34 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public String[] getDescription() { - return new String[]{//change to new format after it's approved - "Controller Block for the Extreme Combustion Engine", - "Size(WxHxD): 3x3x4, Controller (front centered)", - "3x3x4 of Robust Tungstensteel Machine Casing (hollow, Min 16!)", - "2x Titanium Gear Box Machine Casing inside the Hollow Casing", - "8x Extreme Engine Intake Casing (around controller)", - "2x Input Hatch (HOG/Lubricant) (one of the Casings next to a Gear Box)", - "1x Input Hatch (Optional, for Liquid Oxygen) (one of the Casings next to a Gear Box)", - "1x Maintenance Hatch (one of the Casings next to a Gear Box)", - "1x Muffler Hatch (top middle back, above the rear Gear Box)", - "1x Dynamo Hatch (back centered)", - "Engine Intake Casings must not be obstructed in front (only air blocks)", - "Supply High Octane Gasoline and 8000L of Lubricant per hour to run.", - "Supply 320L of Liquid Oxygen per second to boost output (optional).", - "Default: Produces 8192EU/t at 100% efficiency", - "Boosted: Produces 32768EU/t at 400% efficiency", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Combustion Generator") + .addInfo("Controller block for the Extreme Combustion Engine") + .addInfo("Supply High Octane Gasoline and 8000L of Lubricant per hour to run") + .addInfo("Supply 320L/s of Liquid Oxygen to boost output (optional)") + .addInfo("Default: Produces 8192EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 32768EU/t at 400% fuel efficiency") + .addInfo("You need to wait for it to reach 400% to output full power") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 16) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center") + .addMaintenanceHatch("One of the casings next to a Gear Box") + .addMufflerHatch("Top middle back, above the rear Gear Box") + .addInputHatch("HOG, next to a Gear Box") + .addInputHatch("Lubricant, next to a Gear Box") + .addInputHatch("Liquid Oxygen, optional, next to a Gear Box") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override -- cgit From b3789aebb681711a91ec51cdd390a47dc36282dd Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Fri, 4 Dec 2020 16:40:24 +0100 Subject: fix(rendering): UV Mapping on tiles - Fix all faces use the same UV mapping and orientation to be same as standard vanilla full blocks Vanilla blocks's face rendering. - Fix the orientation of bottom-face's arrow overlay with fixed UV of the `GT_MetaTileEntity_Buffer` type machines (filters, buffers, regulators) - Fix UV mapping of item pipes restrictor overlay - Fix UV mapping of fluid pipes blocked input overlay orientation on all sides - Fix UV mappiong of thick covers - Remove the now useless and broken custom UVMapped vertices at the bottom face. ![](https://i.imgur.com/MImsbQY.png) --- .../implementations/GT_MetaPipeEntity_Fluid.java | 2 +- .../implementations/GT_MetaTileEntity_Buffer.java | 133 ++++++++++++--------- .../gregtech/api/objects/GT_RenderedTexture.java | 77 +++++------- .../java/gregtech/api/objects/GT_SidedTexture.java | 98 +++++---------- .../gregtech/common/render/GT_Renderer_Block.java | 58 ++++----- 5 files changed, 160 insertions(+), 208 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index 8a28301fdf..2afc996df2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -111,7 +111,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (aSide >= 0 && aSide < 6) { for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i; //Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate - if (tThickNess >= 0.99F && (aSide == 5 || aSide == 2)) + if (aSide == 5 || aSide == 2 || aSide == 0) if (tMask > 3 && tMask < 12) tMask = (byte) (tMask ^ 12); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 7284cd3c01..8758ea1a02 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -8,10 +8,18 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import static gregtech.api.enums.GT_Values.V; public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock { + private static final int OUTPUT_INDEX = 0; + private static final int ARROW_RIGHT_INDEX = 1; + private static final int ARROW_DOWN_INDEX = 2; + private static final int ARROW_LEFT_INDEX = 3; + private static final int ARROW_UP_INDEX = 4; + private static final int FRONT_INDEX = 5; + public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = false; public int mSuccess = 0, mTargetStackSize = 0; @@ -33,74 +41,85 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[6][17][]; - ITexture tIcon = getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT), tUp = new GT_RenderedTexture(Textures.BlockIcons.ARROW_UP), tDown = new GT_RenderedTexture(Textures.BlockIcons.ARROW_DOWN), tLeft = new GT_RenderedTexture(Textures.BlockIcons.ARROW_LEFT), tRight = new GT_RenderedTexture(Textures.BlockIcons.ARROW_RIGHT); - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tOut}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tRight, tIcon}; - rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tDown, tIcon}; - rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tLeft, tIcon}; - rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tUp, tIcon}; - rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; + ITexture[][][] rTextures = new ITexture[ForgeDirection.VALID_DIRECTIONS.length][17][]; + ITexture tIcon = getOverlayIcon(); + ITexture tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT); + ITexture tUp = new GT_RenderedTexture(Textures.BlockIcons.ARROW_UP); + ITexture tDown = new GT_RenderedTexture(Textures.BlockIcons.ARROW_DOWN); + ITexture tLeft = new GT_RenderedTexture(Textures.BlockIcons.ARROW_LEFT); + ITexture tRight = new GT_RenderedTexture(Textures.BlockIcons.ARROW_RIGHT); + for (int i = 0; i < rTextures[0].length; i++) { + rTextures[OUTPUT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tOut}; + rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tRight, tIcon}; + rTextures[ARROW_DOWN_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tDown, tIcon}; + rTextures[ARROW_LEFT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tLeft, tIcon}; + rTextures[ARROW_UP_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tUp, tIcon}; + rTextures[FRONT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tIcon}; } return rTextures; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) return mTextures[5][aColorIndex + 1]; - if (GT_Utility.getOppositeSide(aSide) == aFacing) return mTextures[0][aColorIndex + 1]; - switch (aFacing) { - case 0: - return mTextures[4][aColorIndex + 1]; - case 1: - return mTextures[2][aColorIndex + 1]; - case 2: - switch (aSide) { - case 0: - return mTextures[2][aColorIndex + 1]; - case 1: - return mTextures[2][aColorIndex + 1]; - case 4: - return mTextures[1][aColorIndex + 1]; - case 5: - return mTextures[3][aColorIndex + 1]; + int colorIndex = aColorIndex + 1; + ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[aSide]; + ForgeDirection facing = ForgeDirection.VALID_DIRECTIONS[aFacing]; + if (side == facing) return mTextures[FRONT_INDEX][colorIndex]; + if (ForgeDirection.OPPOSITES[aSide] == aFacing) return mTextures[OUTPUT_INDEX][colorIndex]; + switch (facing) { + case DOWN: + return mTextures[ARROW_UP_INDEX][colorIndex]; // ARROW_UP + case UP: + return mTextures[ARROW_DOWN_INDEX][colorIndex]; // ARROW_DOWN + case NORTH: + switch (side) { + case DOWN: + case UP: + return mTextures[ARROW_DOWN_INDEX][colorIndex]; // ARROW_DOWN + case WEST: + return mTextures[ARROW_RIGHT_INDEX][colorIndex]; // ARROW_RIGHT + case EAST: + return mTextures[ARROW_LEFT_INDEX][colorIndex]; // ARROW_LEFT + default: } - case 3: - switch (aSide) { - case 0: - return mTextures[4][aColorIndex + 1]; - case 1: - return mTextures[4][aColorIndex + 1]; - case 4: - return mTextures[3][aColorIndex + 1]; - case 5: - return mTextures[1][aColorIndex + 1]; + break; + case SOUTH: + switch (side) { + case DOWN: + case UP: + return mTextures[ARROW_UP_INDEX][colorIndex]; // ARROW_UP + case WEST: + return mTextures[ARROW_LEFT_INDEX][colorIndex]; // ARROW_LEFT + case EAST: + return mTextures[ARROW_RIGHT_INDEX][colorIndex]; // ARROW_RIGHT + default: } - case 4: - switch (aSide) { - case 0: - return mTextures[3][aColorIndex + 1]; - case 1: - return mTextures[1][aColorIndex + 1]; - case 2: - return mTextures[3][aColorIndex + 1]; - case 3: - return mTextures[1][aColorIndex + 1]; + break; + case WEST: + switch (side) { + case DOWN: + case UP: + case SOUTH: + return mTextures[ARROW_RIGHT_INDEX][colorIndex]; // ARROW_RIGHT + case NORTH: + return mTextures[ARROW_LEFT_INDEX][colorIndex]; // ARROW_LEFT + default: } - case 5: - switch (aSide) { - case 0: - return mTextures[1][aColorIndex + 1]; - case 1: - return mTextures[3][aColorIndex + 1]; - case 2: - return mTextures[1][aColorIndex + 1]; - case 3: - return mTextures[3][aColorIndex + 1]; + break; + case EAST: + switch (side) { + case DOWN: + case UP: + case SOUTH: + return mTextures[ARROW_LEFT_INDEX][colorIndex]; // ARROW_LEFT + case NORTH: + return mTextures[ARROW_RIGHT_INDEX][colorIndex]; // ARROW_RIGHT + default: } + break; + default: } - return mTextures[5][aColorIndex + 1]; + return mTextures[FRONT_INDEX][colorIndex]; } @Override diff --git a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java index 70b71cf125..074cabf341 100644 --- a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java +++ b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java @@ -37,94 +37,77 @@ public class GT_RenderedTexture implements ITexture, IColorModulationContainer { @Override public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(153, 153, 153, 255); + tesselator.setColorRGBA(153, 153, 153, 255); aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } + aRenderer.field_152631_f = false; } + @Override public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(153, 153, 153, 255); + tesselator.setColorRGBA(153, 153, 153, 255); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } } @Override public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(255, 255, 255, 255); + tesselator.setColorRGBA(255, 255, 255, 255); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } } @Override public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255); - IIcon aIcon = mIconContainer.getIcon(); - - float d_16 = 16.0F; - float d3 = (float)aIcon.getInterpolatedU(aRenderer.renderMaxX * d_16); - float d4 = (float)aIcon.getInterpolatedU(aRenderer.renderMinX * d_16); - float d5 = (float)aIcon.getInterpolatedV(aRenderer.renderMinZ * d_16); - float d6 = (float)aIcon.getInterpolatedV(aRenderer.renderMaxZ * d_16); - - if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { - d3 = aIcon.getMaxU(); - d4 = aIcon.getMinU(); - } - - if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { - d5 = aIcon.getMinV(); - d6 = aIcon.getMaxV(); - } - - float d11 = aX + (float)aRenderer.renderMinX; - float d12 = aX + (float)aRenderer.renderMaxX; - float d13 = aY + (float)aRenderer.renderMinY; - float d14 = aZ + (float)aRenderer.renderMinZ; - float d15 = aZ + (float)aRenderer.renderMaxZ; - - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d15, (double)d3, (double)d6); - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d14, (double)d3, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d14, (double)d4, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d15, (double)d4, (double)d6); - - if ((aIcon = mIconContainer.getOverlayIcon()) != null) { - Tessellator.instance.setColorRGBA(128, 128, 128, 255); - - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d15, (double)d3, (double)d6); - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d14, (double)d3, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d14, (double)d4, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d15, (double)d4, (double)d6); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; + aRenderer.flipTexture = true; + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + tesselator.setColorRGBA(128, 128, 128, 255); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } + aRenderer.field_152631_f = false; + aRenderer.flipTexture = false; } @Override public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(204, 204, 204, 255); + tesselator.setColorRGBA(204, 204, 204, 255); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } } @Override public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tesselator = Tessellator.instance; + tesselator.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(204, 204, 204, 255); + tesselator.setColorRGBA(204, 204, 204, 255); aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); } + aRenderer.field_152631_f = false; } @Override diff --git a/src/main/java/gregtech/api/objects/GT_SidedTexture.java b/src/main/java/gregtech/api/objects/GT_SidedTexture.java index 2b4f144393..ab88225781 100644 --- a/src/main/java/gregtech/api/objects/GT_SidedTexture.java +++ b/src/main/java/gregtech/api/objects/GT_SidedTexture.java @@ -7,7 +7,6 @@ import gregtech.api.interfaces.ITexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; public class GT_SidedTexture implements ITexture, IColorModulationContainer { private final IIconContainer[] mIconContainer; @@ -45,115 +44,76 @@ public class GT_SidedTexture implements ITexture, IColorModulationContainer { @Override public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer[5].getIcon()); if (mIconContainer[5].getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(153, 153, 153, 255); + tessellator.setColorRGBA(153, 153, 153, 255); aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer[5].getOverlayIcon()); } + aRenderer.field_152631_f = false; } @Override public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer[4].getIcon()); if (mIconContainer[4].getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(153, 153, 153, 255); + tessellator.setColorRGBA(153, 153, 153, 255); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer[4].getOverlayIcon()); } } @Override public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer[1].getIcon()); if (mIconContainer[1].getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(255, 255, 255, 255); + tessellator.setColorRGBA(255, 255, 255, 255); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer[1].getOverlayIcon()); } } @Override public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255); - IIcon aIcon = mIconContainer[0].getIcon(); - - float d_16 = 16.0F; - float d3 = (float)aIcon.getInterpolatedU(aRenderer.renderMaxX * d_16); - float d4 = (float)aIcon.getInterpolatedU(aRenderer.renderMinX * d_16); - float d5 = (float)aIcon.getInterpolatedV(aRenderer.renderMinZ * d_16); - float d6 = (float)aIcon.getInterpolatedV(aRenderer.renderMaxZ * d_16); - - if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { - d3 = aIcon.getMaxU(); - d4 = aIcon.getMinU(); - } - - if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { - d5 = aIcon.getMinV(); - d6 = aIcon.getMaxV(); - } - - float d11 = aX + (float)aRenderer.renderMinX; - float d12 = aX + (float)aRenderer.renderMaxX; - float d13 = aY + (float)aRenderer.renderMinY; - float d14 = aZ + (float)aRenderer.renderMinZ; - float d15 = aZ + (float)aRenderer.renderMaxZ; - - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d15, (double)d3, (double)d6); - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d14, (double)d3, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d14, (double)d4, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d15, (double)d4, (double)d6); - - if ((aIcon = mIconContainer[0].getOverlayIcon()) != null) { - Tessellator.instance.setColorRGBA(128, 128, 128, 255); - - d3 = (float)aIcon.getInterpolatedU(aRenderer.renderMaxX * d_16); - d4 = (float)aIcon.getInterpolatedU(aRenderer.renderMinX * d_16); - d5 = (float)aIcon.getInterpolatedV(aRenderer.renderMinZ * d_16); - d6 = (float)aIcon.getInterpolatedV(aRenderer.renderMaxZ * d_16); - - if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { - d3 = aIcon.getMaxU(); - d4 = aIcon.getMinU(); - } - - if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { - d5 = aIcon.getMinV(); - d6 = aIcon.getMaxV(); - } - - d11 = aX + (float)aRenderer.renderMinX; - d12 = aX + (float)aRenderer.renderMaxX; - d13 = aY + (float)aRenderer.renderMinY; - d14 = aZ + (float)aRenderer.renderMinZ; - d15 = aZ + (float)aRenderer.renderMaxZ; - - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d15, (double)d3, (double)d6); - Tessellator.instance.addVertexWithUV((double)d11, (double)d13, (double)d14, (double)d3, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d14, (double)d4, (double)d5); - Tessellator.instance.addVertexWithUV((double)d12, (double)d13, (double)d15, (double)d4, (double)d6); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; + aRenderer.flipTexture = true; + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer[1].getIcon()); + if (mIconContainer[0].getOverlayIcon() != null) { + tessellator.setColorRGBA(128, 128, 128, 255); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer[1].getOverlayIcon()); } + aRenderer.field_152631_f = false; + aRenderer.flipTexture = false; } @Override public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer[3].getIcon()); if (mIconContainer[3].getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(204, 204, 204, 255); + tessellator.setColorRGBA(204, 204, 204, 255); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer[3].getOverlayIcon()); } } @Override public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { - Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + final Tessellator tessellator = Tessellator.instance; + tessellator.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + aRenderer.field_152631_f = true; aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer[2].getIcon()); if (mIconContainer[2].getOverlayIcon() != null) { - Tessellator.instance.setColorRGBA(204, 204, 204, 255); + tessellator.setColorRGBA(204, 204, 204, 255); aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer[2].getOverlayIcon()); } + aRenderer.field_152631_f = false; } @Override diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java index 795e93f582..5ee32f8dc6 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java @@ -154,7 +154,7 @@ public class GT_Renderer_Block } boolean[] tIsCovered = new boolean[6]; for (byte i = 0; i < 6; i = (byte) (i + 1)) { - tIsCovered[i] = (aTileEntity.getCoverIDAtSide(i) != 0 ? true : false); + tIsCovered[i] = (aTileEntity.getCoverIDAtSide(i) != 0); } if ((tIsCovered[0]) && (tIsCovered[1]) && (tIsCovered[2]) && (tIsCovered[3]) && (tIsCovered[4]) && (tIsCovered[5])) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); @@ -420,20 +420,17 @@ public class GT_Renderer_Block } public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { - if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) { - return; - } - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); - } + if (aWorld == null) return; + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) return; + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { @@ -444,13 +441,12 @@ public class GT_Renderer_Block Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); } if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { @@ -460,15 +456,13 @@ public class GT_Renderer_Block } Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); } - aRenderer.flipTexture = (!aFullBlock); if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { @@ -479,13 +473,12 @@ public class GT_Renderer_Block Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); } if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { @@ -496,13 +489,12 @@ public class GT_Renderer_Block Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); } if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { @@ -512,15 +504,13 @@ public class GT_Renderer_Block } Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); } - aRenderer.flipTexture = (!aFullBlock); if (aIcon != null) { - for (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ); + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); } } } - aRenderer.flipTexture = false; } public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) { @@ -579,7 +569,7 @@ public class GT_Renderer_Block if (aTileEntity == null) { return false; } - if (((aTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null) && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity().renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer))) { + if (aTileEntity instanceof IGregTechTileEntity && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null) && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity().renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer))) { return true; } if ((aTileEntity instanceof IPipeRenderedTileEntity)) { -- cgit