Skip to content

Commit

Permalink
Allow bigger stack sizes to be dragged into pattern terminals (#39)
Browse files Browse the repository at this point in the history
* update bs+deps

* allow bigger stack sizes to be dragged into pattern terminals
  • Loading branch information
Lyfts authored May 4, 2024
1 parent 4a166fe commit fcf9e34
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 28 deletions.
32 changes: 16 additions & 16 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
dependencies {
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-312-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-352-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev")
implementation("com.github.GTNewHorizons:Baubles:1.0.4:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.0:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.2:dev")

compileOnly("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.2.13-gtnh:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.7.0-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.2.28-gtnh:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.7.1-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BuildCraftCompat:7.1.17:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:EnderIO:2.6.4:dev') { transitive=false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.2:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.45.47:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.6.2-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.2.13-gtnh:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.7.0-GTNH:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:EnderIO:2.7.4:dev') { transitive=false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.9:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.45.163:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.6.5-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.2.28-gtnh:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.7.1-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BuildCraftCompat:7.1.17:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:EnderIO:2.6.4:dev') {transitive=false}
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.2:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GTplusplus:1.11.19:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.6.2-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.10.5-GTNH:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:EnderIO:2.7.4:dev') {transitive=false}
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.9:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GTplusplus:1.11.58:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.6.5-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.10.12-GTNH:dev") { transitive = false }
compileOnly("com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev") { transitive = false }
compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913") { transitive = false }
compileOnly("curse.maven:thermal-expansion-69163:2388759") { transitive = false }
Expand Down
11 changes: 6 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ channel = stable
mappingsVersion = 12

# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/

# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
Expand Down Expand Up @@ -61,6 +61,9 @@ gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =

# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =

# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
Expand Down Expand Up @@ -114,7 +117,7 @@ minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true

# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true

# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
Expand All @@ -123,7 +126,7 @@ includeWellKnownRepositories = true
usesMavenPublishing = true

# Maven repository to publish the mod to.
# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/

# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
Expand Down Expand Up @@ -187,5 +190,3 @@ customArchiveBaseName = NotEnoughEnergistics
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true

# Non-GTNH properties
gradleTokenGroupName =
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
}


Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,13 @@ public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, ItemSta
if (button == 0) {
boolean areStackEqual = slotStack != null && slotStack.isItemEqual(copyStack)
&& ItemStack.areItemStackTagsEqual(slotStack, copyStack);
copyStack.stackSize = areStackEqual ? Math.min(slotStack.stackSize + copySize, 127)
: Math.min(copySize, 127);
copyStack.stackSize = areStackEqual ? slotStack.stackSize + copySize : copySize;
sendPacket = true;
} else if (button == 1) {
boolean areStackEqual = slotStack != null && slotStack.isItemEqual(copyStack)
&& ItemStack.areItemStackTagsEqual(slotStack, copyStack);
if (areStackEqual) {
copyStack.stackSize = Math.min(slotStack.stackSize + 1, 127);
copyStack.stackSize = slotStack.stackSize;
} else {
copyStack.stackSize = slotStack == null ? 1 : copySize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

import com.github.vfyjxf.nee.utils.ItemUtils;

import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
Expand Down Expand Up @@ -38,7 +41,7 @@ public List<Integer> getCraftingSlots() {

@Override
public void fromBytes(ByteBuf buf) {
this.stack = ByteBufUtils.readItemStack(buf);
this.stack = ItemUtils.loadItemStackFromNBT(ByteBufUtils.readTag(buf));
int craftingSlotsSize = buf.readInt();
this.craftingSlots = new ArrayList<>(craftingSlotsSize);
for (int i = 0; i < craftingSlotsSize; i++) {
Expand All @@ -49,7 +52,7 @@ public void fromBytes(ByteBuf buf) {

@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeItemStack(buf, this.stack);
ByteBufUtils.writeTag(buf, ItemUtils.writeItemStackToNBT(this.stack, new NBTTagCompound()));
buf.writeInt(this.craftingSlots.size());
for (Integer craftingSlot : this.craftingSlots) {
buf.writeInt(craftingSlot);
Expand Down

0 comments on commit fcf9e34

Please sign in to comment.