update yarn

This commit is contained in:
C10udburst
2021-08-30 10:18:07 +02:00
parent b4feb14778
commit 15d3dea949
11 changed files with 35 additions and 33 deletions

View File

@@ -20,7 +20,7 @@ repositories {
dependencies { dependencies {
// To change the versions see the gradle.properties file // To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.

View File

@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties # Fabric Properties
minecraft_version=1.17.1 minecraft_version=1.17.1
yarn_mappings=1.17.1+build.1 yarn_version=1.17.1+build.46
loader_version=0.11.6 loader_version=0.11.6
# Mod Properties # Mod Properties

View File

@@ -36,25 +36,25 @@ public class GiveCommand extends Command {
ct.putString("id", "minecraft:falling_block"); ct.putString("id", "minecraft:falling_block");
ct.put("BlockState", new NbtCompound()); ct.put("BlockState", new NbtCompound());
ct.getCompound("BlockState").putString("Name", Registry.ITEM.getId(inHand.getItem()).toString()); ct.getCompound("BlockState").putString("Name", Registry.ITEM.getId(inHand.getItem()).toString());
if (inHand.hasTag() && inHand.getTag().contains("BlockEntityTag")) { if (inHand.hasNbt() && inHand.getNbt().contains("BlockEntityTag")) {
ct.put("TileEntityData", inHand.getTag().getCompound("BlockEntityTag")); ct.put("TileEntityData", inHand.getNbt().getCompound("BlockEntityTag"));
} }
NbtCompound t = new NbtCompound(); NbtCompound t = new NbtCompound();
t.put("EntityTag", ct); t.put("EntityTag", ct);
item.setTag(t); item.setNbt(t);
} else { } else {
ct.putString("id", "minecraft:item"); ct.putString("id", "minecraft:item");
NbtCompound it = new NbtCompound(); NbtCompound it = new NbtCompound();
it.putString("id", Registry.ITEM.getId(inHand.getItem()).toString()); it.putString("id", Registry.ITEM.getId(inHand.getItem()).toString());
it.putInt("Count",inHand.getCount()); it.putInt("Count",inHand.getCount());
if (inHand.hasTag()) { if (inHand.hasNbt()) {
it.put("tag", inHand.getTag()); it.put("tag", inHand.getNbt());
} }
ct.put("Item",it); ct.put("Item",it);
} }
NbtCompound t = new NbtCompound(); NbtCompound t = new NbtCompound();
t.put("EntityTag", ct); t.put("EntityTag", ct);
item.setTag(t); item.setNbt(t);
item.setCustomName(inHand.getName()); item.setCustomName(inHand.getName());
GiveUtils.giveItem(item); GiveUtils.giveItem(item);
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
@@ -76,7 +76,7 @@ public class GiveCommand extends Command {
tag.putBoolean("CustomNameVisible", true); tag.putBoolean("CustomNameVisible", true);
tag.putString("CustomName", Text.Serializer.toJson(new LiteralText(message))); tag.putString("CustomName", Text.Serializer.toJson(new LiteralText(message)));
tag.put("Pos", NbtList); tag.put("Pos", NbtList);
stack.putSubTag("EntityTag", tag); stack.setSubNbt("EntityTag", tag);
GiveUtils.giveItem(stack); GiveUtils.giveItem(stack);
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
}))); })));
@@ -86,7 +86,7 @@ public class GiveCommand extends Command {
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD); ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
NbtCompound tag = new NbtCompound(); NbtCompound tag = new NbtCompound();
tag.putString("SkullOwner", playerName); tag.putString("SkullOwner", playerName);
itemStack.setTag(tag); itemStack.setNbt(tag);
GiveUtils.giveItem(itemStack); GiveUtils.giveItem(itemStack);
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
}))); })));

View File

