aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java14
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java29
-rw-r--r--src/main/resources/assets/gregtech/lang/en_US.lang2
-rw-r--r--src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.pngbin20955 -> 20641 bytes
5 files changed, 27 insertions, 22 deletions
diff --git a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
index 45d455ff03..5160b6b0f0 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
@@ -37,7 +37,6 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
int mSpeed = 0; // scale 0 - 8
boolean mLockedSpeed = true;
- boolean retrievePollen;
ArrayList<String> mErrorStates = new ArrayList<>(50);
@@ -49,7 +48,6 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
public void addSlots(InventoryPlayer aInventoryPlayer) {
addSlotToContainer(slotItemTransferToggle = new GT_Slot_Holo(mTileEntity, 0, 8, 63, false, true, 1));
addSlotToContainer(slotSpeedToggle = new GT_Slot_Holo(mTileEntity, 0, 26, 63, false, true, 1));
- addSlotToContainer(slotPollenToggle = new GT_Slot_Holo(mTileEntity, 0, 8, 45, false, true, 1));
addSlotToContainer(slotCancelProcess = new GT_Slot_Holo(mTileEntity, 0, 8, 27, false, true, 1));
int tStartIndex = 5;
@@ -101,9 +99,6 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
}
return null;
case 2:
- machine.retreviePollen = !machine.retreviePollen;
- return null;
- case 3:
machine.cancelProcess();
detectAndSendChanges();
return null;
@@ -150,7 +145,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
@Override
public int getSlotStartIndex() {
- return 4;
+ return 3;
}
@Override
@@ -173,7 +168,6 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
this.mSpeed = getMachine().mSpeed;
this.mItemTransfer = getMachine().mItemTransfer;
this.mStuttering = getMachine().mStuttering;
- this.retrievePollen = getMachine().retreviePollen;
this.mLockedSpeed = getMachine().mLockedSpeed;
for (Object crafter : this.crafters) {
@@ -184,8 +178,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
for(IErrorState s : getMachine().mErrorStates)
var1.sendProgressBarUpdate(this, 103, s.getID());
var1.sendProgressBarUpdate(this, 104, this.mStuttering ? 1 : 0);
- var1.sendProgressBarUpdate(this, 105, this.retrievePollen ? 1 : 0);
- var1.sendProgressBarUpdate(this, 106, this.mLockedSpeed ? 1 : 0);
+ var1.sendProgressBarUpdate(this, 105, this.mLockedSpeed ? 1 : 0);
}
}
@@ -210,9 +203,6 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
this.mStuttering = par2 == 1;
break;
case 105:
- this.retrievePollen = par2 == 1;
- break;
- case 106:
this.mLockedSpeed = par2 == 1;
break;
}
diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java
index f901a78599..c810704403 100644
--- a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java
+++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java
@@ -25,7 +25,6 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma
STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip",
ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip",
POWER_SOURCE_POWER = "GT5U.machines.powersource.power",
- RETRIEVE_POLLEN_TOOLTIP = "GT5U.machines.industrialapiary.pollen.tooltip",
CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip",
SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip",
SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip",
@@ -57,7 +56,6 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma
mErrorStatesTooltip.enabled = false;
addToolTip(mInfoTooltip = new GT_GuiTooltip(new Rectangle(this.guiLeft + 163, guiTop + 5, 6, 17)));
- addToolTip(new GT_GuiSlotTooltip(getContainer().slotPollenToggle, mTooltipCache.getData(RETRIEVE_POLLEN_TOOLTIP)));
addToolTip(new GT_GuiSlotTooltip(getContainer().slotCancelProcess, mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP)));
@@ -129,8 +127,6 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma
if (this.mContainer != null) {
if (getContainer().mItemTransfer)
drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
- if(getContainer().retrievePollen)
- drawTexturedModalRect(x + 7, y + 44, 194, 18, 18, 18);
if(getContainer().mMaxProgressTime > 0) {
double p = (double) getContainer().mProgressTime / getContainer().mMaxProgressTime;
drawTexturedModalRect(x+70, y+3, 176, 0, (int)(p*20), 18);
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java
index 7562946e51..0ec52f2ee2 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java
@@ -41,6 +41,7 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.util.*;
+import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
@@ -55,7 +56,6 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
public int mSpeed = 0;
public boolean mLockedSpeed = true;
- public boolean retreviePollen = false;
private ItemStack usedQueen = null;
private IBee usedQueenBee = null;
@@ -118,7 +118,6 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
super.saveNBTData(aNBT);
aNBT.setInteger("mSpeed", mSpeed);
aNBT.setBoolean("mLockedSpeed", mLockedSpeed);
- aNBT.setBoolean("retrievePolen", retreviePollen);
if(usedQueen != null)
aNBT.setTag("usedQueen", usedQueen.writeToNBT(new NBTTagCompound()));
}
@@ -128,11 +127,13 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
super.loadNBTData(aNBT);
mSpeed = aNBT.getInteger("mSpeed");
mLockedSpeed = aNBT.getBoolean("mLockedSpeed");
- retreviePollen = aNBT.getBoolean("retrievePolen");
if(aNBT.hasKey("usedQueen"))
usedQueen = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("usedQueen"));
}
+ boolean retrievingPollenInThisOperation = false;
+ IIndividual retrievedpollen = null;
+
@Override
public int checkRecipe() {
updateModifiers();
@@ -160,7 +161,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
HashMap<GT_Utility.ItemId, ItemStack> pollen = new HashMap<>();
- if(retreviePollen) {
+ if(isRetrievingPollen && floweringMod > 0f) {
int icycles = (int)cycles + (getWorld().rand.nextFloat() < (cycles - (float)((int)cycles)) ? 1 : 0);
for(int z = 0; z < icycles; z++) {
IIndividual p = bee.retrievePollen(this);
@@ -176,6 +177,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
}
}
+ retrievedpollen = null;
+ retrievingPollenInThisOperation = isRetrievingPollen;
+
IBeeGenome genome = bee.getGenome();
IAlleleBeeSpecies primary = genome.getPrimary();
IAlleleBeeSpecies secondary = genome.getSecondary();
@@ -317,6 +321,11 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
}
@Override
+ protected boolean hasEnoughEnergyToCheckRecipe() {
+ return getBaseMetaTileEntity().isUniversalEnergyStored(V[mSpeed] * 8L);
+ }
+
+ @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isClientSide()) {
if(GT_Client.changeDetected == 4) {
@@ -338,6 +347,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
}
if(aBaseMetaTileEntity.isServerSide()){
+ mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
+ mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+
doDisplayThings();
if(!aBaseMetaTileEntity.isActive())
@@ -386,6 +398,13 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
if(usedQueenBee == null)
usedQueenBee = beeRoot.getMember(usedQueen);
effectData = usedQueenBee.doEffect(effectData, this);
+ if(!retrievingPollenInThisOperation && floweringMod > 0f)
+ {
+ if(retrievedpollen == null)
+ retrievedpollen = usedQueenBee.retrievePollen(this);
+ if(usedQueenBee.pollinateRandom(this, retrievedpollen) || this.mProgresstime % 100 == 0)
+ retrievedpollen = null;
+ }
}
if(this.mProgresstime % 100 == 0)
@@ -749,6 +768,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
private float humidityMod = 0f;
private float temperatureMod = 0f;
private boolean isAutomated = false;
+ private boolean isRetrievingPollen = false;
private int maxspeed = 0;
@@ -791,6 +811,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
humidityMod = mods.humidity;
temperatureMod = mods.temperature;
isAutomated = mods.isAutomated;
+ isRetrievingPollen = mods.isCollectingPollen;
if(mLockedSpeed)
mSpeed = maxspeed;
diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang
index 1e4caa00f6..282552b5ef 100644
--- a/src/main/resources/assets/gregtech/lang/en_US.lang
+++ b/src/main/resources/assets/gregtech/lang/en_US.lang
@@ -134,8 +134,6 @@ GT5U.machines.stalled_vent.tooltip.extended=§7Progress was lost, but not
GT5U.machines.stalled_vent.tooltip.extended.1=§7the recipe's output.
GT5U.machines.oreprocessor=§eRunning Mode: %s §cTime: %s s
GT5U.machines.oreprocessor.void=§eVoid Stone Dust: %s
-GT5U.machines.industrialapiary.pollen.tooltip=Retrevie Pollen
-GT5U.machines.industrialapiary.pollen.tooltip.1=§cWARNING: INCREASES LAG
GT5U.machines.industrialapiary.cancel.tooltip=§cCancel process
GT5U.machines.industrialapiary.cancel.tooltip.1=§7Will also disable machine (soft mallet)
GT5U.machines.industrialapiary.cancel.tooltip.2=§7§oCan't stop princess breeding
diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png
index 261f569cd7..79cfb61e1b 100644
--- a/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png
+++ b/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png
Binary files differ