Merge branch 'master' into master

This commit is contained in:
Caedis authored and GitHub committed 2026-02-09 05:38:34 -06:00
commit 1ea465c688
4 files changed
+60 -40

No files matched your search

+4 -4
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.11.0:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.7.3:dev')
api('com.github.GTNewHorizons:ForestryMC:4.11.4:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.9.13:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.26-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.63-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.45:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
}
+23 -3
View File
@@ -39,14 +39,34 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = true
+1 -1
View File
@@ -17,5 +17,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.6'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
}
@@ -1,7 +1,6 @@
package binnie.core.machines.inventory;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
@@ -16,10 +15,13 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.core.machines.IMachine;
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
public class ComponentInventorySlots extends ComponentInventory implements IInventoryMachine, IInventorySlots {
private final Map<Integer, InventorySlot> inventory = new LinkedHashMap<>();
private final Int2ObjectLinkedOpenHashMap<InventorySlot> inventory = new Int2ObjectLinkedOpenHashMap<>();
private int cachedSize = 0;
private int[] cachedAccessibleSlots = null;
public ComponentInventorySlots(IMachine machine) {
super(machine);
@@ -27,25 +29,20 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public int getSizeInventory() {
int size = 0;
for (Integer index : inventory.keySet()) {
size = Math.max(size, index + 1);
}
return size;
return cachedSize;
}
@Override
public ItemStack getStackInSlot(int index) {
if (inventory.containsKey(index)) {
return inventory.get(index).getContent();
}
return null;
InventorySlot slot = inventory.get(index);
return slot != null ? slot.getContent() : null;
}
@Override
public ItemStack decrStackSize(int index, int amount) {
if (inventory.containsKey(index)) {
ItemStack stack = inventory.get(index).decrStackSize(amount);
InventorySlot slot = inventory.get(index);
if (slot != null) {
ItemStack stack = slot.decrStackSize(amount);
markDirty();
return stack;
}
@@ -59,8 +56,9 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public void setInventorySlotContents(int index, ItemStack itemStack) {
if (inventory.containsKey(index) && (itemStack == null || inventory.get(index).isValid(itemStack))) {
inventory.get(index).setContent(itemStack);
InventorySlot slot = inventory.get(index);
if (slot != null && (itemStack == null || slot.isValid(itemStack))) {
slot.setContent(itemStack);
}
markDirty();
}
@@ -113,7 +111,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
public void writeToNBT(NBTTagCompound nbttagcompound) {
super.writeToNBT(nbttagcompound);
NBTTagList inventoryNBT = new NBTTagList();
for (Map.Entry<Integer, InventorySlot> entry : inventory.entrySet()) {
for (Map.Entry<Integer, InventorySlot> entry : inventory.int2ObjectEntrySet()) {
NBTTagCompound slotNBT = new NBTTagCompound();
slotNBT.setInteger("id", entry.getKey());
entry.getValue().writeToNBT(slotNBT);
@@ -125,6 +123,8 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public InventorySlot addSlot(int index, String unlocalizedName) {
inventory.put(index, new InventorySlot(index, unlocalizedName));
cachedSize = Math.max(cachedSize, index + 1);
cachedAccessibleSlots = null;
return getSlot(index);
}
@@ -138,10 +138,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public InventorySlot getSlot(int index) {
if (inventory.containsKey(index)) {
return inventory.get(index);
}
return null;
return inventory.get(index);
}
@Override
@@ -151,7 +148,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public InventorySlot[] getSlots(int[] indexes) {
List<InventorySlot> list = new ArrayList<>();
List<InventorySlot> list = new ArrayList<>(indexes.length);
for (int i : indexes) {
if (getSlot(i) != null) {
list.add(getSlot(i));
@@ -213,18 +210,20 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public int[] getAccessibleSlotsFromSide(int var1) {
List<Integer> slots = new ArrayList<>();
for (InventorySlot slot : inventory.values()) {
if (slot.canInsert() || slot.canExtract()) {
slots.add(slot.getIndex());
if (cachedAccessibleSlots == null) {
List<Integer> slots = new ArrayList<>();
for (InventorySlot slot : inventory.values()) {
if (slot.canInsert() || slot.canExtract()) {
slots.add(slot.getIndex());
}
}
cachedAccessibleSlots = new int[slots.size()];
for (int i = 0; i < slots.size(); ++i) {
cachedAccessibleSlots[i] = slots.get(i);
}
}
int[] ids = new int[slots.size()];
for (int i = 0; i < slots.size(); ++i) {
ids[i] = slots.get(i);
}
return ids;
return cachedAccessibleSlots;
}
@Override
@@ -234,6 +233,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public boolean canExtractItem(int slot, ItemStack itemstack, int direction) {
return getSlot(slot).canExtract(ForgeDirection.getOrientation(direction));
InventorySlot iSlot = getSlot(slot);
return iSlot != null && iSlot.canExtract(ForgeDirection.getOrientation(direction));
}
}