Skip to content

Commit

Permalink
Fix golden ticket not saving nbt (#57)
Browse files Browse the repository at this point in the history
* update bs+deps

* address bs deprecation

* fix golden ticket not saving nbt
  • Loading branch information
Lyfts authored Mar 12, 2024
1 parent 7e84d1a commit 22dfd0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 22 deletions.
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ dependencies {
implementation("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
implementation("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
compileOnly("curse.maven:cofh-lib-220333:2388748")
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.4:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.7:dev") { transitive = false }
compileOnly("curse.maven:craftguide-75557:2459320")

runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev") // for Thaumcraft
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.5.21-GTNH:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev")

compileOnlyApi("com.github.GTNewHorizons:Angelica:1.0.0-alpha31:api")
compileOnlyApi("com.github.GTNewHorizons:Angelica:1.0.0-alpha34:api")

}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass =
generateGradleTokenClass = mods.railcraft.common.core.Tags

# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenVersion = VERSION

# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
Expand All @@ -70,7 +70,7 @@ gradleTokenGroupName =
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile = Railcraft.java
replaceGradleTokenInFile =

# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
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.15'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.17'
}


2 changes: 1 addition & 1 deletion src/main/java/mods/railcraft/common/core/Railcraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
public final class Railcraft {

public static final String MOD_ID = "Railcraft";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String VERSION = Tags.VERSION;
public static final String MC_VERSION = "[1.7.10,1.8)";
public static final RootCommand rootCommand = new RootCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;

import mods.railcraft.common.util.inventory.InvTools;
import mods.railcraft.common.util.misc.Game;

public class PacketCurrentItemNBT extends RailcraftPacket {

private static final Marker SECURITY_MARKER = MarkerManager.getMarker("SuspiciousPackets");
private static final Set<String> ALLOWED_TAGS = new HashSet<>(Arrays.asList("title", "author", "pages", "dest"));

private final EntityPlayer player;
private final ItemStack currentItem;

Expand Down Expand Up @@ -67,13 +60,6 @@ public void readData(DataInputStream data) throws IOException {
return;
}

NBTTagCompound nbt = InvTools.getItemData(stack);
for (String tag : (Set<String>) nbt.func_150296_c()) {
if (!ALLOWED_TAGS.contains(tag)) {
return;
}
}

currentItem.setTagCompound(stack.getTagCompound());
} catch (Exception exception) {
Game.logThrowable("Error reading Item NBT packet", exception);
Expand Down

0 comments on commit 22dfd0a

Please sign in to comment.