@@ -57,7 +57,7 @@ public class LocateCommand extends Command {
error("You need to hold a lodestone compass"); error("You need to hold a lodestone compass");
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
} }
NbtCompound tag = stack.getTag(); NbtCompound tag = stack.getNbt();
if (tag == null) { if (tag == null) {
error("Couldn't get the NBT data. Are you holding a (highlight)lodestone(default) compass?"); error("Couldn't get the NBT data. Are you holding a (highlight)lodestone(default) compass?");
return SINGLE_SUCCESS; return SINGLE_SUCCESS;

View File

@@ -117,7 +117,7 @@ public class HeadScreen extends WindowScreen {
properties.put("textures", textures); properties.put("textures", textures);
skullOwner.put("Properties", properties); skullOwner.put("Properties", properties);
tag.put("SkullOwner", skullOwner); tag.put("SkullOwner", skullOwner);
head.setTag(tag); head.setNbt(tag);
head.setCustomName(new LiteralText(name)); head.setCustomName(new LiteralText(name));
return head; return head;
} }

View File

@@ -74,12 +74,12 @@ public class InteractionScreen extends Screen {
functions = new HashMap<>(); functions = new HashMap<>();
functions.put("Stats", (Entity e) -> { functions.put("Stats", (Entity e) -> {
closeScreen(); closeScreen();
client.openScreen(new StatsScreen(e)); client.setScreen(new StatsScreen(e));
}); });
if (entity instanceof PlayerEntity) { if (entity instanceof PlayerEntity) {
functions.put("Open Inventory", (Entity e) -> { functions.put("Open Inventory", (Entity e) -> {
closeScreen(); closeScreen();
client.openScreen(new InventoryScreen((PlayerEntity) e)); client.setScreen(new InventoryScreen((PlayerEntity) e));
}); });
} }
@@ -104,7 +104,7 @@ public class InteractionScreen extends Screen {
closeScreen(); closeScreen();
ItemStack container = new ItemStack(Items.CHEST); ItemStack container = new ItemStack(Items.CHEST);
container.setCustomName(e.getName()); container.setCustomName(e.getName());
client.openScreen(new PeekScreen(container, getInventory(e))); client.setScreen(new PeekScreen(container, getInventory(e)));
}); });
} }
@@ -146,7 +146,7 @@ public class InteractionScreen extends Screen {
functions.put(key, (Entity e) -> { functions.put(key, (Entity e) -> {
closeScreen(); closeScreen();
client.openScreen(new ChatScreen(replacePlaceholders(msgs.get(key), e))); client.setScreen(new ChatScreen(replacePlaceholders(msgs.get(key), e)));
}); });
}); });
@@ -205,7 +205,7 @@ public class InteractionScreen extends Screen {
} }
private void closeScreen() { private void closeScreen() {
client.openScreen((Screen) null); client.setScreen((Screen) null);
} }
public void onClose() { public void onClose() {
@@ -214,7 +214,7 @@ public class InteractionScreen extends Screen {
if (focusedString != null) { if (focusedString != null) {
functions.get(focusedString).accept(this.entity); functions.get(focusedString).accept(this.entity);
} else } else
client.openScreen((Screen) null); client.setScreen((Screen) null);
} }
public boolean isPauseScreen() { public boolean isPauseScreen() {

View File

@@ -56,7 +56,7 @@ public class WMeteorModule extends WPressable implements MeteorWidget {
@Override @Override
protected void onPressed(int button) { protected void onPressed(int button) {
if (button == GLFW_MOUSE_BUTTON_LEFT) module.toggle(Utils.canUpdate()); if (button == GLFW_MOUSE_BUTTON_LEFT) module.toggle(Utils.canUpdate());
else if (button == GLFW_MOUSE_BUTTON_RIGHT) mc.openScreen(theme.moduleScreen(module)); else if (button == GLFW_MOUSE_BUTTON_RIGHT) mc.setScreen(theme.moduleScreen(module));
} }
@Override @Override

View File

@@ -86,7 +86,7 @@ public class InteractionMenu extends Module {
if (lookingAt.isPresent()) { if (lookingAt.isPresent()) {
Entity e = lookingAt.get(); Entity e = lookingAt.get();
if (entities.get().getBoolean(e.getType())) { if (entities.get().getBoolean(e.getType())) {
mc.openScreen(new InteractionScreen(e, this)); mc.setScreen(new InteractionScreen(e, this));
} }
} }
} }

View File

@@ -70,7 +70,7 @@ public class GiveUtils {
if (preview) preset.getMiddle().getDefaultStack(); if (preview) preset.getMiddle().getDefaultStack();
ItemStack item = preset.getMiddle().getDefaultStack(); ItemStack item = preset.getMiddle().getDefaultStack();
try { try {
item.setTag(StringNbtReader.parse(preset.getRight())); item.setNbt(StringNbtReader.parse(preset.getRight()));
} catch (CommandSyntaxException e) { } } catch (CommandSyntaxException e) { }
item.setCustomName(new LiteralText(toName(preset.getLeft()))); item.setCustomName(new LiteralText(toName(preset.getLeft())));
return item; return item;
@@ -82,7 +82,7 @@ public class GiveUtils {
ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack(); ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack();
String nick = mc.player.getName().asString(); String nick = mc.player.getName().asString();
try { try {
item.setTag(StringNbtReader.parse("{EntityTag:{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}}")); item.setNbt(StringNbtReader.parse("{EntityTag:{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}}"));
} catch (CommandSyntaxException e) { } } catch (CommandSyntaxException e) { }
item.setCustomName(new LiteralText("Force OP")); item.setCustomName(new LiteralText("Force OP"));
return item; return item;
@@ -102,7 +102,7 @@ public class GiveUtils {
} }
NbtCompound nbt = new NbtCompound(); NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects); nbt.put("CustomPotionEffects", effects);
stack.setTag(nbt); stack.setNbt(nbt);
stack.setCustomName(new LiteralText("Lingering Potion of Trolling")); stack.setCustomName(new LiteralText("Lingering Potion of Trolling"));
return stack; return stack;
}); });
@@ -121,7 +121,7 @@ public class GiveUtils {
addEnchant(enchants, "minecraft:vanishing_curse", (short)1); addEnchant(enchants, "minecraft:vanishing_curse", (short)1);
NbtCompound nbt = new NbtCompound(); NbtCompound nbt = new NbtCompound();
nbt.put("Enchantments", enchants); nbt.put("Enchantments", enchants);
stack.setTag(nbt); stack.setNbt(nbt);
stack.setCustomName(new LiteralText("Bonk")); stack.setCustomName(new LiteralText("Bonk"));
return stack; return stack;
}); });
@@ -134,7 +134,7 @@ public class GiveUtils {
for(int i = 0; i < 40000; i++) for(int i = 0; i < 40000; i++)
nbtList.add(new NbtList()); nbtList.add(new NbtList());
nbtCompound.put("nothingsuspicioushere", nbtList); nbtCompound.put("nothingsuspicioushere", nbtList);
stack.setTag(nbtCompound); stack.setNbt(nbtCompound);
stack.setCustomName(new LiteralText("Copy Me")); stack.setCustomName(new LiteralText("Copy Me"));
return stack; return stack;
}); });
@@ -159,7 +159,7 @@ public class GiveUtils {
tagCompound.putInt("Flight", 0); tagCompound.putInt("Flight", 0);
tagCompound.put("Explosions", explosionList); tagCompound.put("Explosions", explosionList);
baseCompound.put("Fireworks", tagCompound); baseCompound.put("Fireworks", tagCompound);
firework.setTag(baseCompound); firework.setNbt(baseCompound);
return firework; return firework;
}); });
@@ -171,7 +171,7 @@ public class GiveUtils {
NbtCompound entityTag = new NbtCompound(); NbtCompound entityTag = new NbtCompound();
entityTag.putString("id", id.toString()); entityTag.putString("id", id.toString());
tag.put("EntityTag", entityTag); tag.put("EntityTag", entityTag);
egg.setTag(tag); egg.setNbt(tag);
egg.setCustomName(new LiteralText(String.format("%s", toName(id.getPath())))); egg.setCustomName(new LiteralText(String.format("%s", toName(id.getPath()))));
return egg; return egg;
}); });

