Skip to content

Instantly share code, notes, and snippets.

@MPThLee
Created February 6, 2023 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MPThLee/2f0c5006a83a8ddd40d5a8ca3655f095 to your computer and use it in GitHub Desktop.
Save MPThLee/2f0c5006a83a8ddd40d5a8ca3655f095 to your computer and use it in GitHub Desktop.
Remove Items in RefinedStorage Extra Disks - Infinite Item Disk.
# pip install nbt
from nbt import nbt
# list of deletion
l = ["supplementaries:quiver",
"mekanismtools:lapis_lazuli_helmet",
"mekanismtools:lapis_lazuli_chestplate",
"mekanismtools:lapis_lazuli_boots",
"mekanismtools:lapis_lazuli_leggings",
"minecraft:chainmail_helmet",
"minecraft:chainmail_chestplate",
"minecraft:chainmail_boots",
"minecraft:chainmail_leggings",
"minecraft:diamond_helmet",
"minecraft:diamond_chestplate",
"minecraft:diamond_boots",
"minecraft:diamond_leggings",
"minecraft:netherite_helmet",
"minecraft:netherite_chestplate",
"minecraft:netherite_boots",
"minecraft:netherite_leggings",
"minecraft:trident",
"mekanismtools:lapis_lazuli_sword"]
nbtfile = nbt.NBTFile('refinedstorage_disks.dat', 'rb')
for x in nbtfile["data"][0]:
if x["Data"]["Capacity"].__str__() == "-1" and x["Type"].__str__() == "refinedstorage:item":
tl = []
tx = 0
for i in range(len(x["Data"]["Items"])):
if x["Data"]["Items"][i]["Id"].__str__() in l:
tl.append(i)
for o in tl:
x["Data"]["Items"].__delitem__(o-tx)
tx += 1
nbtfile.write_file("newnbt1.dat")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment