Skip to content

Commit b7e3d40

Browse files
committed
fix
1 parent 9bcce4f commit b7e3d40

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/main/java/com/github/gtexpert/gtbm/integration/gendustry/metatileentities/MetaTileEntityIndustrialApiary.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
public class MetaTileEntityIndustrialApiary extends GTBMSimpleMachineMetaTileEntity
4848
implements IBeeHousing, IBeeHousingInventory {
4949

50-
private static final int UPGRADE_SLOT_COUNT = 4;
50+
private static final int UPGRADE_SLOTS_BASE = 4;
51+
private static final int UPGRADE_SLOTS_EXTENDED = 8;
5152
private static final int OUTPUT_SLOT_COUNT = 9;
5253

5354
private final ApiaryModifiers modifiers = new ApiaryModifiers();
@@ -79,7 +80,7 @@ public boolean onPollenRetrieved(IIndividual pollen) {
7980
};
8081
private IItemHandlerModifiable upgradeInventory;
8182
private GameProfile owner;
82-
private boolean autoBreeding = true;
83+
private boolean autoBreeding = false;
8384

8485
public MetaTileEntityIndustrialApiary(ResourceLocation metaTileEntityId, RecipeMap<?> recipeMap,
8586
ICubeRenderer renderer, int tier, boolean hasFrontFacing,
@@ -124,10 +125,14 @@ protected IItemHandlerModifiable createExportItemHandler() {
124125
return new NotifiableItemStackHandler(this, OUTPUT_SLOT_COUNT, this, true);
125126
}
126127

128+
private int getUpgradeSlotCount() {
129+
return getTier() >= gregtech.api.GTValues.LuV ? UPGRADE_SLOTS_EXTENDED : UPGRADE_SLOTS_BASE;
130+
}
131+
127132
@Override
128133
protected void initializeInventory() {
129134
super.initializeInventory();
130-
this.upgradeInventory = new ItemStackHandler(UPGRADE_SLOT_COUNT) {
135+
this.upgradeInventory = new ItemStackHandler(getUpgradeSlotCount()) {
131136

132137
@Override
133138
public boolean isItemValid(int slot, @org.jetbrains.annotations.NotNull ItemStack stack) {
@@ -239,17 +244,21 @@ protected ModularUI createUI(EntityPlayer player) {
239244
builder.widget(new ProgressWidget(getLogic()::getBeeProgress, 60, 16, 20, 20,
240245
GuiTextures.PROGRESS_BAR_ARROW, ProgressWidget.MoveType.HORIZONTAL));
241246

242-
// Upgrade slots
243-
for (int i = 0; i < UPGRADE_SLOT_COUNT; i++) {
244-
builder.widget(new SlotWidget(upgradeInventory, i, 34 + i * 18, 36, true, true, true)
245-
.setBackgroundTexture(GuiTextures.SLOT));
246-
builder.widget(new ImageWidget(35 + i * 18, 37, 16, 16, GTBMGuiTextures.UPGRADE_OVERLAY));
247+
// Upgrade slots (1x4 base, 2x4 for LuV+)
248+
int upgradeSlots = getUpgradeSlotCount();
249+
for (int i = 0; i < upgradeSlots; i++) {
250+
int col = i % 4;
251+
int row = i / 4;
252+
builder.widget(new SlotWidget(upgradeInventory, i, 34 + col * 18, 36 + row * 18,
253+
true, true, true).setBackgroundTexture(GuiTextures.SLOT));
254+
builder.widget(new ImageWidget(35 + col * 18, 37 + row * 18, 16, 16,
255+
GTBMGuiTextures.UPGRADE_OVERLAY));
247256
}
248257

249258
// Output slots
250259
for (int i = 0; i < 3; i++) {
251260
for (int j = 0; j < 3; j++) {
252-
builder.widget(new SlotWidget(exportItems, j + i * 3, 115 + j * 18, 18 + i * 18,
261+
builder.widget(new SlotWidget(exportItems, j + i * 3, 116 + j * 18, 18 + i * 18,
253262
true, false, false).setBackgroundTexture(GuiTextures.SLOT));
254263
}
255264
}

0 commit comments

Comments
 (0)