View File

@@ -317,9 +317,9 @@ public class WorldGenUtils {
} }
private static boolean isValidMap(Feature feature, ItemStack stack) { private static boolean isValidMap(Feature feature, ItemStack stack) {
if (!stack.hasTag()) return false; if (!stack.hasNbt()) return false;
if (!stack.getTag().contains("display")) return false; if (!stack.getNbt().contains("display")) return false;
NbtCompound displayTag = stack.getTag().getCompound("display"); NbtCompound displayTag = stack.getNbt().getCompound("display");
if (!displayTag.contains("Name")) return false; if (!displayTag.contains("Name")) return false;
String nameTag = displayTag.getString("Name"); String nameTag = displayTag.getString("Name");
if (!nameTag.contains("translate")) return false; if (!nameTag.contains("translate")) return false;
@@ -335,9 +335,9 @@ public class WorldGenUtils {
} }
private static BlockPos getMapMarker(ItemStack stack) { private static BlockPos getMapMarker(ItemStack stack) {
if (!stack.hasTag()) return null; if (!stack.hasNbt()) return null;
if (!stack.getTag().contains("Decorations")) return null; if (!stack.getNbt().contains("Decorations")) return null;
NbtList decorationsTag = stack.getTag().getList("Decorations", NbtElement.COMPOUND_TYPE); NbtList decorationsTag = stack.getNbt().getList("Decorations", NbtElement.COMPOUND_TYPE);
if (decorationsTag.size() < 1) return null; if (decorationsTag.size() < 1) return null;
NbtCompound iconTag = decorationsTag.getCompound(0); NbtCompound iconTag = decorationsTag.getCompound(0);
return new BlockPos( return new BlockPos(

View File

@@ -52,6 +52,8 @@ public class Seeds extends System<Seeds> {
} }
public void setSeed(String seed) { public void setSeed(String seed) {
if (mc.isIntegratedServerRunning()) return;
ServerInfo server = mc.getCurrentServerEntry(); ServerInfo server = mc.getCurrentServerEntry();
MCVersion ver = null; MCVersion ver = null;
if (server != null) if (server != null)