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

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

View File

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

View File

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

View File

@@ -74,12 +74,12 @@ public class InteractionScreen extends Screen {
functions = new HashMap<>();
functions.put("Stats", (Entity e) -> {
closeScreen();
client.openScreen(new StatsScreen(e));
client.setScreen(new StatsScreen(e));
});
if (entity instanceof PlayerEntity) {
functions.put("Open Inventory", (Entity e) -> {
closeScreen();
client.openScreen(new InventoryScreen((PlayerEntity) e));
client.setScreen(new InventoryScreen((PlayerEntity) e));
});
}
@@ -104,7 +104,7 @@ public class InteractionScreen extends Screen {
closeScreen();
ItemStack container = new ItemStack(Items.CHEST);
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) -> {
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() {
client.openScreen((Screen) null);
client.setScreen((Screen) null);
}
public void onClose() {
@@ -214,7 +214,7 @@ public class InteractionScreen extends Screen {
if (focusedString != null) {
functions.get(focusedString).accept(this.entity);
} else
client.openScreen((Screen) null);
client.setScreen((Screen) null);
}
public boolean isPauseScreen() {

View File

@@ -56,7 +56,7 @@ public class WMeteorModule extends WPressable implements MeteorWidget {
@Override
protected void onPressed(int button) {
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

View File

@@ -86,7 +86,7 @@ public class InteractionMenu extends Module {
if (lookingAt.isPresent()) {
Entity e = lookingAt.get();
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();
ItemStack item = preset.getMiddle().getDefaultStack();
try {
item.setTag(StringNbtReader.parse(preset.getRight()));
item.setNbt(StringNbtReader.parse(preset.getRight()));
} catch (CommandSyntaxException e) { }
item.setCustomName(new LiteralText(toName(preset.getLeft())));
return item;
@@ -82,7 +82,7 @@ public class GiveUtils {
ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack();
String nick = mc.player.getName().asString();
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) { }
item.setCustomName(new LiteralText("Force OP"));
return item;
@@ -102,7 +102,7 @@ public class GiveUtils {
}
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
stack.setTag(nbt);
stack.setNbt(nbt);
stack.setCustomName(new LiteralText("Lingering Potion of Trolling"));
return stack;
});
@@ -121,7 +121,7 @@ public class GiveUtils {
addEnchant(enchants, "minecraft:vanishing_curse", (short)1);
NbtCompound nbt = new NbtCompound();
nbt.put("Enchantments", enchants);
stack.setTag(nbt);
stack.setNbt(nbt);
stack.setCustomName(new LiteralText("Bonk"));
return stack;
});
@@ -134,7 +134,7 @@ public class GiveUtils {
for(int i = 0; i < 40000; i++)
nbtList.add(new NbtList());
nbtCompound.put("nothingsuspicioushere", nbtList);
stack.setTag(nbtCompound);
stack.setNbt(nbtCompound);
stack.setCustomName(new LiteralText("Copy Me"));
return stack;
});
@@ -159,7 +159,7 @@ public class GiveUtils {
tagCompound.putInt("Flight", 0);
tagCompound.put("Explosions", explosionList);
baseCompound.put("Fireworks", tagCompound);
firework.setTag(baseCompound);
firework.setNbt(baseCompound);
return firework;
});
@@ -171,7 +171,7 @@ public class GiveUtils {
NbtCompound entityTag = new NbtCompound();
entityTag.putString("id", id.toString());
tag.put("EntityTag", entityTag);
egg.setTag(tag);
egg.setNbt(tag);
egg.setCustomName(new LiteralText(String.format("%s", toName(id.getPath()))));
return egg;
});

View File

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

View File

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