From 70f6111232bc5e2196a6c88ebb0763a9cac62496 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 4 May 2024 21:33:33 +0200 Subject: [PATCH 01/17] [Wurst-Bot] Update to 24w18a --- gradle.properties | 10 +++++----- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0ce4b512ec..9c0ac3df8e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.6 -yarn_mappings=1.20.6+build.1 -loader_version=0.15.10 +minecraft_version=24w18a +yarn_mappings=24w18a+build.3 +loader_version=0.15.11 #Fabric api -fabric_version=0.97.8+1.20.6 +fabric_version=0.97.9+1.21 # Mod Properties -mod_version = v7.41.2-MC1.20.6 +mod_version = v7.41.2-MC24w18a maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index c901b895df..ff689a8a0f 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.6"; + public static final String MC_VERSION = "24w18a"; private WurstAnalytics analytics; private EventManager eventManager; From 509fc58fa0cb86c13b6faff33cc6f4ed2d9408d2 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 5 May 2024 19:39:47 +0200 Subject: [PATCH 02/17] Update to 24w18a --- .../clickgui/screens/AddBookOfferScreen.java | 21 ++++-- .../clickgui/screens/EditBookOfferScreen.java | 10 ++- .../screens/EditBookOffersScreen.java | 8 ++- .../net/wurstclient/commands/EnchantCmd.java | 21 ++++-- .../net/wurstclient/hacks/AutoArmorHack.java | 30 ++++++-- .../wurstclient/hacks/AutoLibrarianHack.java | 11 +-- .../net/wurstclient/hacks/AutoSwordHack.java | 10 +-- .../net/wurstclient/hacks/AutoToolHack.java | 24 +++++-- .../hacks/autofish/AutoFishRodSelector.java | 40 ++++++++--- .../hacks/autolibrarian/BookOffer.java | 69 +++++++++++++++---- .../settings/BookOffersSetting.java | 18 +++-- src/main/resources/fabric.mod.json | 4 +- 12 files changed, 197 insertions(+), 69 deletions(-) diff --git a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java index 0322c2d69d..ea12819f68 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java @@ -24,10 +24,16 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.Util; +import net.wurstclient.WurstClient; import net.wurstclient.hacks.autolibrarian.BookOffer; import net.wurstclient.settings.BookOffersSetting; import net.wurstclient.util.ListWidget; @@ -352,8 +358,11 @@ public ListGui(MinecraftClient mc, AddBookOfferScreen screen) super(mc, screen.width, screen.height, 32, screen.height - 80, 30); this.mc = mc; this.screen = screen; - list = Registries.ENCHANTMENT.stream().map(BookOffer::create) - .filter(BookOffer::isValid).sorted() + DynamicRegistryManager drm = + WurstClient.MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + list = registry.stream().map(BookOffer::create) + .filter(BookOffer::isFullyValid).sorted() .collect(Collectors.toList()); } @@ -410,16 +419,18 @@ protected void renderItem(DrawContext context, int index, int x, int y, TextRenderer tr = mc.textRenderer; BookOffer bookOffer = list.get(index); - Enchantment enchantment = bookOffer.getEnchantment(); + RegistryEntry enchantment = + bookOffer.getEnchantmentEntry().get(); String name = bookOffer.getEnchantmentName(); - int nameColor = enchantment.isCursed() ? 0xff5555 : 0xf0f0f0; + int nameColor = + enchantment.isIn(EnchantmentTags.CURSE) ? 0xff5555 : 0xf0f0f0; context.drawText(tr, name, x + 28, y, nameColor, false); context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0, false); - int maxLevel = enchantment.getMaxLevel(); + int maxLevel = enchantment.value().getMaxLevel(); String levels = maxLevel + (maxLevel == 1 ? " level" : " levels"); context.drawText(tr, levels, x + 28, y + 18, 0xa0a0a0, false); } diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java index 5b33aeb40a..efb4268591 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java @@ -21,6 +21,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.wurstclient.hacks.autolibrarian.BookOffer; @@ -126,7 +128,7 @@ public void init() addDrawableChild( saveButton = ButtonWidget.builder(Text.literal("Save"), b -> { - if(offerToSave == null || !offerToSave.isValid()) + if(offerToSave == null || !offerToSave.isFullyValid()) return; bookOffers.replace(index, offerToSave); @@ -274,8 +276,10 @@ public void render(DrawContext context, int mouseX, int mouseY, BookOffer bookOffer = offerToSave; String name = bookOffer.getEnchantmentNameWithLevel(); - Enchantment enchantment = bookOffer.getEnchantment(); - int nameColor = enchantment.isCursed() ? 0xff5555 : 0xffffff; + RegistryEntry enchantment = + bookOffer.getEnchantmentEntry().get(); + int nameColor = + enchantment.isIn(EnchantmentTags.CURSE) ? 0xff5555 : 0xffffff; context.drawTextWithShadow(tr, name, x + 28, y, nameColor); context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0, false); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java index d834e1150f..a44b7c54e8 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java @@ -24,6 +24,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.wurstclient.hacks.autolibrarian.BookOffer; @@ -270,8 +272,10 @@ protected void renderItem(DrawContext context, int index, int x, int y, BookOffer bookOffer = list.get(index); String name = bookOffer.getEnchantmentNameWithLevel(); - Enchantment enchantment = bookOffer.getEnchantment(); - int nameColor = enchantment.isCursed() ? 0xff5555 : 0xf0f0f0; + RegistryEntry enchantment = + bookOffer.getEnchantmentEntry().get(); + int nameColor = + enchantment.isIn(EnchantmentTags.CURSE) ? 0xff5555 : 0xf0f0f0; context.drawText(tr, name, x + 28, y, nameColor, false); context.drawText(tr, bookOffer.id(), x + 28, y + 9, 0xa0a0a0, diff --git a/src/main/java/net/wurstclient/commands/EnchantCmd.java b/src/main/java/net/wurstclient/commands/EnchantCmd.java index 121000ca2b..d74bc647c9 100644 --- a/src/main/java/net/wurstclient/commands/EnchantCmd.java +++ b/src/main/java/net/wurstclient/commands/EnchantCmd.java @@ -10,7 +10,11 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantments; import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; import net.wurstclient.command.CmdError; import net.wurstclient.command.CmdException; import net.wurstclient.command.CmdSyntaxError; @@ -53,24 +57,27 @@ private ItemStack getHeldItem() throws CmdError private void enchant(ItemStack stack, int level) { - for(Enchantment enchantment : Registries.ENCHANTMENT) + DynamicRegistryManager drm = MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + + for(RegistryEntry entry : registry.getIndexedEntries()) { // Skip curses - if(enchantment.isCursed()) + if(entry.isIn(EnchantmentTags.CURSE)) continue; // Skip Silk Touch so it doesn't remove Fortune - if(enchantment == Enchantments.SILK_TOUCH) + if(entry.getKey().orElse(null) == Enchantments.SILK_TOUCH) continue; // Limit Quick Charge to level 5 so it doesn't break - if(enchantment == Enchantments.QUICK_CHARGE) + if(entry.getKey().orElse(null) == Enchantments.QUICK_CHARGE) { - stack.addEnchantment(enchantment, Math.min(level, 5)); + stack.addEnchantment(entry, Math.min(level, 5)); continue; } - stack.addEnchantment(enchantment, level); + stack.addEnchantment(entry, level); } } diff --git a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java index d3db46f828..a324be57dd 100644 --- a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Optional; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.screen.ingame.InventoryScreen; @@ -17,14 +18,18 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; -import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ArmorItem; import net.minecraft.item.ArmorItem.Type; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry.Reference; import net.wurstclient.Category; import net.wurstclient.SearchTags; +import net.wurstclient.WurstClient; import net.wurstclient.events.PacketOutputListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; @@ -180,13 +185,24 @@ private int getArmorValue(ArmorItem item, ItemStack stack) if(useEnchantments.isChecked()) { - Enchantment protection = Enchantments.PROTECTION; - int prtLvl = EnchantmentHelper.getLevel(protection, stack); + DynamicRegistryManager drm = + WurstClient.MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); - ClientPlayerEntity player = MC.player; - DamageSource dmgSource = - player.getDamageSources().playerAttack(player); - prtPoints = protection.getProtectionAmount(prtLvl, dmgSource); + Optional> protection = + registry.getEntry(Enchantments.PROTECTION); + int prtLvl = protection + .map(entry -> EnchantmentHelper.getLevel(entry, stack)) + .orElse(0); + + // TODO: Only the server can calculate protection amount as of + // 24w18a. Might change back in later snapshots. + + // ClientPlayerEntity player = MC.player; + // DamageSource dmgSource = + // player.getDamageSources().playerAttack(player); + // prtPoints = protection.getProtectionAmount(prtLvl, dmgSource); + prtPoints = prtLvl; } return armorPoints * 5 + prtPoints * 3 + armorToughness + armorType; diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 77836a7761..9ea541a12f 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -74,10 +74,11 @@ public final class AutoLibrarianHack extends Hack + "You can also set a maximum price for each book, in case you" + " already have a villager selling it but you want it for a" + " cheaper price.", - "minecraft:depth_strider", "minecraft:efficiency", - "minecraft:feather_falling", "minecraft:fortune", "minecraft:looting", - "minecraft:mending", "minecraft:protection", "minecraft:respiration", - "minecraft:sharpness", "minecraft:silk_touch", "minecraft:unbreaking"); + "minecraft:depth_strider;3", "minecraft:efficiency;5", + "minecraft:feather_falling;4", "minecraft:fortune;3", + "minecraft:looting;3", "minecraft:mending;1", "minecraft:protection;4", + "minecraft:respiration;3", "minecraft:sharpness;5", + "minecraft:silk_touch;1", "minecraft:unbreaking;3"); private final CheckboxSetting lockInTrade = new CheckboxSetting( "Lock in trade", @@ -433,7 +434,7 @@ private BookOffer findEnchantedBookOffer(TradeOfferList tradeOffers) int price = tradeOffer.getDisplayedFirstBuyItem().getCount(); BookOffer bookOffer = new BookOffer(enchantment, level, price); - if(!bookOffer.isValid()) + if(!bookOffer.isFullyValid()) { System.out.println("Found invalid enchanted book offer.\n" + "Component data: " + enchantmentLevelMap); diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index 49efbf9186..402984b6e9 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -7,9 +7,7 @@ */ package net.wurstclient.hacks; -import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.item.Item; @@ -156,12 +154,16 @@ private float getValue(ItemStack stack, Entity entity) .getAttribute(item, EntityAttributes.GENERIC_ATTACK_SPEED) .orElseThrow(); + // TODO: Client-side item-specific attack damage calculation no + // longer exists as of 24w18a. Seems to be a bug, as this would make + // the damage tooltip inaccurate. Check if they add it back in later + // snapshots. case DAMAGE: - EntityType group = entity.getType(); + // EntityType group = entity.getType(); float dmg = (float)ItemUtils .getAttribute(item, EntityAttributes.GENERIC_ATTACK_DAMAGE) .orElseThrow(); - dmg += EnchantmentHelper.getAttackDamage(stack, group); + // dmg += EnchantmentHelper.getAttackDamage(stack, group); return dmg; } diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index f320307198..15481a9faa 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -7,16 +7,24 @@ */ package net.wurstclient.hacks; +import java.util.Optional; + import net.minecraft.block.BlockState; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.SwordItem; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry.Reference; import net.minecraft.util.math.BlockPos; import net.wurstclient.Category; import net.wurstclient.SearchTags; +import net.wurstclient.WurstClient; import net.wurstclient.events.BlockBreakingProgressListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; @@ -180,10 +188,18 @@ private float getMiningSpeed(ItemStack stack, BlockState state) if(speed > 1) { - int efficiency = - EnchantmentHelper.getLevel(Enchantments.EFFICIENCY, stack); - if(efficiency > 0 && !stack.isEmpty()) - speed += efficiency * efficiency + 1; + DynamicRegistryManager drm = + WurstClient.MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + + Optional> efficiency = + registry.getEntry(Enchantments.EFFICIENCY); + int effLvl = efficiency + .map(entry -> EnchantmentHelper.getLevel(entry, stack)) + .orElse(0); + + if(effLvl > 0 && !stack.isEmpty()) + speed += effLvl * effLvl + 1; } return speed; diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java index d354454794..05fb679952 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java @@ -7,15 +7,22 @@ */ package net.wurstclient.hacks.autofish; +import java.util.Optional; import java.util.stream.IntStream; import java.util.stream.Stream; import net.minecraft.client.MinecraftClient; +import net.minecraft.component.EnchantmentEffectComponentTypes; +import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.FishingRodItem; import net.minecraft.item.ItemStack; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry.Reference; import net.wurstclient.WurstClient; import net.wurstclient.hacks.AutoFishHack; import net.wurstclient.settings.CheckboxSetting; @@ -128,14 +135,31 @@ private int getRodValue(ItemStack stack) if(stack.isEmpty() || !(stack.getItem() instanceof FishingRodItem)) return -1; - int luckOTSLvl = - EnchantmentHelper.getLevel(Enchantments.LUCK_OF_THE_SEA, stack); - int lureLvl = EnchantmentHelper.getLevel(Enchantments.LURE, stack); - int unbreakingLvl = - EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack); - int mendingBonus = - EnchantmentHelper.getLevel(Enchantments.MENDING, stack); - int noVanishBonus = EnchantmentHelper.hasVanishingCurse(stack) ? 0 : 1; + DynamicRegistryManager drm = MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + + Optional> luckOTS = + registry.getEntry(Enchantments.LUCK_OF_THE_SEA); + int luckOTSLvl = luckOTS + .map(entry -> EnchantmentHelper.getLevel(entry, stack)).orElse(0); + + Optional> lure = + registry.getEntry(Enchantments.LURE); + int lureLvl = lure + .map(entry -> EnchantmentHelper.getLevel(entry, stack)).orElse(0); + + Optional> unbreaking = + registry.getEntry(Enchantments.UNBREAKING); + int unbreakingLvl = unbreaking + .map(entry -> EnchantmentHelper.getLevel(entry, stack)).orElse(0); + + Optional> mending = + registry.getEntry(Enchantments.MENDING); + int mendingBonus = mending + .map(entry -> EnchantmentHelper.getLevel(entry, stack)).orElse(0); + + int noVanishBonus = EnchantmentHelper.hasAnyEnchantmentsWith(stack, + EnchantmentEffectComponentTypes.PREVENT_EQUIPMENT_DROP) ? 0 : 1; return luckOTSLvl * 9 + lureLvl * 9 + unbreakingLvl * 2 + mendingBonus + noVanishBonus; diff --git a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java index 08507a92e3..1a03adcaaa 100644 --- a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java +++ b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java @@ -8,11 +8,19 @@ package net.wurstclient.hacks.autolibrarian; import java.util.Objects; +import java.util.Optional; import net.minecraft.client.resource.language.TranslationStorage; import net.minecraft.enchantment.Enchantment; -import net.minecraft.registry.Registries; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; +import net.minecraft.text.Text; +import net.minecraft.text.TranslatableTextContent; import net.minecraft.util.Identifier; +import net.wurstclient.WurstClient; import net.wurstclient.mixinterface.ILanguageManager; public record BookOffer(String id, int level, int price) @@ -20,27 +28,50 @@ public record BookOffer(String id, int level, int price) { public static BookOffer create(Enchantment enchantment) { - Identifier id = Registries.ENCHANTMENT.getId(enchantment); + DynamicRegistryManager drm = WurstClient.MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + Identifier id = registry.getId(enchantment); return new BookOffer("" + id, enchantment.getMaxLevel(), 64); } + public Optional> getEnchantmentEntry() + { + if(WurstClient.MC.world == null) + return Optional.empty(); + + DynamicRegistryManager drm = WurstClient.MC.world.getRegistryManager(); + Registry registry = drm.get(RegistryKeys.ENCHANTMENT); + return registry.getEntry(new Identifier(id)); + } + public Enchantment getEnchantment() { - return Registries.ENCHANTMENT.get(new Identifier(id)); + return getEnchantmentEntry().map(RegistryEntry::value).orElse(null); } public String getEnchantmentName() { - TranslationStorage english = ILanguageManager.getEnglish(); - Enchantment enchantment = getEnchantment(); - return english.get(enchantment.getTranslationKey()); + Text description = getEnchantment().description(); + if(description.getContent() instanceof TranslatableTextContent tr) + { + TranslationStorage english = ILanguageManager.getEnglish(); + return english.get(tr.getKey()); + } + + return description.getString(); } public String getEnchantmentNameWithLevel() { TranslationStorage english = ILanguageManager.getEnglish(); Enchantment enchantment = getEnchantment(); - String name = english.get(enchantment.getTranslationKey()); + String name; + + if(enchantment.description() + .getContent() instanceof TranslatableTextContent tr) + name = english.get(tr.getKey()); + else + name = enchantment.description().getString(); if(enchantment.getMaxLevel() > 1) name += " " + english.get("enchantment.level." + level); @@ -53,12 +84,26 @@ public String getFormattedPrice() return price + " emerald" + (price == 1 ? "" : "s"); } - public boolean isValid() + /** + * Fully validates the book offer using the dynamic enchantment registry. + * Will return false if called while the user is not in a world or server. + */ + public boolean isFullyValid() { - Enchantment enchantment = getEnchantment(); - return enchantment != null - && enchantment.isAvailableForEnchantedBookOffer() && level >= 1 - && level <= enchantment.getMaxLevel() && price >= 1 && price <= 64; + return isMostlyValid() && getEnchantmentEntry() + .map(entry -> entry.isIn(EnchantmentTags.TRADEABLE) + && level <= entry.value().getMaxLevel()) + .orElse(false); + } + + /** + * Tries to validate the book offer without using dynamic registries, which + * aren't loaded until the user enters a world or server. + */ + public boolean isMostlyValid() + { + return Identifier.isValid(id) && level >= 1 && price >= 1 + && price <= 64; } @Override diff --git a/src/main/java/net/wurstclient/settings/BookOffersSetting.java b/src/main/java/net/wurstclient/settings/BookOffersSetting.java index 3ff6bb34ce..c275dfd8b1 100644 --- a/src/main/java/net/wurstclient/settings/BookOffersSetting.java +++ b/src/main/java/net/wurstclient/settings/BookOffersSetting.java @@ -19,8 +19,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import net.minecraft.registry.Registries; -import net.minecraft.util.Identifier; import net.wurstclient.WurstClient; import net.wurstclient.clickgui.Component; import net.wurstclient.clickgui.components.BookOffersEditButton; @@ -41,10 +39,10 @@ public BookOffersSetting(String name, String description, { super(name, description); - Arrays.stream(enchantments) - .map(s -> Registries.ENCHANTMENT.get(new Identifier(s))) - .filter(Objects::nonNull).map(BookOffer::create) - .filter(BookOffer::isValid).distinct().sorted() + Arrays.stream(enchantments).filter(Objects::nonNull).map(s -> { + String[] parts = s.split(";"); + return new BookOffer(parts[0], Integer.parseInt(parts[1]), 64); + }).filter(BookOffer::isMostlyValid).distinct().sorted() .forEach(offers::add); defaultOffers = offers.toArray(new BookOffer[0]); } @@ -79,7 +77,7 @@ public boolean isWanted(BookOffer offer) public void add(BookOffer offer) { // check if offer is valid - if(offer == null || !offer.isValid()) + if(offer == null || !offer.isFullyValid()) return; // check if an equal offer is already in the list @@ -112,7 +110,7 @@ public void replace(int index, BookOffer offer) return; // check if new offer is valid - if(offer == null || !offer.isValid()) + if(offer == null || !offer.isFullyValid()) return; // check if new offer is different and already in the list @@ -152,8 +150,8 @@ public void fromJson(JsonElement json) offers.clear(); wson.getAllObjects().parallelStream().map(this::loadOffer) - .filter(Objects::nonNull).filter(BookOffer::isValid).distinct() - .sorted().forEachOrdered(offers::add); + .filter(Objects::nonNull).filter(BookOffer::isMostlyValid) + .distinct().sorted().forEachOrdered(offers::add); }catch(JsonException e) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 69f539f117..f9c3566c6c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.97.1", - "minecraft": "~1.20.5-alpha.24.13.a", + "fabric-api": ">=0.97.9", + "minecraft": "~1.21-alpha.24.18.a", "java": ">=21" }, "suggests": { From e0971f9fc7adcf588a1891ef5f0f1bc41d749c9b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 10 May 2024 18:23:51 +0200 Subject: [PATCH 03/17] [Wurst-Bot] Update to 24w19b --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9c0ac3df8e..a11270ab48 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w18a -yarn_mappings=24w18a+build.3 +minecraft_version=24w19b +yarn_mappings=24w19b+build.3 loader_version=0.15.11 #Fabric api -fabric_version=0.97.9+1.21 +fabric_version=0.98.1+1.21 # Mod Properties -mod_version = v7.41.2-MC24w18a +mod_version = v7.41.2-MC24w19b maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index ff689a8a0f..66ec214d50 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "24w18a"; + public static final String MC_VERSION = "24w19b"; private WurstAnalytics analytics; private EventManager eventManager; From f067b85a9ae23c9cd532b23a84ddd6994cc059de Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 10 May 2024 19:22:38 +0200 Subject: [PATCH 04/17] Update to 24w19b --- src/main/java/net/wurstclient/hacks/AutoArmorHack.java | 6 +++--- src/main/java/net/wurstclient/hacks/AutoSoupHack.java | 9 +++++++-- src/main/java/net/wurstclient/hacks/AutoSwordHack.java | 6 ++---- src/main/resources/fabric.mod.json | 4 ++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java index a324be57dd..964b04f37f 100644 --- a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java @@ -195,13 +195,13 @@ private int getArmorValue(ArmorItem item, ItemStack stack) .map(entry -> EnchantmentHelper.getLevel(entry, stack)) .orElse(0); - // TODO: Only the server can calculate protection amount as of - // 24w18a. Might change back in later snapshots. - // ClientPlayerEntity player = MC.player; // DamageSource dmgSource = // player.getDamageSources().playerAttack(player); // prtPoints = protection.getProtectionAmount(prtLvl, dmgSource); + + // Only the server can calculate protection amount as of + // 24w18a (1.21). Related bug: MC-196250 prtPoints = prtLvl; } diff --git a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java index d49d10caec..ea09f6a7c5 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java @@ -7,15 +7,17 @@ */ package net.wurstclient.hacks; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockWithEntity; import net.minecraft.block.CraftingTableBlock; import net.minecraft.entity.Entity; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.VillagerEntity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.item.StewItem; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; @@ -122,11 +124,14 @@ public void onUpdate() private int findSoup(int startSlot, int endSlot) { + List stews = List.of(Items.MUSHROOM_STEW, Items.RABBIT_STEW, + Items.BEETROOT_SOUP); + for(int i = startSlot; i < endSlot; i++) { ItemStack stack = MC.player.getInventory().getStack(i); - if(stack != null && stack.getItem() instanceof StewItem) + if(stack != null && stews.contains(stack.getItem())) return i; } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index 402984b6e9..40deb7d30d 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -154,10 +154,8 @@ private float getValue(ItemStack stack, Entity entity) .getAttribute(item, EntityAttributes.GENERIC_ATTACK_SPEED) .orElseThrow(); - // TODO: Client-side item-specific attack damage calculation no - // longer exists as of 24w18a. Seems to be a bug, as this would make - // the damage tooltip inaccurate. Check if they add it back in later - // snapshots. + // Client-side item-specific attack damage calculation no + // longer exists as of 24w18a (1.21). Related bug: MC-196250 case DAMAGE: // EntityType group = entity.getType(); float dmg = (float)ItemUtils diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f9c3566c6c..f042079b9e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.97.9", - "minecraft": "~1.21-alpha.24.18.a", + "fabric-api": ">=0.98.1", + "minecraft": "~1.21-alpha.24.19.a", "java": ">=21" }, "suggests": { From 3a03086e4c6799c7e4f3a0e4266a809edae679bb Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 16 May 2024 21:00:02 +0200 Subject: [PATCH 05/17] [Wurst-Bot] Update to 24w20a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index a11270ab48..01bfbcca15 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w19b -yarn_mappings=24w19b+build.3 +minecraft_version=24w20a +yarn_mappings=24w20a+build.3 loader_version=0.15.11 #Fabric api -fabric_version=0.98.1+1.21 +fabric_version=0.98.2+1.21 # Mod Properties -mod_version = v7.41.2-MC24w19b +mod_version = v7.41.2-MC24w20a maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 66ec214d50..1ef698e4c7 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "24w19b"; + public static final String MC_VERSION = "24w20a"; private WurstAnalytics analytics; private EventManager eventManager; From 0d188f60db04e8d11076b6729352d6fda0016b71 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 16 May 2024 21:32:20 +0200 Subject: [PATCH 06/17] Update to 24w20a --- .../wurstclient/mixin/GameRendererMixin.java | 17 ++++++++++------- .../net/wurstclient/mixin/IngameHudMixin.java | 8 +++++--- ....java => RenderTickCounterDynamicMixin.java} | 6 +++--- src/main/resources/fabric.mod.json | 4 ++-- src/main/resources/wurst.mixins.json | 2 +- 5 files changed, 21 insertions(+), 16 deletions(-) rename src/main/java/net/wurstclient/mixin/{RenderTickCounterMixin.java => RenderTickCounterDynamicMixin.java} (83%) diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 172024d8d3..e85194c7f8 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -21,6 +21,7 @@ import net.minecraft.client.render.Camera; import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.RenderTickCounter; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -42,8 +43,9 @@ public abstract class GameRendererMixin implements AutoCloseable */ @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", - ordinal = 0), method = "renderWorld(FJ)V") - private void onRenderWorldViewBobbing(float tickDelta, long limitTime, + ordinal = 0), + method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V") + private void onRenderWorldViewBobbing(RenderTickCounter tickCounter, CallbackInfo ci) { CameraTransformViewBobbingEvent event = @@ -89,9 +91,10 @@ private void onRenderHand(Camera camera, float tickDelta, Matrix4f matrix4f, target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z", opcode = Opcodes.GETFIELD, ordinal = 0), - method = "renderWorld(FJ)V") - private void onRenderWorld(float tickDelta, long limitTime, CallbackInfo ci, - @Local(ordinal = 1) Matrix4f matrix4f2) + method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V") + private void onRenderWorldHandRendering(RenderTickCounter tickCounter, + CallbackInfo ci, @Local(ordinal = 1) Matrix4f matrix4f2, + @Local(ordinal = 1) float tickDelta) { MatrixStack matrixStack = new MatrixStack(); matrixStack.multiplyPositionMatrix(matrix4f2); @@ -130,8 +133,8 @@ private HitResult liquidsRaycast(Entity instance, double maxDistance, at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", ordinal = 0), - method = "renderWorld(FJ)V") - private float wurstNauseaLerp(float delta, float start, float end, + method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V") + private float onRenderWorldNauseaLerp(float delta, float start, float end, Operation original) { if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled()) diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index 395b783029..53aaa08e0f 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -17,6 +17,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.hud.DebugHud; import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.client.render.RenderTickCounter; import net.minecraft.util.Identifier; import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; @@ -32,13 +33,14 @@ public class IngameHudMixin // runs after renderScoreboardSidebar() // and before playerListHud.setVisible() @Inject(at = @At("HEAD"), - method = "renderPlayerList(Lnet/minecraft/client/gui/DrawContext;F)V") - private void onRenderPlayerList(DrawContext context, float tickDelta, - CallbackInfo ci) + method = "renderPlayerList(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V") + private void onRenderPlayerList(DrawContext context, + RenderTickCounter tickCounter, CallbackInfo ci) { if(debugHud.shouldShowDebugHud()) return; + float tickDelta = tickCounter.getTickDelta(true); EventManager.fire(new GUIRenderEvent(context, tickDelta)); } diff --git a/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java b/src/main/java/net/wurstclient/mixin/RenderTickCounterDynamicMixin.java similarity index 83% rename from src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java rename to src/main/java/net/wurstclient/mixin/RenderTickCounterDynamicMixin.java index adbd84dcb8..ab83a5992e 100644 --- a/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java +++ b/src/main/java/net/wurstclient/mixin/RenderTickCounterDynamicMixin.java @@ -17,14 +17,14 @@ import net.minecraft.client.render.RenderTickCounter; import net.wurstclient.WurstClient; -@Mixin(RenderTickCounter.class) -public abstract class RenderTickCounterMixin +@Mixin(RenderTickCounter.Dynamic.class) +public abstract class RenderTickCounterDynamicMixin { @Shadow public float lastFrameDuration; @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J", + target = "Lnet/minecraft/client/render/RenderTickCounter$Dynamic;prevTimeMillis:J", opcode = Opcodes.PUTFIELD, ordinal = 0), method = "beginRenderTick(J)I") public void onBeginRenderTick(long timeMillis, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f042079b9e..e17259ce44 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.98.1", - "minecraft": "~1.21-alpha.24.19.a", + "fabric-api": ">=0.98.2", + "minecraft": "~1.21-alpha.24.20.a", "java": ">=21" }, "suggests": { diff --git a/src/main/resources/wurst.mixins.json b/src/main/resources/wurst.mixins.json index dcd42d45f4..f08363ff09 100644 --- a/src/main/resources/wurst.mixins.json +++ b/src/main/resources/wurst.mixins.json @@ -53,7 +53,7 @@ "PlayerInventoryMixin", "PlayerSkinProviderMixin", "PowderSnowBlockMixin", - "RenderTickCounterMixin", + "RenderTickCounterDynamicMixin", "ScreenMixin", "ShulkerBoxScreenMixin", "SimpleOptionMixin", From 88a7760e90d9fd55bdee6c178bd43f986be42863 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 23 May 2024 13:40:33 +0200 Subject: [PATCH 07/17] [Wurst-Bot] Update to 24w21b --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 27618b3d0a..62883df9e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=24w20a -yarn_mappings=24w20a+build.3 +minecraft_version=24w21b +yarn_mappings=24w21b+build.3 loader_version=0.15.11 # Fabric API -fabric_version=0.98.2+1.21 +fabric_version=0.99.1+1.21 # Mod Properties -mod_version = v7.42-MC24w20a +mod_version = v7.42-MC24w21b maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 4aa894ff4a..82ac0f29b3 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "24w20a"; + public static final String MC_VERSION = "24w21b"; private WurstAnalytics analytics; private EventManager eventManager; From fc3489ff7ce102a3bffcd47b78d5311e5428afd6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 23 May 2024 17:11:57 +0200 Subject: [PATCH 08/17] Update to 24w21b --- .../java/net/wurstclient/ai/PathRenderer.java | 107 ++- .../wurstclient/altmanager/AltRenderer.java | 20 +- .../altmanager/screens/AltEditorScreen.java | 16 +- .../altmanager/screens/AltManagerScreen.java | 32 +- .../net/wurstclient/clickgui/ClickGui.java | 492 +++++----- .../wurstclient/clickgui/ComboBoxPopup.java | 33 +- .../components/AbstractListEditButton.java | 44 +- .../clickgui/components/BlockComponent.java | 16 +- .../components/CheckboxComponent.java | 90 +- .../clickgui/components/ColorComponent.java | 47 +- .../components/ComboBoxComponent.java | 85 +- .../clickgui/components/FeatureButton.java | 86 +- .../clickgui/components/FileComponent.java | 44 +- .../clickgui/components/RadarComponent.java | 56 +- .../clickgui/components/SliderComponent.java | 132 ++- .../components/TextFieldEditButton.java | 44 +- .../clickgui/screens/AddBookOfferScreen.java | 2 +- .../clickgui/screens/EditBookOfferScreen.java | 2 +- .../screens/EditBookOffersScreen.java | 2 +- .../clickgui/screens/EditColorScreen.java | 2 +- .../clickgui/screens/EditItemListScreen.java | 2 +- .../wurstclient/commands/BlockListCmd.java | 2 +- .../net/wurstclient/commands/GiveCmd.java | 2 +- .../net/wurstclient/commands/PotionCmd.java | 2 +- .../net/wurstclient/commands/SetBlockCmd.java | 2 +- .../net/wurstclient/commands/TacoCmd.java | 8 +- .../net/wurstclient/hacks/BaseFinderHack.java | 11 +- .../net/wurstclient/hacks/BowAimbotHack.java | 16 +- .../wurstclient/hacks/CameraDistanceHack.java | 2 +- .../net/wurstclient/hacks/CaveFinderHack.java | 11 +- .../net/wurstclient/hacks/ExcavatorHack.java | 16 +- .../net/wurstclient/hacks/FreecamHack.java | 16 +- .../net/wurstclient/hacks/ItemEspHack.java | 18 +- .../java/net/wurstclient/hacks/LsdHack.java | 2 +- .../net/wurstclient/hacks/MobEspHack.java | 12 +- .../wurstclient/hacks/MobSpawnEspHack.java | 43 +- .../net/wurstclient/hacks/PlayerEspHack.java | 15 +- .../net/wurstclient/hacks/SearchHack.java | 11 +- .../wurstclient/hacks/TrajectoriesHack.java | 17 +- .../net/wurstclient/hacks/TunnellerHack.java | 30 +- .../hacks/autofarm/AutoFarmRenderer.java | 39 +- .../hacks/autofish/AutoFishDebugDraw.java | 16 +- .../hacks/autolibrarian/BookOffer.java | 2 +- .../hacks/chestesp/ChestEspRenderer.java | 18 +- .../newchunks/NewChunksChunkRenderer.java | 4 +- .../newchunks/NewChunksOutlineRenderer.java | 28 +- .../newchunks/NewChunksReasonsRenderer.java | 60 +- .../hacks/newchunks/NewChunksRenderer.java | 4 +- .../newchunks/NewChunksSquareRenderer.java | 20 +- .../hacks/portalesp/PortalEspRenderer.java | 18 +- .../net/wurstclient/hacks/treebot/Tree.java | 9 +- src/main/java/net/wurstclient/hud/TabGui.java | 86 +- .../java/net/wurstclient/hud/WurstLogo.java | 18 +- .../net/wurstclient/mixin/CameraMixin.java | 10 +- .../mixin/ClientPlayerEntityMixin.java | 8 +- .../mixin/DisconnectedScreenMixin.java | 4 +- .../mixin/GameMenuScreenMixin.java | 2 +- .../navigator/NavigatorFeatureScreen.java | 46 +- .../navigator/NavigatorMainScreen.java | 69 +- .../navigator/NavigatorScreen.java | 112 ++- .../settings/BlockListSetting.java | 4 +- .../wurstclient/settings/ItemListSetting.java | 4 +- .../java/net/wurstclient/util/BlockUtils.java | 4 +- .../java/net/wurstclient/util/ItemUtils.java | 2 +- .../java/net/wurstclient/util/ListWidget.java | 252 ++--- .../net/wurstclient/util/RenderUtils.java | 884 ++++++++---------- src/main/resources/fabric.mod.json | 4 +- 67 files changed, 1569 insertions(+), 1748 deletions(-) diff --git a/src/main/java/net/wurstclient/ai/PathRenderer.java b/src/main/java/net/wurstclient/ai/PathRenderer.java index d29b1a4cfc..09a179da21 100644 --- a/src/main/java/net/wurstclient/ai/PathRenderer.java +++ b/src/main/java/net/wurstclient/ai/PathRenderer.java @@ -13,6 +13,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -27,10 +28,9 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, BlockPos end, RegionPos region) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); int startX = start.getX() - region.x(); int startY = start.getY(); @@ -44,8 +44,8 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); // main line - bufferBuilder.vertex(matrix, startX, startY, startZ).next(); - bufferBuilder.vertex(matrix, endX, endY, endZ).next(); + bufferBuilder.vertex(matrix, startX, startY, startZ); + bufferBuilder.vertex(matrix, endX, endY, endZ); matrixStack.translate(endX, endY, endZ); @@ -64,39 +64,39 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, matrix.rotate(zAngle, new Vector3f(0, 0, 1)); // arrow head - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, -1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, -1); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); matrixStack.pop(); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void renderNode(MatrixStack matrixStack, BlockPos pos, @@ -110,52 +110,51 @@ public static void renderNode(MatrixStack matrixStack, BlockPos pos, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); // middle part - bufferBuilder.vertex(matrix, 0, 0, 1).next(); - bufferBuilder.vertex(matrix, -1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 1); + bufferBuilder.vertex(matrix, -1, 0, 0); - bufferBuilder.vertex(matrix, -1, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, -1).next(); + bufferBuilder.vertex(matrix, -1, 0, 0); + bufferBuilder.vertex(matrix, 0, 0, -1); - bufferBuilder.vertex(matrix, 0, 0, -1).next(); - bufferBuilder.vertex(matrix, 1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, -1); + bufferBuilder.vertex(matrix, 1, 0, 0); - bufferBuilder.vertex(matrix, 1, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, 1).next(); + bufferBuilder.vertex(matrix, 1, 0, 0); + bufferBuilder.vertex(matrix, 0, 0, 1); // top part - bufferBuilder.vertex(matrix, 0, 1, 0).next(); - bufferBuilder.vertex(matrix, 1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, 1, 0); + bufferBuilder.vertex(matrix, 1, 0, 0); - bufferBuilder.vertex(matrix, 0, 1, 0).next(); - bufferBuilder.vertex(matrix, -1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, 1, 0); + bufferBuilder.vertex(matrix, -1, 0, 0); - bufferBuilder.vertex(matrix, 0, 1, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, -1).next(); + bufferBuilder.vertex(matrix, 0, 1, 0); + bufferBuilder.vertex(matrix, 0, 0, -1); - bufferBuilder.vertex(matrix, 0, 1, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, 1).next(); + bufferBuilder.vertex(matrix, 0, 1, 0); + bufferBuilder.vertex(matrix, 0, 0, 1); // bottom part - bufferBuilder.vertex(matrix, 0, -1, 0).next(); - bufferBuilder.vertex(matrix, 1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, -1, 0); + bufferBuilder.vertex(matrix, 1, 0, 0); - bufferBuilder.vertex(matrix, 0, -1, 0).next(); - bufferBuilder.vertex(matrix, -1, 0, 0).next(); + bufferBuilder.vertex(matrix, 0, -1, 0); + bufferBuilder.vertex(matrix, -1, 0, 0); - bufferBuilder.vertex(matrix, 0, -1, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, -1).next(); + bufferBuilder.vertex(matrix, 0, -1, 0); + bufferBuilder.vertex(matrix, 0, 0, -1); - bufferBuilder.vertex(matrix, 0, -1, 0).next(); - bufferBuilder.vertex(matrix, 0, 0, 1).next(); + bufferBuilder.vertex(matrix, 0, -1, 0); + bufferBuilder.vertex(matrix, 0, 0, 1); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); matrixStack.pop(); } diff --git a/src/main/java/net/wurstclient/altmanager/AltRenderer.java b/src/main/java/net/wurstclient/altmanager/AltRenderer.java index 57f26c11ed..2231bef6fe 100644 --- a/src/main/java/net/wurstclient/altmanager/AltRenderer.java +++ b/src/main/java/net/wurstclient/altmanager/AltRenderer.java @@ -67,18 +67,14 @@ private static void drawTexture(DrawContext context, int x, int y, float u, RenderSystem.setShader(GameRenderer::getPositionTexProgram); MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); - BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE); - bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh) - .next(); - bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh) - .next(); - bufferBuilder.vertex(matrix4f, x2, y2, z) - .texture(uPlusWOverFw, vPlusHOverFh).next(); - bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh) - .next(); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + BufferBuilder bufferBuilder = Tessellator.getInstance().method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); + bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh); + bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh); + bufferBuilder.vertex(matrix4f, x2, y2, z).texture(uPlusWOverFw, + vPlusHOverFh); + bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawAltFace(DrawContext context, String name, int x, diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java index 531a9b97c3..7d666aacb4 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java @@ -34,6 +34,7 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -349,7 +350,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // skin preview @@ -384,13 +384,13 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, width, 0, 0).next(); - bufferBuilder.vertex(matrix, width, height, 0).next(); - bufferBuilder.vertex(matrix, 0, height, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, width, 0, 0); + bufferBuilder.vertex(matrix, width, height, 0); + bufferBuilder.vertex(matrix, 0, height, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java index 3b47a38364..b7578c8743 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java @@ -38,6 +38,7 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ClickableWidget; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -422,7 +423,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // skin preview @@ -459,13 +459,13 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, width, 0, 0).next(); - bufferBuilder.vertex(matrix, width, height, 0).next(); - bufferBuilder.vertex(matrix, 0, height, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, width, 0, 0); + bufferBuilder.vertex(matrix, width, height, 0); + bufferBuilder.vertex(matrix, 0, height, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); @@ -646,7 +646,6 @@ protected void renderItem(DrawContext context, int id, int x, int y, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // green glow when logged in @@ -661,13 +660,14 @@ protected void renderItem(DrawContext context, int id, int x, int y, RenderSystem.setShaderColor(0, 1, 0, opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x - 2, y - 2, 0).next(); - bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0).next(); - bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0).next(); - bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x - 2, y - 2, 0); + bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0); + bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0); + bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/net/wurstclient/clickgui/ClickGui.java b/src/main/java/net/wurstclient/clickgui/ClickGui.java index 15460f0442..7b2fde2ccb 100644 --- a/src/main/java/net/wurstclient/clickgui/ClickGui.java +++ b/src/main/java/net/wurstclient/clickgui/ClickGui.java @@ -30,6 +30,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -531,7 +532,6 @@ public void renderTooltip(DrawContext context, int mouseX, int mouseY) { MatrixStack matrixStack = context.getMatrices(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); if(tooltip.isEmpty()) return; @@ -564,24 +564,24 @@ public void renderTooltip(DrawContext context, int mouseX, int mouseY) // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], ttOpacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // text RenderSystem.setShaderColor(1, 1, 1, 1); @@ -638,7 +638,6 @@ private void renderWindow(DrawContext context, Window window, int mouseX, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); if(window.isMinimized()) @@ -677,21 +676,22 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xs2, ys1, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys2, 0).next(); - bufferBuilder.vertex(matrix, xs3, ys2, 0).next(); - bufferBuilder.vertex(matrix, xs3, ys1, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys1, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys3, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys3, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys1, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys4, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys2, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys2, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys4, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xs2, ys1, 0); + bufferBuilder.vertex(matrix, xs2, ys2, 0); + bufferBuilder.vertex(matrix, xs3, ys2, 0); + bufferBuilder.vertex(matrix, xs3, ys1, 0); + bufferBuilder.vertex(matrix, xs1, ys1, 0); + bufferBuilder.vertex(matrix, xs1, ys3, 0); + bufferBuilder.vertex(matrix, xs2, ys3, 0); + bufferBuilder.vertex(matrix, xs2, ys1, 0); + bufferBuilder.vertex(matrix, xs1, ys4, 0); + bufferBuilder.vertex(matrix, xs1, ys2, 0); + bufferBuilder.vertex(matrix, xs2, ys2, 0); + bufferBuilder.vertex(matrix, xs2, ys4, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); boolean hovering = mouseX >= xs1 && mouseY >= ys3 && mouseX < xs2 && mouseY < ys4; @@ -700,26 +700,29 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], hovering ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xs1, ys3, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys4, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys4, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys3, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xs1, ys3, 0); + bufferBuilder.vertex(matrix, xs1, ys4, 0); + bufferBuilder.vertex(matrix, xs2, ys4, 0); + bufferBuilder.vertex(matrix, xs2, ys3, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xs1, ys3, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys4, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys4, 0).next(); - bufferBuilder.vertex(matrix, xs2, ys3, 0).next(); - bufferBuilder.vertex(matrix, xs1, ys3, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, xs1, ys3, 0); + bufferBuilder.vertex(matrix, xs1, ys4, 0); + bufferBuilder.vertex(matrix, xs2, ys4, 0); + bufferBuilder.vertex(matrix, xs2, ys3, 0); + bufferBuilder.vertex(matrix, xs1, ys3, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); } int x3 = x1 + 2; @@ -732,17 +735,17 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y3, 0).next(); - bufferBuilder.vertex(matrix, x5, y3, 0).next(); - bufferBuilder.vertex(matrix, x5, y2, 0).next(); - bufferBuilder.vertex(matrix, x4, y2, 0).next(); - bufferBuilder.vertex(matrix, x4, y3, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y3, 0); + bufferBuilder.vertex(matrix, x5, y3, 0); + bufferBuilder.vertex(matrix, x5, y2, 0); + bufferBuilder.vertex(matrix, x4, y2, 0); + bufferBuilder.vertex(matrix, x4, y3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); net.minecraft.client.util.Window sr = MC.getWindow(); int sf = (int)sr.getScaleFactor(); @@ -756,8 +759,8 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); // window background // between children @@ -767,10 +770,10 @@ private void renderWindow(DrawContext context, Window window, int mouseX, { int yc1 = window.getChild(i).getY(); int yc2 = yc1 - 2; - bufferBuilder.vertex(matrix, xc1, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); + bufferBuilder.vertex(matrix, xc1, yc2, 0); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); } // window background @@ -785,12 +788,12 @@ private void renderWindow(DrawContext context, Window window, int mouseX, yc1 = lastChild.getY() + lastChild.getHeight(); } int yc2 = yc1 + 2; - bufferBuilder.vertex(matrix, xc1, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); + bufferBuilder.vertex(matrix, xc1, yc2, 0); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // render children int cMouseX = mouseX - x1; @@ -810,23 +813,23 @@ private void renderWindow(DrawContext context, Window window, int mouseX, // window outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); if(!window.isMinimized()) { // title bar outline - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } // title bar buttons @@ -865,27 +868,27 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y4, 0).next(); - bufferBuilder.vertex(matrix, x2, y4, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y5, 0).next(); - bufferBuilder.vertex(matrix, x3, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y5, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y4, 0); + bufferBuilder.vertex(matrix, x2, y4, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x3, y5, 0); + bufferBuilder.vertex(matrix, x3, y3, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + bufferBuilder.vertex(matrix, x2, y5, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // title bar background // behind title - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x3, y3, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x3, y3, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // window title RenderSystem.setShaderColor(1, 1, 1, 1); @@ -903,41 +906,40 @@ private void renderTitleBarButton(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // button background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hovering ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // background between buttons RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // button outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, @@ -947,7 +949,6 @@ private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float xa1 = x1 + 1; float xa2 = (x1 + x2) / 2.0F; @@ -969,22 +970,22 @@ private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, } // arrow - bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void renderPinButton(MatrixStack matrixStack, int x1, int y1, @@ -995,7 +996,6 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); if(pinned) { @@ -1009,17 +1009,17 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(h, 0, 0, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk3, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk3, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk1, yk2, 0); + bufferBuilder.vertex(matrix, xk3, yk2, 0); + bufferBuilder.vertex(matrix, xk4, yk2, 0); + bufferBuilder.vertex(matrix, xk4, yk3, 0); + bufferBuilder.vertex(matrix, xk3, yk3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); float xn1 = x1 + 3.5F; float xn2 = x2 - 3.5F; @@ -1028,39 +1028,40 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn2, 0).next(); - bufferBuilder.vertex(matrix, xn1, yn2, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn2, 0); + bufferBuilder.vertex(matrix, xn1, yn2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outlines RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk3, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk3, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk3, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk2, 0).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn2, 0).next(); - bufferBuilder.vertex(matrix, xn1, yn2, 0).next(); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk1, yk2, 0); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk3, yk2, 0); + bufferBuilder.vertex(matrix, xk4, yk2, 0); + bufferBuilder.vertex(matrix, xk4, yk3, 0); + bufferBuilder.vertex(matrix, xk3, yk3, 0); + bufferBuilder.vertex(matrix, xk3, yk2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn2, 0); + bufferBuilder.vertex(matrix, xn1, yn2, 0); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); }else { @@ -1081,17 +1082,17 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(0, h, 0, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk3, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk4, 0).next(); - bufferBuilder.vertex(matrix, xk5, yk5, 0).next(); - bufferBuilder.vertex(matrix, xk6, yk6, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk7, 0).next(); - bufferBuilder.vertex(matrix, xk7, yk4, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk3, yk3, 0); + bufferBuilder.vertex(matrix, xk4, yk4, 0); + bufferBuilder.vertex(matrix, xk5, yk5, 0); + bufferBuilder.vertex(matrix, xk6, yk6, 0); + bufferBuilder.vertex(matrix, xk3, yk7, 0); + bufferBuilder.vertex(matrix, xk7, yk4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); float xn1 = x1 + 3; float xn2 = x1 + 4; @@ -1102,39 +1103,39 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn2, 0).next(); - bufferBuilder.vertex(matrix, xn3, yn3, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn2, 0); + bufferBuilder.vertex(matrix, xn3, yn3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outlines RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk3, 0).next(); - bufferBuilder.vertex(matrix, xk4, yk4, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk5, yk5, 0).next(); - bufferBuilder.vertex(matrix, xk6, yk6, 0).next(); - bufferBuilder.vertex(matrix, xk3, yk7, 0).next(); - bufferBuilder.vertex(matrix, xk7, yk4, 0).next(); - bufferBuilder.vertex(matrix, xk5, yk5, 0).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); - bufferBuilder.vertex(matrix, xn2, yn2, 0).next(); - bufferBuilder.vertex(matrix, xn3, yn3, 0).next(); - bufferBuilder.vertex(matrix, xn1, yn1, 0).next(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk3, yk3, 0); + bufferBuilder.vertex(matrix, xk4, yk4, 0); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk5, yk5, 0); + bufferBuilder.vertex(matrix, xk6, yk6, 0); + bufferBuilder.vertex(matrix, xk3, yk7, 0); + bufferBuilder.vertex(matrix, xk7, yk4, 0); + bufferBuilder.vertex(matrix, xk5, yk5, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + bufferBuilder.vertex(matrix, xn2, yn2, 0); + bufferBuilder.vertex(matrix, xn3, yn3, 0); + bufferBuilder.vertex(matrix, xn1, yn1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } - tessellator.draw(); } private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, @@ -1144,7 +1145,6 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float xc1 = x1 + 2; float xc2 = x1 + 3; @@ -1163,39 +1163,39 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, // cross RenderSystem.setShaderColor(hovering ? 1 : 0.85F, 0, 0, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc6, yc5, 0).next(); - bufferBuilder.vertex(matrix, xc7, yc6, 0).next(); - bufferBuilder.vertex(matrix, xc6, yc7, 0).next(); - bufferBuilder.vertex(matrix, xc5, yc6, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc4, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); + bufferBuilder.vertex(matrix, xc3, yc3, 0); + bufferBuilder.vertex(matrix, xc4, yc4, 0); + bufferBuilder.vertex(matrix, xc3, yc1, 0); + bufferBuilder.vertex(matrix, xc4, yc2, 0); + bufferBuilder.vertex(matrix, xc6, yc5, 0); + bufferBuilder.vertex(matrix, xc7, yc6, 0); + bufferBuilder.vertex(matrix, xc6, yc7, 0); + bufferBuilder.vertex(matrix, xc5, yc6, 0); + bufferBuilder.vertex(matrix, xc1, yc3, 0); + bufferBuilder.vertex(matrix, xc2, yc4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc6, yc5, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc7, yc6, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc6, yc7, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc5, yc6, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); + bufferBuilder.vertex(matrix, xc6, yc5, 0); + bufferBuilder.vertex(matrix, xc4, yc2, 0); + bufferBuilder.vertex(matrix, xc3, yc1, 0); + bufferBuilder.vertex(matrix, xc7, yc6, 0); + bufferBuilder.vertex(matrix, xc3, yc3, 0); + bufferBuilder.vertex(matrix, xc4, yc4, 0); + bufferBuilder.vertex(matrix, xc6, yc7, 0); + bufferBuilder.vertex(matrix, xc2, yc4, 0); + bufferBuilder.vertex(matrix, xc1, yc3, 0); + bufferBuilder.vertex(matrix, xc5, yc6, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public float[] getBgColor() diff --git a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java index ff94b860c9..3af9a37242 100644 --- a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java +++ b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java @@ -15,6 +15,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -114,19 +115,18 @@ private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float[] acColor = gui.getAcColor(); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawValueBackground(MatrixStack matrixStack, int x1, int x2, @@ -137,17 +137,16 @@ private void drawValueBackground(MatrixStack matrixStack, int x1, int x2, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], alpha); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, yi1, 0).next(); - bufferBuilder.vertex(matrix, x1, yi2, 0).next(); - bufferBuilder.vertex(matrix, x2, yi2, 0).next(); - bufferBuilder.vertex(matrix, x2, yi1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, yi1, 0); + bufferBuilder.vertex(matrix, x1, yi2, 0); + bufferBuilder.vertex(matrix, x2, yi2, 0); + bufferBuilder.vertex(matrix, x2, yi1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawValueName(DrawContext context, int x1, int yi1, diff --git a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java index 3cf86df67b..02b4cc0168 100644 --- a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java @@ -16,6 +16,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -83,7 +84,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // tooltip @@ -93,33 +93,33 @@ public void render(DrawContext context, int mouseX, int mouseY, // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java index e6f69f8bdf..4e75989a33 100644 --- a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java @@ -17,6 +17,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -88,7 +89,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // tooltip @@ -108,13 +108,13 @@ else if(hBlock) // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java index 7406ba9730..036b82284b 100644 --- a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java @@ -15,6 +15,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -117,17 +118,16 @@ private void drawBackground(MatrixStack matrixStack, int x2, int x3, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawBox(MatrixStack matrixStack, int x1, int x3, int y1, @@ -139,27 +139,26 @@ private void drawBox(MatrixStack matrixStack, int x1, int x3, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hovering ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawCheck(MatrixStack matrixStack, int x1, int y1, @@ -167,7 +166,6 @@ private void drawCheck(MatrixStack matrixStack, int x1, int y1, { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float xc1 = x1 + 2.5F; float xc2 = x1 + 3.5F; @@ -185,30 +183,30 @@ private void drawCheck(MatrixStack matrixStack, int x1, int y1, RenderSystem.setShaderColor(0.5F, 0.5F, 0.5F, 0.75F); else RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xc2, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc5, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc5, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc5, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc4, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xc2, yc3, 0); + bufferBuilder.vertex(matrix, xc3, yc4, 0); + bufferBuilder.vertex(matrix, xc3, yc5, 0); + bufferBuilder.vertex(matrix, xc1, yc4, 0); + bufferBuilder.vertex(matrix, xc4, yc1, 0); + bufferBuilder.vertex(matrix, xc5, yc2, 0); + bufferBuilder.vertex(matrix, xc3, yc5, 0); + bufferBuilder.vertex(matrix, xc3, yc4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xc2, yc3, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc4, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc5, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc3, yc5, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc4, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc3, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xc2, yc3, 0); + bufferBuilder.vertex(matrix, xc3, yc4, 0); + bufferBuilder.vertex(matrix, xc4, yc1, 0); + bufferBuilder.vertex(matrix, xc5, yc2, 0); + bufferBuilder.vertex(matrix, xc3, yc5, 0); + bufferBuilder.vertex(matrix, xc1, yc4, 0); + bufferBuilder.vertex(matrix, xc2, yc3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawName(DrawContext context, int x3, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java index b9fa818877..0abe1fc22e 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java @@ -16,6 +16,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -108,19 +109,18 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x2, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawBox(MatrixStack matrixStack, int x1, int x2, int y2, @@ -132,29 +132,28 @@ private void drawBox(MatrixStack matrixStack, int x1, int x2, int y2, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(color[0], color[1], color[2], hovering ? 1F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawNameAndValue(DrawContext context, int x1, int x2, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java index d5ed6c3e05..776407b2a3 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java @@ -19,6 +19,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -152,18 +153,17 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x4, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x4, y2, 0).next(); - bufferBuilder.vertex(matrix, x4, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x4, y2, 0); + bufferBuilder.vertex(matrix, x4, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawBox(MatrixStack matrixStack, int x2, int x4, int y1, @@ -175,43 +175,41 @@ private void drawBox(MatrixStack matrixStack, int x2, int x4, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); // background float bgAlpha = hBox ? opacity * 1.5F : opacity; RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], bgAlpha); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x4, y1, 0).next(); - bufferBuilder.vertex(matrix, x4, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x4, y1, 0); + bufferBuilder.vertex(matrix, x4, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x4, y1, 0).next(); - bufferBuilder.vertex(matrix, x4, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x4, y1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x4, y1, 0); + bufferBuilder.vertex(matrix, x4, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x4, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, @@ -219,7 +217,6 @@ private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float xa1 = x3 + 1; float xa2 = (x3 + x2) / 2.0F; @@ -241,22 +238,22 @@ private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, } // arrow - bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawNameAndValue(DrawContext context, int x1, int x4, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java index c772351017..199e664e8e 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java @@ -18,6 +18,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -167,10 +168,9 @@ private void drawButtonBackground(MatrixStack matrixStack, int x1, int x3, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); if(feature.isEnabled()) // if(feature.isBlocked()) @@ -182,12 +182,12 @@ private void drawButtonBackground(MatrixStack matrixStack, int x1, int x3, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hHack ? opacity * 1.5F : opacity); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawSettingsBackground(MatrixStack matrixStack, int x2, int x3, @@ -198,17 +198,16 @@ private void drawSettingsBackground(MatrixStack matrixStack, int x2, int x3, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hSettings ? opacity * 1.5F : opacity); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, @@ -218,31 +217,29 @@ private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x1, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); // separator - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, @@ -256,7 +253,6 @@ private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); if(isSettingsWindowOpen()) { @@ -272,22 +268,22 @@ private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, } // arrow - bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa3, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawName(DrawContext context, int x1, int x3, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java index a84b4d589c..1aa1dfec42 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java @@ -15,6 +15,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -84,7 +85,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // tooltip @@ -99,33 +99,33 @@ else if(hBox) // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x3, y1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y1, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x3, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java index 2b2af5ed18..b9f9b0111f 100644 --- a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java @@ -15,6 +15,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -68,7 +69,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // tooltip @@ -78,13 +78,13 @@ public void render(DrawContext context, int mouseX, int mouseY, // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); float middleX = (x1 + x2) / 2.0F; float middleY = (y1 + y2) / 2.0F; @@ -108,24 +108,24 @@ public void render(DrawContext context, int mouseX, int mouseY, // arrow RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya3, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya2, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya3, 0); + bufferBuilder.vertex(matrix, xa3, ya2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - bufferBuilder.vertex(matrix, xa2, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya3, 0).next(); - bufferBuilder.vertex(matrix, xa3, ya2, 0).next(); - bufferBuilder.vertex(matrix, xa1, ya1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + bufferBuilder.vertex(matrix, xa2, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya3, 0); + bufferBuilder.vertex(matrix, xa3, ya2, 0); + bufferBuilder.vertex(matrix, xa1, ya1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); matrixStack.pop(); matrix = matrixStack.peek().getPositionMatrix(); @@ -134,7 +134,7 @@ public void render(DrawContext context, int mouseX, int mouseY, // points RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); for(Entity e : hack.getEntities()) { @@ -176,21 +176,21 @@ else if(e instanceof AnimalEntity || e instanceof AmbientEntity bufferBuilder .vertex(matrix, middleX + (float)renderX - 0.5F, middleY + (float)renderY - 0.5F, 0) - .color(red, green, blue, alpha).next(); + .color(red, green, blue, alpha); bufferBuilder .vertex(matrix, middleX + (float)renderX + 0.5F, middleY + (float)renderY - 0.5F, 0) - .color(red, green, blue, alpha).next(); + .color(red, green, blue, alpha); bufferBuilder .vertex(matrix, middleX + (float)renderX + 0.5F, middleY + (float)renderY + 0.5F, 0) - .color(red, green, blue, alpha).next(); + .color(red, green, blue, alpha); bufferBuilder .vertex(matrix, middleX + (float)renderX - 0.5F, middleY + (float)renderY + 0.5F, 0) - .color(red, green, blue, alpha).next(); + .color(red, green, blue, alpha); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } @Override diff --git a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java index 53bc552340..61a4f3039c 100644 --- a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java @@ -17,6 +17,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -173,34 +174,33 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x2, int x3, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y4, 0).next(); - bufferBuilder.vertex(matrix, x2, y4, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - - bufferBuilder.vertex(matrix, x1, y5, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y5, 0).next(); - - bufferBuilder.vertex(matrix, x1, y4, 0).next(); - bufferBuilder.vertex(matrix, x1, y5, 0).next(); - bufferBuilder.vertex(matrix, x3, y5, 0).next(); - bufferBuilder.vertex(matrix, x3, y4, 0).next(); - - bufferBuilder.vertex(matrix, x4, y4, 0).next(); - bufferBuilder.vertex(matrix, x4, y5, 0).next(); - bufferBuilder.vertex(matrix, x2, y5, 0).next(); - bufferBuilder.vertex(matrix, x2, y4, 0).next(); - - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y4, 0); + bufferBuilder.vertex(matrix, x2, y4, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + + bufferBuilder.vertex(matrix, x1, y5, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y5, 0); + + bufferBuilder.vertex(matrix, x1, y4, 0); + bufferBuilder.vertex(matrix, x1, y5, 0); + bufferBuilder.vertex(matrix, x3, y5, 0); + bufferBuilder.vertex(matrix, x3, y4, 0); + + bufferBuilder.vertex(matrix, x4, y4, 0); + bufferBuilder.vertex(matrix, x4, y5, 0); + bufferBuilder.vertex(matrix, x2, y5, 0); + bufferBuilder.vertex(matrix, x2, y4, 0); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, @@ -212,7 +212,6 @@ private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float xl1 = x3; float xl2 = x4; @@ -226,39 +225,39 @@ private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, // limit RenderSystem.setShaderColor(1, 0, 0, hSlider ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y4, 0).next(); - bufferBuilder.vertex(matrix, x3, y5, 0).next(); - bufferBuilder.vertex(matrix, xl1, y5, 0).next(); - bufferBuilder.vertex(matrix, xl1, y4, 0).next(); - bufferBuilder.vertex(matrix, xl2, y4, 0).next(); - bufferBuilder.vertex(matrix, xl2, y5, 0).next(); - bufferBuilder.vertex(matrix, x4, y5, 0).next(); - bufferBuilder.vertex(matrix, x4, y4, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y4, 0); + bufferBuilder.vertex(matrix, x3, y5, 0); + bufferBuilder.vertex(matrix, xl1, y5, 0); + bufferBuilder.vertex(matrix, xl1, y4, 0); + bufferBuilder.vertex(matrix, xl2, y4, 0); + bufferBuilder.vertex(matrix, xl2, y5, 0); + bufferBuilder.vertex(matrix, x4, y5, 0); + bufferBuilder.vertex(matrix, x4, y4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hSlider ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xl1, y4, 0).next(); - bufferBuilder.vertex(matrix, xl1, y5, 0).next(); - bufferBuilder.vertex(matrix, xl2, y5, 0).next(); - bufferBuilder.vertex(matrix, xl2, y4, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, xl1, y4, 0); + bufferBuilder.vertex(matrix, xl1, y5, 0); + bufferBuilder.vertex(matrix, xl2, y5, 0); + bufferBuilder.vertex(matrix, xl2, y4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x3, y4, 0).next(); - bufferBuilder.vertex(matrix, x3, y5, 0).next(); - bufferBuilder.vertex(matrix, x4, y5, 0).next(); - bufferBuilder.vertex(matrix, x4, y4, 0).next(); - bufferBuilder.vertex(matrix, x3, y4, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x3, y4, 0); + bufferBuilder.vertex(matrix, x3, y5, 0); + bufferBuilder.vertex(matrix, x4, y5, 0); + bufferBuilder.vertex(matrix, x4, y4, 0); + bufferBuilder.vertex(matrix, x3, y4, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawKnob(MatrixStack matrixStack, int x1, int x2, int y2, @@ -266,7 +265,6 @@ private void drawKnob(MatrixStack matrixStack, int x1, int x2, int y2, { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); double percentage = setting.getPercentage(); float xk1 = x1 + (x2 - x1 - 8) * (float)percentage; @@ -282,24 +280,24 @@ private void drawKnob(MatrixStack matrixStack, int x1, int x2, int y2, float[] c = setting.getKnobColor(); RenderSystem.setShaderColor(c[0], c[1], c[2], hSlider ? 1 : 0.75F); } - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk1, yk2, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk2, yk1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk2, 0).next(); - bufferBuilder.vertex(matrix, xk2, yk1, 0).next(); - bufferBuilder.vertex(matrix, xk1, yk1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + bufferBuilder.vertex(matrix, xk1, yk2, 0); + bufferBuilder.vertex(matrix, xk2, yk2, 0); + bufferBuilder.vertex(matrix, xk2, yk1, 0); + bufferBuilder.vertex(matrix, xk1, yk1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawNameAndValue(DrawContext context, int x1, int x2, int y1, diff --git a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java index c2e6d030ac..79a6178947 100644 --- a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java @@ -18,6 +18,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -89,7 +90,6 @@ public void render(DrawContext context, int mouseX, int mouseY, MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // tooltip @@ -101,33 +101,33 @@ else if(hBox) // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + bufferBuilder.vertex(matrix, x1, y3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); int maxLength = tr.getTextHandler().getLimitedStringLength( setting.getValue(), getWidth() - 8, Style.EMPTY); diff --git a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java index ea12819f68..ae0f6b764e 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java @@ -413,7 +413,7 @@ protected void renderItem(DrawContext context, int index, int x, int y, if(isSelectedItem(index)) drawSelectionOutline(matrixStack, x, y); - Item item = Registries.ITEM.get(new Identifier("enchanted_book")); + Item item = Registries.ITEM.get(Identifier.of("enchanted_book")); ItemStack stack = new ItemStack(item); RenderUtils.drawItem(context, stack, x + 1, y + 1, true); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java index efb4268591..18f3a88697 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java @@ -269,7 +269,7 @@ public void render(DrawContext context, int mouseX, int mouseY, int x = width / 2 - 100; int y = 64; - Item item = Registries.ITEM.get(new Identifier("enchanted_book")); + Item item = Registries.ITEM.get(Identifier.of("enchanted_book")); ItemStack stack = new ItemStack(item); RenderUtils.drawItem(context, stack, x + 1, y + 1, true); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java index a44b7c54e8..b2f150fb63 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java @@ -264,7 +264,7 @@ protected void renderItem(DrawContext context, int index, int x, int y, if(isSelectedItem(index)) drawSelectionOutline(matrixStack, x, y); - Item item = Registries.ITEM.get(new Identifier("enchanted_book")); + Item item = Registries.ITEM.get(Identifier.of("enchanted_book")); ItemStack stack = new ItemStack(item); RenderUtils.drawItem(context, stack, x + 1, y + 1, true); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java index 4a7371fa4a..abb8ecf326 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java @@ -42,7 +42,7 @@ public final class EditColorScreen extends Screen private ButtonWidget doneButton; private final Identifier paletteIdentifier = - new Identifier("wurst", "colorpalette.png"); + Identifier.of("wurst", "colorpalette.png"); private BufferedImage paletteAsBufferedImage; private int paletteX = 0; diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java index a1a21b0e2a..d4304e13e0 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java @@ -276,7 +276,7 @@ protected void renderItem(DrawContext context, int index, int x, int y, int var4, int var5, int var6, float partialTicks) { String name = list.get(index); - Item item = Registries.ITEM.get(new Identifier(name)); + Item item = Registries.ITEM.get(Identifier.of(name)); ItemStack stack = new ItemStack(item); TextRenderer tr = mc.textRenderer; diff --git a/src/main/java/net/wurstclient/commands/BlockListCmd.java b/src/main/java/net/wurstclient/commands/BlockListCmd.java index e2c66b0a79..f4ef45a4b2 100644 --- a/src/main/java/net/wurstclient/commands/BlockListCmd.java +++ b/src/main/java/net/wurstclient/commands/BlockListCmd.java @@ -182,7 +182,7 @@ private Block getBlockFromNameOrID(String nameOrId) try { - return Registries.BLOCK.getOrEmpty(new Identifier(nameOrId)) + return Registries.BLOCK.getOrEmpty(Identifier.of(nameOrId)) .orElse(null); }catch(InvalidIdentifierException e) diff --git a/src/main/java/net/wurstclient/commands/GiveCmd.java b/src/main/java/net/wurstclient/commands/GiveCmd.java index 8cfc07ecf4..536b76ec26 100644 --- a/src/main/java/net/wurstclient/commands/GiveCmd.java +++ b/src/main/java/net/wurstclient/commands/GiveCmd.java @@ -103,7 +103,7 @@ private Item getItem(String id) throws CmdSyntaxError { try { - return Registries.ITEM.get(new Identifier(id)); + return Registries.ITEM.get(Identifier.of(id)); }catch(InvalidIdentifierException e) { diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index 9f55986852..54f690f9bc 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -143,7 +143,7 @@ private RegistryEntry parseEffect(String input) else try { - Identifier identifier = new Identifier(input); + Identifier identifier = Identifier.of(input); effect = Registries.STATUS_EFFECT.get(identifier); }catch(InvalidIdentifierException e) diff --git a/src/main/java/net/wurstclient/commands/SetBlockCmd.java b/src/main/java/net/wurstclient/commands/SetBlockCmd.java index f1f857b9e4..644e945585 100644 --- a/src/main/java/net/wurstclient/commands/SetBlockCmd.java +++ b/src/main/java/net/wurstclient/commands/SetBlockCmd.java @@ -87,7 +87,7 @@ private Block getBlockFromNameOrID(String nameOrId) try { - return Registries.BLOCK.getOrEmpty(new Identifier(nameOrId)) + return Registries.BLOCK.getOrEmpty(Identifier.of(nameOrId)) .orElse(null); }catch(InvalidIdentifierException e) diff --git a/src/main/java/net/wurstclient/commands/TacoCmd.java b/src/main/java/net/wurstclient/commands/TacoCmd.java index 19f836515f..27f795b9bc 100644 --- a/src/main/java/net/wurstclient/commands/TacoCmd.java +++ b/src/main/java/net/wurstclient/commands/TacoCmd.java @@ -25,10 +25,10 @@ public final class TacoCmd extends Command implements GUIRenderListener, UpdateListener { private final Identifier[] tacos = - {new Identifier("wurst", "dancingtaco1.png"), - new Identifier("wurst", "dancingtaco2.png"), - new Identifier("wurst", "dancingtaco3.png"), - new Identifier("wurst", "dancingtaco4.png")}; + {Identifier.of("wurst", "dancingtaco1.png"), + Identifier.of("wurst", "dancingtaco2.png"), + Identifier.of("wurst", "dancingtaco3.png"), + Identifier.of("wurst", "dancingtaco4.png")}; private boolean enabled; private int ticks = 0; diff --git a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java index 1ccfad96b9..1b9f6a1e90 100644 --- a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java @@ -17,10 +17,10 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -206,15 +206,14 @@ public void onUpdate() vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); for(int[] vertex : vertices) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()).next(); + vertex[2] - region.z()); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); diff --git a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java index 8d4ea37051..9cf9985a95 100644 --- a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java +++ b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java @@ -22,6 +22,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -266,7 +267,6 @@ public void onRenderGUI(DrawContext context, float partialTicks) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); String message; if(velocity < 1) @@ -285,13 +285,13 @@ public void onRenderGUI(DrawContext context, float partialTicks) // background RenderSystem.setShader(GameRenderer::getPositionProgram); RenderSystem.setShaderColor(0, 0, 0, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, msgWidth + 3, 0, 0).next(); - bufferBuilder.vertex(matrix, msgWidth + 3, 10, 0).next(); - bufferBuilder.vertex(matrix, 0, 10, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, msgWidth + 3, 0, 0); + bufferBuilder.vertex(matrix, msgWidth + 3, 10, 0); + bufferBuilder.vertex(matrix, 0, 10, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // text RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java b/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java index 875adf16b1..f9d6d0c822 100644 --- a/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java +++ b/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java @@ -26,7 +26,7 @@ public CameraDistanceHack() addSetting(distance); } - public double getDistance() + public float getDistance() { return distance.getValueF(); } diff --git a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java index 4a35d74b80..41752f9a45 100644 --- a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java @@ -20,11 +20,11 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.block.Blocks; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -255,16 +255,15 @@ else if(notify) private void setBufferFromTask() { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); for(int[] vertex : compileVerticesTask.join()) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()).next(); + vertex[2] - region.z()); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); if(vertexBuffer != null) vertexBuffer.close(); diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 752428cf10..28ac6eb0fd 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -23,6 +23,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -339,7 +340,6 @@ public void onRenderGUI(DrawContext context, float partialTicks) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); String message; if(step.selectPos && step.pos != null) @@ -358,13 +358,13 @@ public void onRenderGUI(DrawContext context, float partialTicks) // background RenderSystem.setShader(GameRenderer::getPositionProgram); RenderSystem.setShaderColor(0, 0, 0, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, msgWidth + 2, 0, 0).next(); - bufferBuilder.vertex(matrix, msgWidth + 2, 10, 0).next(); - bufferBuilder.vertex(matrix, 0, 10, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, msgWidth + 2, 0, 0); + bufferBuilder.vertex(matrix, msgWidth + 2, 10, 0); + bufferBuilder.vertex(matrix, 0, 10, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // text RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index dd86ee48c4..5dafb9e39c 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -18,6 +18,7 @@ import net.minecraft.client.option.GameOptions; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -212,17 +213,14 @@ public void onRender(MatrixStack matrixStack, float partialTicks) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder - .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .next(); - bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, + (float)start.z); + bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, (float)end.z); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); matrixStack.pop(); diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index c18fe37aee..314d07c84d 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -16,6 +16,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -165,27 +166,24 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); Vec3d regionVec = region.toVec3d(); Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionVec); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(ItemEntity e : items) { Vec3d end = EntityUtils.getLerpedBox(e, partialTicks).getCenter() .subtract(regionVec); - bufferBuilder - .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .next(); - bufferBuilder - .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .next(); + bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, + (float)start.z); + bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, + (float)end.z); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } } diff --git a/src/main/java/net/wurstclient/hacks/LsdHack.java b/src/main/java/net/wurstclient/hacks/LsdHack.java index 8f33242b0d..edf4d75544 100644 --- a/src/main/java/net/wurstclient/hacks/LsdHack.java +++ b/src/main/java/net/wurstclient/hacks/LsdHack.java @@ -35,7 +35,7 @@ protected void onEnable() MC.gameRenderer.disablePostProcessor(); MC.gameRenderer - .loadPostProcessor(new Identifier("shaders/post/lsd.json")); + .loadPostProcessor(Identifier.of("shaders/post/lsd.json")); } @Override diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 5fafbe62ec..16402baa0b 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -20,6 +20,7 @@ import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -205,9 +206,8 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION_COLOR); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); Vec3d regionVec = region.toVec3d(); Vec3d start = RotationUtils.getClientLookVec(partialTicks) @@ -224,13 +224,13 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, bufferBuilder .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .color(r, g, 0, 0.5F).next(); + .color(r, g, 0, 0.5F); bufferBuilder .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .color(r, g, 0, 0.5F).next(); + .color(r, g, 0, 0.5F); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } } diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index f4dba282cd..601f8132eb 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -17,11 +17,11 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.block.BlockState; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -299,26 +299,25 @@ private void compileBuffer() vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION_COLOR); + BufferBuilder bufferBuilder = + tessellator.method_60827(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION_COLOR); new ArrayList<>(red).stream().filter(Objects::nonNull) .map(pos -> new BlockPos(pos.getX() - region.x(), pos.getY(), pos.getZ() - region.z())) .forEach(pos -> { bufferBuilder - .vertex(pos.getX(), pos.getY() + 0.01, pos.getZ()) - .color(1, 0, 0, 0.5F).next(); - bufferBuilder.vertex(pos.getX() + 1, pos.getY() + 0.01, - pos.getZ() + 1).color(1, 0, 0, 0.5F).next(); + .vertex(pos.getX(), pos.getY() + 0.01F, pos.getZ()) + .color(1, 0, 0, 0.5F); + bufferBuilder.vertex(pos.getX() + 1, pos.getY() + 0.01F, + pos.getZ() + 1).color(1, 0, 0, 0.5F); bufferBuilder - .vertex(pos.getX() + 1, pos.getY() + 0.01, pos.getZ()) - .color(1, 0, 0, 0.5F).next(); + .vertex(pos.getX() + 1, pos.getY() + 0.01F, pos.getZ()) + .color(1, 0, 0, 0.5F); bufferBuilder - .vertex(pos.getX(), pos.getY() + 0.01, pos.getZ() + 1) - .color(1, 0, 0, 0.5F).next(); + .vertex(pos.getX(), pos.getY() + 0.01F, pos.getZ() + 1) + .color(1, 0, 0, 0.5F); }); new ArrayList<>(yellow).stream().filter(Objects::nonNull) @@ -326,19 +325,19 @@ private void compileBuffer() pos.getZ() - region.z())) .forEach(pos -> { bufferBuilder - .vertex(pos.getX(), pos.getY() + 0.01, pos.getZ()) - .color(1, 1, 0, 0.5F).next(); - bufferBuilder.vertex(pos.getX() + 1, pos.getY() + 0.01, - pos.getZ() + 1).color(1, 1, 0, 0.5F).next(); + .vertex(pos.getX(), pos.getY() + 0.01F, pos.getZ()) + .color(1, 1, 0, 0.5F); + bufferBuilder.vertex(pos.getX() + 1, pos.getY() + 0.01F, + pos.getZ() + 1).color(1, 1, 0, 0.5F); bufferBuilder - .vertex(pos.getX() + 1, pos.getY() + 0.01, pos.getZ()) - .color(1, 1, 0, 0.5F).next(); + .vertex(pos.getX() + 1, pos.getY() + 0.01F, pos.getZ()) + .color(1, 1, 0, 0.5F); bufferBuilder - .vertex(pos.getX(), pos.getY() + 0.01, pos.getZ() + 1) - .color(1, 1, 0, 0.5F).next(); + .vertex(pos.getX(), pos.getY() + 0.01F, pos.getZ() + 1) + .color(1, 1, 0, 0.5F); }); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index e6fed98239..ffcc5f8e60 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -18,6 +18,7 @@ import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -178,15 +179,17 @@ private void renderBoxes(MatrixStack matrixStack, float partialTicks, private void renderTracers(MatrixStack matrixStack, float partialTicks, RegionPos region) { + if(players.isEmpty()) + return; + RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION_COLOR); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); Vec3d regionVec = region.toVec3d(); Vec3d start = RotationUtils.getClientLookVec(partialTicks) @@ -215,13 +218,13 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, bufferBuilder .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .color(r, g, b, 0.5F).next(); + .color(r, g, b, 0.5F); bufferBuilder .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .color(r, g, b, 0.5F).next(); + .color(r, g, b, 0.5F); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } } diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index 91bef2f68f..213dac7c7d 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -19,11 +19,11 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.block.Block; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -258,16 +258,15 @@ else if(notify) private void setBufferFromTask() { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); for(int[] vertex : compileVerticesTask.join()) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()).next(); + vertex[2] - region.z()); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); if(vertexBuffer != null) vertexBuffer.close(); diff --git a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java index 32d7a0752c..fea32f78e2 100644 --- a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java +++ b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java @@ -18,6 +18,7 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -119,24 +120,24 @@ public void onRender(MatrixStack matrixStack, float partialTicks) private void drawLine(MatrixStack matrixStack, ArrayList path, ColorSetting color) { + if(path.isEmpty()) + return; + Vec3d camPos = RenderUtils.getCameraPos(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); float[] colorF = color.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.75F); for(Vec3d point : path) - bufferBuilder - .vertex(matrix, (float)(point.x - camPos.x), - (float)(point.y - camPos.y), (float)(point.z - camPos.z)) - .next(); + bufferBuilder.vertex(matrix, (float)(point.x - camPos.x), + (float)(point.y - camPos.y), (float)(point.z - camPos.z)); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private void drawEndOfLine(MatrixStack matrixStack, Vec3d end, diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 81c6078e14..55ce73e9a6 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -17,6 +17,7 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -28,7 +29,6 @@ import net.minecraft.client.option.GameOptions; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -272,9 +272,8 @@ private void updateCyanBuffer() vertexBuffers[0] = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); Vec3d offset = Vec3d.ofCenter(start).subtract(region.toVec3d()); @@ -289,7 +288,7 @@ private void updateCyanBuffer() .multiply(Math.max(0.5, length)).add(offset); RenderUtils.drawArrow(arrowStart, arrowEnd, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffers[0].bind(); vertexBuffers[0].upload(buffer); VertexBuffer.unbind(); @@ -394,9 +393,8 @@ public void run() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); currentBlock = null; for(BlockPos pos : blocks) @@ -414,7 +412,7 @@ public void run() RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); } - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffers[1].bind(); vertexBuffers[1].upload(buffer); VertexBuffer.unbind(); @@ -505,14 +503,13 @@ public boolean canRun() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocks) RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffers[2].bind(); vertexBuffers[2].upload(buffer); VertexBuffer.unbind(); @@ -647,14 +644,13 @@ public boolean canRun() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : liquids) RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffers[3].bind(); vertexBuffers[3].upload(buffer); diff --git a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java index f6af0559b6..eabd13b5bb 100644 --- a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java +++ b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java @@ -17,11 +17,12 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.math.MatrixStack; @@ -95,9 +96,7 @@ public void render(MatrixStack matrixStack) public void updateVertexBuffers(List blocksToHarvest, Set plants, List blocksToReplant) { - BufferBuilder bufferBuilder = - RenderSystem.renderThreadTesselator().getBuffer(); - + Tessellator tessellator = RenderSystem.renderThreadTesselator(); Vec3d regionOffset = RenderUtils.getCameraRegion().negate().toVec3d(); double boxMin = 1 / 16.0; @@ -105,20 +104,20 @@ public void updateVertexBuffers(List blocksToHarvest, Box box = new Box(boxMin, boxMin, boxMin, boxMax, boxMax, boxMax); Box node = new Box(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); - updateGreenBuffer(blocksToHarvest, bufferBuilder, box, regionOffset); - updateCyanBuffer(plants, bufferBuilder, node, regionOffset); - updateRedBuffer(blocksToReplant, bufferBuilder, box, regionOffset); + updateGreenBuffer(blocksToHarvest, tessellator, box, regionOffset); + updateCyanBuffer(plants, tessellator, node, regionOffset); + updateRedBuffer(blocksToReplant, tessellator, box, regionOffset); } private void updateGreenBuffer(List blocksToHarvest, - BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) + Tessellator tessellator, Box box, Vec3d regionOffset) { if(greenBuffer != null) greenBuffer.close(); greenBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToHarvest) { @@ -126,21 +125,21 @@ private void updateGreenBuffer(List blocksToHarvest, RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); } - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); greenBuffer.bind(); greenBuffer.upload(buffer); VertexBuffer.unbind(); } - private void updateCyanBuffer(Set plants, - BufferBuilder bufferBuilder, Box node, Vec3d regionOffset) + private void updateCyanBuffer(Set plants, Tessellator tessellator, + Box node, Vec3d regionOffset) { if(cyanBuffer != null) cyanBuffer.close(); cyanBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : plants) { @@ -148,21 +147,21 @@ private void updateCyanBuffer(Set plants, RenderUtils.drawNode(renderNode, bufferBuilder); } - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); cyanBuffer.bind(); cyanBuffer.upload(buffer); VertexBuffer.unbind(); } private void updateRedBuffer(List blocksToReplant, - BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) + Tessellator tessellator, Box box, Vec3d regionOffset) { if(redBuffer != null) redBuffer.close(); redBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToReplant) { @@ -170,7 +169,7 @@ private void updateRedBuffer(List blocksToReplant, RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); } - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); redBuffer.bind(); redBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java index 9c0fe41524..3952f7b47f 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java @@ -16,6 +16,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -131,7 +132,6 @@ private void drawLastBite(MatrixStack matrixStack, RegionPos region) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); matrixStack.push(); @@ -141,13 +141,13 @@ private void drawLastBite(MatrixStack matrixStack, RegionPos region) float[] colorF = ddColor.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, -0.125F, 0, -0.125F).next(); - bufferBuilder.vertex(matrix, 0.125F, 0, 0.125F).next(); - bufferBuilder.vertex(matrix, 0.125F, 0, -0.125F).next(); - bufferBuilder.vertex(matrix, -0.125F, 0, 0.125F).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, -0.125F, 0, -0.125F); + bufferBuilder.vertex(matrix, 0.125F, 0, 0.125F); + bufferBuilder.vertex(matrix, 0.125F, 0, -0.125F); + bufferBuilder.vertex(matrix, -0.125F, 0, 0.125F); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); matrixStack.pop(); } diff --git a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java index 1a03adcaaa..095c067f46 100644 --- a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java +++ b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java @@ -41,7 +41,7 @@ public Optional> getEnchantmentEntry() DynamicRegistryManager drm = WurstClient.MC.world.getRegistryManager(); Registry registry = drm.get(RegistryKeys.ENCHANTMENT); - return registry.getEntry(new Identifier(id)); + return registry.getEntry(Identifier.of(id)); } public Enchantment getEnchantment() diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java index 10fcad978d..97cf13556a 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java @@ -17,6 +17,7 @@ import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -81,28 +82,25 @@ public void renderLines(ChestEspGroup group) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) { Vec3d end = box.getCenter().subtract(region.toVec3d()); - bufferBuilder - .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .next(); + bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, + (float)start.z); - bufferBuilder - .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .next(); + bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, + (float)end.z); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void prepareBuffers() diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java index a80173910a..10365369e0 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java @@ -9,10 +9,10 @@ import java.util.Set; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; +import net.minecraft.class_9801; import net.minecraft.util.math.ChunkPos; public interface NewChunksChunkRenderer { - public BuiltBuffer buildBuffer(Set chunks, int drawDistance); + public class_9801 buildBuffer(Set chunks, int drawDistance); } diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java index e4d82fd577..0640b5c259 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java @@ -13,8 +13,8 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -26,15 +26,13 @@ public final class NewChunksOutlineRenderer implements NewChunksChunkRenderer { @Override - public BuiltBuffer buildBuffer(Set chunks, int drawDistance) + public class_9801 buildBuffer(Set chunks, int drawDistance) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.end(); + return bufferBuilder.method_60800(); } private void renderChunks(List chunks, int drawDistance, @@ -55,17 +53,17 @@ private void renderChunks(List chunks, int drawDistance, float z1 = blockPos.getZ() + 0.5F; float z2 = z1 + 15; - bufferBuilder.vertex(x1, 0, z1).next(); - bufferBuilder.vertex(x2, 0, z1).next(); + bufferBuilder.vertex(x1, 0, z1); + bufferBuilder.vertex(x2, 0, z1); - bufferBuilder.vertex(x2, 0, z1).next(); - bufferBuilder.vertex(x2, 0, z2).next(); + bufferBuilder.vertex(x2, 0, z1); + bufferBuilder.vertex(x2, 0, z2); - bufferBuilder.vertex(x2, 0, z2).next(); - bufferBuilder.vertex(x1, 0, z2).next(); + bufferBuilder.vertex(x2, 0, z2); + bufferBuilder.vertex(x1, 0, z2); - bufferBuilder.vertex(x1, 0, z2).next(); - bufferBuilder.vertex(x1, 0, z1).next(); + bufferBuilder.vertex(x1, 0, z2); + bufferBuilder.vertex(x1, 0, z1); } } } diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java index 9702033e5f..210d463125 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java @@ -13,8 +13,8 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -34,15 +34,13 @@ public NewChunksReasonsRenderer(SliderSetting drawDistance) this.drawDistance = drawDistance; } - public BuiltBuffer buildBuffer(Set reasons) + public class_9801 buildBuffer(Set reasons) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); renderBlocks(new ArrayList<>(reasons), bufferBuilder); - return bufferBuilder.end(); + return bufferBuilder.method_60800(); } private void renderBlocks(List blocks, @@ -66,35 +64,35 @@ private void renderBlocks(List blocks, float maxY = (float)bb.maxY; float maxZ = (float)bb.maxZ; - bufferBuilder.vertex(minX, minY, minZ).next(); - bufferBuilder.vertex(maxX, minY, minZ).next(); - bufferBuilder.vertex(maxX, minY, maxZ).next(); - bufferBuilder.vertex(minX, minY, maxZ).next(); + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(minX, minY, maxZ); - bufferBuilder.vertex(minX, maxY, minZ).next(); - bufferBuilder.vertex(minX, maxY, maxZ).next(); - bufferBuilder.vertex(maxX, maxY, maxZ).next(); - bufferBuilder.vertex(maxX, maxY, minZ).next(); + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(minX, maxY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(maxX, maxY, minZ); - bufferBuilder.vertex(minX, minY, minZ).next(); - bufferBuilder.vertex(minX, maxY, minZ).next(); - bufferBuilder.vertex(maxX, maxY, minZ).next(); - bufferBuilder.vertex(maxX, minY, minZ).next(); + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(maxX, minY, minZ); - bufferBuilder.vertex(maxX, minY, minZ).next(); - bufferBuilder.vertex(maxX, maxY, minZ).next(); - bufferBuilder.vertex(maxX, maxY, maxZ).next(); - bufferBuilder.vertex(maxX, minY, maxZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(maxX, minY, maxZ); - bufferBuilder.vertex(minX, minY, maxZ).next(); - bufferBuilder.vertex(maxX, minY, maxZ).next(); - bufferBuilder.vertex(maxX, maxY, maxZ).next(); - bufferBuilder.vertex(minX, maxY, maxZ).next(); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(minX, minY, minZ).next(); - bufferBuilder.vertex(minX, minY, maxZ).next(); - bufferBuilder.vertex(minX, maxY, maxZ).next(); - bufferBuilder.vertex(minX, maxY, minZ).next(); + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, minZ); } } } diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java index 3f86b0842b..b5e0f57c84 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java @@ -12,9 +12,9 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; import net.wurstclient.settings.ColorSetting; @@ -39,7 +39,7 @@ public NewChunksRenderer(SliderSetting altitude, SliderSetting opacity, this.oldChunksColor = oldChunksColor; } - public void updateBuffer(int i, BuiltBuffer buffer) + public void updateBuffer(int i, class_9801 buffer) { vertexBuffers[i] = new VertexBuffer(VertexBuffer.Usage.STATIC); vertexBuffers[i].bind(); diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java index 2a2ecd515f..d15e6d941b 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java @@ -13,8 +13,8 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -26,15 +26,13 @@ public final class NewChunksSquareRenderer implements NewChunksChunkRenderer { @Override - public BuiltBuffer buildBuffer(Set chunks, int drawDistance) + public class_9801 buildBuffer(Set chunks, int drawDistance) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.end(); + return bufferBuilder.method_60800(); } private void renderChunks(List chunks, int drawDistance, @@ -55,10 +53,10 @@ private void renderChunks(List chunks, int drawDistance, float z1 = blockPos.getZ() + 0.5F; float z2 = z1 + 15; - bufferBuilder.vertex(x1, 0, z1).next(); - bufferBuilder.vertex(x2, 0, z1).next(); - bufferBuilder.vertex(x2, 0, z2).next(); - bufferBuilder.vertex(x1, 0, z2).next(); + bufferBuilder.vertex(x1, 0, z1); + bufferBuilder.vertex(x2, 0, z1); + bufferBuilder.vertex(x2, 0, z2); + bufferBuilder.vertex(x1, 0, z2); } } } diff --git a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java index 34d0696e5a..2aa4a2e2e0 100644 --- a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java @@ -17,6 +17,7 @@ import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -81,28 +82,25 @@ public void renderLines(PortalEspBlockGroup group) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) { Vec3d end = box.getCenter().subtract(region.toVec3d()); - bufferBuilder - .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .next(); + bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, + (float)start.z); - bufferBuilder - .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .next(); + bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, + (float)end.z); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void prepareBuffers() diff --git a/src/main/java/net/wurstclient/hacks/treebot/Tree.java b/src/main/java/net/wurstclient/hacks/treebot/Tree.java index de6093f3cf..a77b6b92ae 100644 --- a/src/main/java/net/wurstclient/hacks/treebot/Tree.java +++ b/src/main/java/net/wurstclient/hacks/treebot/Tree.java @@ -14,10 +14,10 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -55,16 +55,15 @@ public void compileBuffer() .offset(regionOffset); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RenderUtils.drawCrossBox(box.offset(stump), bufferBuilder); for(BlockPos log : logs) RenderUtils.drawOutlinedBox(box.offset(log), bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hud/TabGui.java b/src/main/java/net/wurstclient/hud/TabGui.java index e839843130..13431e648f 100644 --- a/src/main/java/net/wurstclient/hud/TabGui.java +++ b/src/main/java/net/wurstclient/hud/TabGui.java @@ -18,6 +18,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -217,7 +218,6 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // color @@ -225,15 +225,15 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, opacity); // box - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); { - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline positions float xi1 = x1 - 0.1F; @@ -244,16 +244,16 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, // outline GL11.glLineWidth(1); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); { - bufferBuilder.vertex(matrix, xi1, yi1, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi2, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi1, 0).next(); + bufferBuilder.vertex(matrix, xi1, yi1, 0); + bufferBuilder.vertex(matrix, xi2, yi1, 0); + bufferBuilder.vertex(matrix, xi2, yi2, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0); + bufferBuilder.vertex(matrix, xi1, yi1, 0); } - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // shadow positions xi1 -= 0.9; @@ -265,42 +265,42 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, RenderSystem.setShaderColor(1, 1, 1, 1); // top left - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); // top - bufferBuilder.vertex(matrix, x1, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0).next(); + bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0); // left - bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x1, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); + bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, x1, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); // right - bufferBuilder.vertex(matrix, x2, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0).next(); + bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0); // bottom - bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - - tessellator.draw(); + bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, x1, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } private static final class Tab diff --git a/src/main/java/net/wurstclient/hud/WurstLogo.java b/src/main/java/net/wurstclient/hud/WurstLogo.java index 1875d9398a..4ee3eb4e59 100644 --- a/src/main/java/net/wurstclient/hud/WurstLogo.java +++ b/src/main/java/net/wurstclient/hud/WurstLogo.java @@ -15,6 +15,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -27,7 +28,7 @@ public final class WurstLogo { private static final Identifier texture = - new Identifier("wurst", "wurst_128.png"); + Identifier.of("wurst", "wurst_128.png"); public void render(DrawContext context) { @@ -81,13 +82,12 @@ private void drawQuads(MatrixStack matrices, int x1, int y1, int x2, int y2, RenderSystem.setShader(GameRenderer::getPositionColorProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(matrix, x1, y2, 0.0F).color(r, g, b, a).next(); - bufferBuilder.vertex(matrix, x2, y2, 0.0F).color(r, g, b, a).next(); - bufferBuilder.vertex(matrix, x2, y1, 0.0F).color(r, g, b, a).next(); - bufferBuilder.vertex(matrix, x1, y1, 0.0F).color(r, g, b, a).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + bufferBuilder.vertex(matrix, x1, y2, 0.0F).color(r, g, b, a); + bufferBuilder.vertex(matrix, x2, y2, 0.0F).color(r, g, b, a); + bufferBuilder.vertex(matrix, x2, y1, 0.0F).color(r, g, b, a); + bufferBuilder.vertex(matrix, x1, y1, 0.0F).color(r, g, b, a); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } } diff --git a/src/main/java/net/wurstclient/mixin/CameraMixin.java b/src/main/java/net/wurstclient/mixin/CameraMixin.java index d28d75158e..5b0ad170c1 100644 --- a/src/main/java/net/wurstclient/mixin/CameraMixin.java +++ b/src/main/java/net/wurstclient/mixin/CameraMixin.java @@ -22,9 +22,9 @@ public abstract class CameraMixin { @ModifyVariable(at = @At("HEAD"), - method = "clipToSpace(D)D", + method = "clipToSpace(F)F", argsOnly = true) - private double changeClipToSpaceDistance(double desiredCameraDistance) + private float changeClipToSpaceDistance(float desiredCameraDistance) { CameraDistanceHack cameraDistance = WurstClient.INSTANCE.getHax().cameraDistanceHack; @@ -34,9 +34,9 @@ private double changeClipToSpaceDistance(double desiredCameraDistance) return desiredCameraDistance; } - @Inject(at = @At("HEAD"), method = "clipToSpace(D)D", cancellable = true) - private void onClipToSpace(double desiredCameraDistance, - CallbackInfoReturnable cir) + @Inject(at = @At("HEAD"), method = "clipToSpace(F)F", cancellable = true) + private void onClipToSpace(float desiredCameraDistance, + CallbackInfoReturnable cir) { if(WurstClient.INSTANCE.getHax().cameraNoClipHack.isEnabled()) cir.setReturnValue(desiredCameraDistance); diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java index 8ea4175bb3..5800c942a3 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java @@ -163,8 +163,8 @@ private void onIsAutoJumpEnabled(CallbackInfoReturnable cir) @Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", opcode = Opcodes.GETFIELD, - ordinal = 0), method = "updateNausea()V") - private void beforeUpdateNausea(CallbackInfo ci) + ordinal = 0), method = "tickNausea(Z)V") + private void beforeTickNausea(boolean fromPortalEffect, CallbackInfo ci) { if(!WurstClient.INSTANCE.getHax().portalGuiHack.isEnabled()) return; @@ -180,8 +180,8 @@ private void beforeUpdateNausea(CallbackInfo ci) @Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerEntity;nauseaIntensity:F", opcode = Opcodes.GETFIELD, - ordinal = 1), method = "updateNausea()V") - private void afterUpdateNausea(CallbackInfo ci) + ordinal = 1), method = "tickNausea(Z)V") + private void afterTickNausea(boolean fromPortalEffect, CallbackInfo ci) { if(tempCurrentScreen == null) return; diff --git a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java index 705738e19c..0c47703f32 100644 --- a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java @@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.minecraft.class_9812; import net.minecraft.client.gui.screen.DisconnectedScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; @@ -35,7 +36,7 @@ public class DisconnectedScreenMixin extends Screen @Shadow @Final - private Text reason; + private class_9812 field_52131;// reason container thing @Shadow @Final private Screen parent; @@ -54,6 +55,7 @@ private void onInit(CallbackInfo ci) if(!WurstClient.INSTANCE.isEnabled()) return; + Text reason = field_52131.reason(); System.out.println("Disconnected: " + reason); if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) diff --git a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java index d7e72da5a7..c21da6bfab 100644 --- a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java @@ -35,7 +35,7 @@ public abstract class GameMenuScreenMixin extends Screen { private static final Identifier WURST_TEXTURE = - new Identifier("wurst", "wurst_128.png"); + Identifier.of("wurst", "wurst_128.png"); private ButtonWidget wurstOptionsButton; diff --git a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java index dff77e6153..729da57359 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java @@ -26,6 +26,7 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ClickableWidget; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -374,27 +375,26 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // window background // left & right setColorToBackground(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y3, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y2, 0).next(); - bufferBuilder.vertex(matrix, x3, y3, 0).next(); - bufferBuilder.vertex(matrix, x5, y3, 0).next(); - bufferBuilder.vertex(matrix, x5, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x2, y3, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y3, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + bufferBuilder.vertex(matrix, x3, y2, 0); + bufferBuilder.vertex(matrix, x3, y3, 0); + bufferBuilder.vertex(matrix, x5, y3, 0); + bufferBuilder.vertex(matrix, x5, y2, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x2, y3, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); setColorToBackground(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); // window background // between children @@ -409,10 +409,10 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, if(yc2 > bgy3 - windowY1) break; - bufferBuilder.vertex(matrix, xc1, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); + bufferBuilder.vertex(matrix, xc1, yc2, 0); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); } // window background @@ -427,12 +427,12 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, yc1 = lastChild.getY() + lastChild.getHeight(); } int yc2 = yc1 + 2; - bufferBuilder.vertex(matrix, xc1, yc2, 0).next(); - bufferBuilder.vertex(matrix, xc1, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc1, 0).next(); - bufferBuilder.vertex(matrix, xc2, yc2, 0).next(); + bufferBuilder.vertex(matrix, xc1, yc2, 0); + bufferBuilder.vertex(matrix, xc1, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc1, 0); + bufferBuilder.vertex(matrix, xc2, yc2, 0); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } for(int i = 0; i < window.countChildren(); i++) diff --git a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java index 94cdd7c882..648b5cc910 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java @@ -21,6 +21,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -297,31 +298,30 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], 0.75F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt2, 0).next(); - bufferBuilder.vertex(matrix, xt2, yt1, 0).next(); - bufferBuilder.vertex(matrix, xt1, yt1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt2, 0); + bufferBuilder.vertex(matrix, xt2, yt1, 0); + bufferBuilder.vertex(matrix, xt1, yt1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -420,7 +420,6 @@ else if(clickTimer == 0) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // separator @@ -429,11 +428,11 @@ else if(clickTimer == 0) int by2 = by1 + area.height - 4; float[] acColor = WurstClient.INSTANCE.getGui().getAcColor(); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, bx1, by1, 0).next(); - bufferBuilder.vertex(matrix, bx1, by2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, bx1, by1, 0); + bufferBuilder.vertex(matrix, bx1, by2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // hovering if(hovering) @@ -450,22 +449,22 @@ else if(clickTimer == 0) // arrow RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1); - bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, ax1, ay1, 0).next(); - bufferBuilder.vertex(matrix, ax2, ay1, 0).next(); - bufferBuilder.vertex(matrix, ax3, ay2, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, ax1, ay1, 0); + bufferBuilder.vertex(matrix, ax2, ay1, 0); + bufferBuilder.vertex(matrix, ax3, ay2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // arrow shadow RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, ax1, ay1, 0).next(); - bufferBuilder.vertex(matrix, ax2, ay1, 0).next(); - bufferBuilder.vertex(matrix, ax3, ay2, 0).next(); - bufferBuilder.vertex(matrix, ax1, ay1, 0).next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, ax1, ay1, 0); + bufferBuilder.vertex(matrix, ax2, ay1, 0); + bufferBuilder.vertex(matrix, ax3, ay2, 0); + bufferBuilder.vertex(matrix, ax1, ay1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // text if(!clickTimerRunning) diff --git a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java index 990096863f..a6744d6fb4 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java @@ -17,6 +17,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -242,16 +243,15 @@ protected final void drawQuads(MatrixStack matrixStack, int x1, int y1, { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, y1, 0); + bufferBuilder.vertex(matrix, x2, y1, 0); + bufferBuilder.vertex(matrix, x2, y2, 0); + bufferBuilder.vertex(matrix, x1, y2, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, @@ -268,19 +268,18 @@ protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, xi1, yi1, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi2, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, xi1, yi1, 0); + bufferBuilder.vertex(matrix, xi2, yi1, 0); + bufferBuilder.vertex(matrix, xi2, yi2, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0); + bufferBuilder.vertex(matrix, xi1, yi1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // shadow positions xi1 -= 0.9; @@ -291,42 +290,42 @@ protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); // top - bufferBuilder.vertex(matrix, x1, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0).next(); + bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0); // left - bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x1, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); + bufferBuilder.vertex(matrix, xi1, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, x1, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); // right - bufferBuilder.vertex(matrix, x2, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0).next(); + bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, xi2, yi1, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0); // bottom - bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y2, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); + bufferBuilder.vertex(matrix, xi2, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, xi1, yi2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, x1, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, @@ -337,30 +336,29 @@ protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); // outline float yi1 = y1 + 0.1F; RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, yi1, 0).next(); - bufferBuilder.vertex(matrix, x2, yi1, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x1, yi1, 0); + bufferBuilder.vertex(matrix, x2, yi1, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); // shadow RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(matrix, x1, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y1, 0) - .color(acColor[0], acColor[1], acColor[2], 0.75F).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).color(0, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, x1, y2, 0).color(0, 0, 0, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y1, 0).color(acColor[0], acColor[1], + acColor[2], 0.75F); + bufferBuilder.vertex(matrix, x2, y2, 0).color(0, 0, 0, 0); + bufferBuilder.vertex(matrix, x1, y2, 0).color(0, 0, 0, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } protected final void drawBox(MatrixStack matrixStack, int x1, int y1, diff --git a/src/main/java/net/wurstclient/settings/BlockListSetting.java b/src/main/java/net/wurstclient/settings/BlockListSetting.java index ca50e67b38..597200eadd 100644 --- a/src/main/java/net/wurstclient/settings/BlockListSetting.java +++ b/src/main/java/net/wurstclient/settings/BlockListSetting.java @@ -41,7 +41,7 @@ public BlockListSetting(String name, String description, String... blocks) super(name, description); Arrays.stream(blocks).parallel() - .map(s -> Registries.BLOCK.get(new Identifier(s))) + .map(s -> Registries.BLOCK.get(Identifier.of(s))) .filter(Objects::nonNull).map(BlockUtils::getName).distinct() .sorted().forEachOrdered(s -> blockNames.add(s)); defaultNames = blockNames.toArray(new String[0]); @@ -101,7 +101,7 @@ public void fromJson(JsonElement json) // otherwise, load the blocks in the JSON array JsonUtils.getAsArray(json).getAllStrings().parallelStream() - .map(s -> Registries.BLOCK.get(new Identifier(s))) + .map(s -> Registries.BLOCK.get(Identifier.of(s))) .filter(Objects::nonNull).map(BlockUtils::getName).distinct() .sorted().forEachOrdered(s -> blockNames.add(s)); diff --git a/src/main/java/net/wurstclient/settings/ItemListSetting.java b/src/main/java/net/wurstclient/settings/ItemListSetting.java index d75c6cd324..87221b49b7 100644 --- a/src/main/java/net/wurstclient/settings/ItemListSetting.java +++ b/src/main/java/net/wurstclient/settings/ItemListSetting.java @@ -40,7 +40,7 @@ public ItemListSetting(String name, String description, String... items) super(name, description); Arrays.stream(items).parallel() - .map(s -> Registries.ITEM.get(new Identifier(s))) + .map(s -> Registries.ITEM.get(Identifier.of(s))) .filter(Objects::nonNull) .map(i -> Registries.ITEM.getId(i).toString()).distinct().sorted() .forEachOrdered(s -> itemNames.add(s)); @@ -101,7 +101,7 @@ public void fromJson(JsonElement json) // otherwise, load the items in the JSON array JsonUtils.getAsArray(json).getAllStrings().parallelStream() - .map(s -> Registries.ITEM.get(new Identifier(s))) + .map(s -> Registries.ITEM.get(Identifier.of(s))) .filter(Objects::nonNull) .map(i -> Registries.ITEM.getId(i).toString()).distinct() .sorted().forEachOrdered(s -> itemNames.add(s)); diff --git a/src/main/java/net/wurstclient/util/BlockUtils.java b/src/main/java/net/wurstclient/util/BlockUtils.java index 7c96963d0d..41f8ca741b 100644 --- a/src/main/java/net/wurstclient/util/BlockUtils.java +++ b/src/main/java/net/wurstclient/util/BlockUtils.java @@ -71,7 +71,7 @@ public static Block getBlockFromName(String name) { try { - return Registries.BLOCK.get(new Identifier(name)); + return Registries.BLOCK.get(Identifier.of(name)); }catch(InvalidIdentifierException e) { @@ -98,7 +98,7 @@ public static Block getBlockFromNameOrID(String nameOrId) try { - return Registries.BLOCK.getOrEmpty(new Identifier(nameOrId)) + return Registries.BLOCK.getOrEmpty(Identifier.of(nameOrId)) .orElse(null); }catch(InvalidIdentifierException e) diff --git a/src/main/java/net/wurstclient/util/ItemUtils.java b/src/main/java/net/wurstclient/util/ItemUtils.java index 4150aacc84..892e2e866e 100644 --- a/src/main/java/net/wurstclient/util/ItemUtils.java +++ b/src/main/java/net/wurstclient/util/ItemUtils.java @@ -48,7 +48,7 @@ public static Item getItemFromNameOrID(String nameOrId) try { - return Registries.ITEM.getOrEmpty(new Identifier(nameOrId)) + return Registries.ITEM.getOrEmpty(Identifier.of(nameOrId)) .orElse(null); }catch(InvalidIdentifierException e) diff --git a/src/main/java/net/wurstclient/util/ListWidget.java b/src/main/java/net/wurstclient/util/ListWidget.java index 83060fdde1..f0569cb4a8 100644 --- a/src/main/java/net/wurstclient/util/ListWidget.java +++ b/src/main/java/net/wurstclient/util/ListWidget.java @@ -22,6 +22,7 @@ import net.minecraft.client.gui.Drawable; import net.minecraft.client.gui.Element; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -34,7 +35,7 @@ public abstract class ListWidget extends AbstractParentElement implements Drawable { private static final Identifier MENU_LIST_BACKGROUND_TEXTURE = - new Identifier("textures/gui/menu_list_background.png"); + Identifier.of("textures/gui/menu_list_background.png"); protected final MinecraftClient client; protected int width; @@ -122,7 +123,7 @@ public int getItemAtPosition(double mouseX, double mouseY) protected void capYPosition() { - scrollAmount = MathHelper.clamp(scrollAmount, 0.0D, getMaxScroll()); + scrollAmount = MathHelper.clamp(scrollAmount, 0, getMaxScroll()); } public int getMaxScroll() @@ -146,26 +147,30 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) int j = i + 6; capYPosition(); Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.enableBlend(); RenderSystem.setShaderTexture(0, MENU_LIST_BACKGROUND_TEXTURE); - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.setShaderColor(1, 1, 1, 1); RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); - bufferBuilder.vertex(left, bottom, 0.0D) - .texture(left / 32.0F, (bottom + (int)scrollAmount) / 32.0F) - .color(32, 32, 32, 255).next(); - bufferBuilder.vertex(right, bottom, 0.0D) - .texture(right / 32.0F, (bottom + (int)scrollAmount) / 32.0F) - .color(32, 32, 32, 255).next(); - bufferBuilder.vertex(right, top, 0.0D) - .texture(right / 32.0F, (top + (int)scrollAmount) / 32.0F) - .color(32, 32, 32, 255).next(); - bufferBuilder.vertex(left, top, 0.0D) - .texture(left / 32.0F, (top + (int)scrollAmount) / 32.0F) - .color(32, 32, 32, 255).next(); - tessellator.draw(); + + BufferBuilder bufferBuilder = + tessellator.method_60827(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_TEXTURE_COLOR); + + bufferBuilder.vertex(left, bottom, 0) + .texture(left / 32, (bottom + (int)scrollAmount) / 32) + .color(32, 32, 32, 255); + bufferBuilder.vertex(right, bottom, 0) + .texture(right / 32, (bottom + (int)scrollAmount) / 32) + .color(32, 32, 32, 255); + bufferBuilder.vertex(right, top, 0) + .texture(right / 32, (top + (int)scrollAmount) / 32) + .color(32, 32, 32, 255); + bufferBuilder.vertex(left, top, 0) + .texture(left / 32, (top + (int)scrollAmount) / 32) + .color(32, 32, 32, 255); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + int k = left + width / 2 - getRowWidth() / 2 + 2; int l = top + 4 - (int)scrollAmount; if(renderHeader) @@ -181,29 +186,31 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ZERO, GlStateManager.DstFactor.ONE); - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); - bufferBuilder.vertex(left, top + 4, 0.0D).texture(0.0F, 1.0F) - .color(0, 0, 0, 0).next(); - bufferBuilder.vertex(right, top + 4, 0.0D).texture(1.0F, 1.0F) - .color(0, 0, 0, 0).next(); - bufferBuilder.vertex(right, top, 0.0D).texture(1.0F, 0.0F) - .color(0, 0, 0, 255).next(); - bufferBuilder.vertex(left, top, 0.0D).texture(0.0F, 0.0F) - .color(0, 0, 0, 255).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); - bufferBuilder.vertex(left, bottom, 0.0D).texture(0.0F, 1.0F) - .color(0, 0, 0, 255).next(); - bufferBuilder.vertex(right, bottom, 0.0D).texture(1.0F, 1.0F) - .color(0, 0, 0, 255).next(); - bufferBuilder.vertex(right, bottom - 4, 0.0D).texture(1.0F, 0.0F) - .color(0, 0, 0, 0).next(); - bufferBuilder.vertex(left, bottom - 4, 0.0D).texture(0.0F, 0.0F) - .color(0, 0, 0, 0).next(); - tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + bufferBuilder = + tessellator.method_60827(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder.vertex(left, top + 4, 0).texture(0, 1).color(0, 0, 0, + 0); + bufferBuilder.vertex(right, top + 4, 0).texture(1, 1).color(0, 0, 0, + 0); + bufferBuilder.vertex(right, top, 0).texture(1, 0).color(0, 0, 0, + 255); + bufferBuilder.vertex(left, top, 0).texture(0, 0).color(0, 0, 0, + 255); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = + tessellator.method_60827(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder.vertex(left, bottom, 0).texture(0, 1).color(0, 0, 0, + 255); + bufferBuilder.vertex(right, bottom, 0).texture(1, 1).color(0, 0, 0, + 255); + bufferBuilder.vertex(right, bottom - 4, 0).texture(1, 0).color(0, 0, + 0, 0); + bufferBuilder.vertex(left, bottom - 4, 0).texture(0, 0).color(0, 0, + 0, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); int n = getMaxScroll(); if(n > 0) { @@ -215,37 +222,31 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) p = top; RenderSystem.setShader(GameRenderer::getPositionColorProgram); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(i, bottom, 0.0D).color(0, 0, 0, 255) - .next(); - bufferBuilder.vertex(j, bottom, 0.0D).color(0, 0, 0, 255) - .next(); - bufferBuilder.vertex(j, top, 0.0D).color(0, 0, 0, 255).next(); - bufferBuilder.vertex(i, top, 0.0D).color(0, 0, 0, 255).next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(i, p + o, 0.0D).color(128, 128, 128, 255) - .next(); - bufferBuilder.vertex(j, p + o, 0.0D).color(128, 128, 128, 255) - .next(); - bufferBuilder.vertex(j, p, 0.0D).color(128, 128, 128, 255) - .next(); - bufferBuilder.vertex(i, p, 0.0D).color(128, 128, 128, 255) - .next(); - tessellator.draw(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(i, p + o - 1, 0.0D) - .color(192, 192, 192, 255).next(); - bufferBuilder.vertex(j - 1, p + o - 1, 0.0D) - .color(192, 192, 192, 255).next(); - bufferBuilder.vertex(j - 1, p, 0.0D).color(192, 192, 192, 255) - .next(); - bufferBuilder.vertex(i, p, 0.0D).color(192, 192, 192, 255) - .next(); - tessellator.draw(); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + bufferBuilder.vertex(i, bottom, 0).color(0, 0, 0, 255); + bufferBuilder.vertex(j, bottom, 0).color(0, 0, 0, 255); + bufferBuilder.vertex(j, top, 0).color(0, 0, 0, 255); + bufferBuilder.vertex(i, top, 0).color(0, 0, 0, 255); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + bufferBuilder.vertex(i, p + o, 0).color(128, 128, 128, 255); + bufferBuilder.vertex(j, p + o, 0).color(128, 128, 128, 255); + bufferBuilder.vertex(j, p, 0).color(128, 128, 128, 255); + bufferBuilder.vertex(i, p, 0).color(128, 128, 128, 255); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + bufferBuilder.vertex(i, p + o - 1, 0).color(192, 192, 192, 255); + bufferBuilder.vertex(j - 1, p + o - 1, 0).color(192, 192, 192, + 255); + bufferBuilder.vertex(j - 1, p, 0).color(192, 192, 192, 255); + bufferBuilder.vertex(i, p, 0).color(192, 192, 192, 255); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); } renderDecorations(mouseX, mouseY); @@ -301,21 +302,21 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, if(!isVisible() || button != 0 || !scrolling) return false; if(mouseY < top) - scrollAmount = 0.0D; + scrollAmount = 0.0; else if(mouseY > bottom) scrollAmount = getMaxScroll(); else { double d = getMaxScroll(); - if(d < 1.0D) - d = 1.0D; + if(d < 1.0) + d = 1.0; int i = (int)((float)((bottom - top) * (bottom - top)) / (float)getMaxPosition()); i = MathHelper.clamp(i, 32, bottom - top - 8); double e = d / (bottom - top - i); - if(e < 1.0D) - e = 1.0D; + if(e < 1.0) + e = 1.0; scrollAmount += deltaY * e; capYPosition(); @@ -330,7 +331,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, { if(!isVisible()) return false; - scrollAmount -= verticalAmount * itemHeight / 2.0D; + scrollAmount -= verticalAmount * itemHeight / 2.0; return true; } @@ -379,7 +380,6 @@ protected void renderList(DrawContext context, int i, int j, int k, int l, { int m = getItemCount(); Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); for(int n = 0; n < m; ++n) { @@ -392,23 +392,25 @@ protected void renderList(DrawContext context, int i, int j, int k, int l, { int q = left + width / 2 - getRowWidth() / 2; int r = left + width / 2 + getRowWidth() / 2; - float g = isFocused() ? 1.0F : 0.5F; - RenderSystem.setShaderColor(g, g, g, 1.0F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(q, o + p + 2, 0.0D).next(); - bufferBuilder.vertex(r, o + p + 2, 0.0D).next(); - bufferBuilder.vertex(r, o - 2, 0.0D).next(); - bufferBuilder.vertex(q, o - 2, 0.0D).next(); - tessellator.draw(); - RenderSystem.setShaderColor(0.0F, 0.0F, 0.0F, 1.0F); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(q + 1, o + p + 1, 0.0D).next(); - bufferBuilder.vertex(r - 1, o + p + 1, 0.0D).next(); - bufferBuilder.vertex(r - 1, o - 1, 0.0D).next(); - bufferBuilder.vertex(q + 1, o - 1, 0.0D).next(); - tessellator.draw(); + float g = isFocused() ? 1 : 0.5F; + RenderSystem.setShaderColor(g, g, g, 1); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(q, o + p + 2, 0); + bufferBuilder.vertex(r, o + p + 2, 0); + bufferBuilder.vertex(r, o - 2, 0); + bufferBuilder.vertex(q, o - 2, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); + RenderSystem.setShaderColor(0, 0, 0, 1); + bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(q + 1, o + p + 1, 0); + bufferBuilder.vertex(r - 1, o + p + 1, 0); + bufferBuilder.vertex(r - 1, o - 1, 0); + bufferBuilder.vertex(q + 1, o - 1, 0); + BufferRenderer + .drawWithGlobalProgram(bufferBuilder.method_60800()); } RenderSystem.setShaderColor(1, 1, 1, 1); @@ -432,24 +434,23 @@ protected void renderHoleBackground(int top, int bottom, int topAlpha, int bottomAlpha) { Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.enableBlend(); RenderSystem.setShaderTexture(0, MENU_LIST_BACKGROUND_TEXTURE); - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.setShaderColor(1, 1, 1, 1); RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); - bufferBuilder.vertex(left, bottom, 0.0D).texture(0.0F, bottom / 32.0F) - .color(64, 64, 64, bottomAlpha).next(); - bufferBuilder.vertex(left + width, bottom, 0.0D) - .texture(width / 32.0F, bottom / 32.0F) - .color(64, 64, 64, bottomAlpha).next(); - bufferBuilder.vertex(left + width, top, 0.0D) - .texture(width / 32.0F, top / 32.0F).color(64, 64, 64, topAlpha) - .next(); - bufferBuilder.vertex(left, top, 0.0D).texture(0.0F, top / 32.0F) - .color(64, 64, 64, topAlpha).next(); - tessellator.draw(); + + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder.vertex(left, bottom, 0).texture(0, bottom / 32).color(64, + 64, 64, bottomAlpha); + bufferBuilder.vertex(left + width, bottom, 0) + .texture(width / 32, bottom / 32).color(64, 64, 64, bottomAlpha); + bufferBuilder.vertex(left + width, top, 0).texture(width / 32, top / 32) + .color(64, 64, 64, topAlpha); + bufferBuilder.vertex(left, top, 0).texture(0, top / 32).color(64, 64, + 64, topAlpha); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public double getScrollAmount() @@ -464,26 +465,25 @@ protected void drawSelectionOutline(MatrixStack matrixStack, int x, int y) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); RenderSystem.setShaderColor(0.5F, 0.5F, 0.5F, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x - 2, y - 2, 0).next(); - bufferBuilder.vertex(matrix, x + 218, y - 2, 0).next(); - bufferBuilder.vertex(matrix, x + 218, y + 28, 0).next(); - bufferBuilder.vertex(matrix, x - 2, y + 28, 0).next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x - 2, y - 2, 0); + bufferBuilder.vertex(matrix, x + 218, y - 2, 0); + bufferBuilder.vertex(matrix, x + 218, y + 28, 0); + bufferBuilder.vertex(matrix, x - 2, y + 28, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(0, 0, 0, 1); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x - 1, y - 1, 0).next(); - bufferBuilder.vertex(matrix, x + 217, y - 1, 0).next(); - bufferBuilder.vertex(matrix, x + 217, y + 27, 0).next(); - bufferBuilder.vertex(matrix, x - 1, y + 27, 0).next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, x - 1, y - 1, 0); + bufferBuilder.vertex(matrix, x + 217, y - 1, 0); + bufferBuilder.vertex(matrix, x + 217, y + 27, 0); + bufferBuilder.vertex(matrix, x - 1, y + 27, 0); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); RenderSystem.setShaderColor(1, 1, 1, 1); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/src/main/java/net/wurstclient/util/RenderUtils.java b/src/main/java/net/wurstclient/util/RenderUtils.java index efe5e64cf4..5c25e117dd 100644 --- a/src/main/java/net/wurstclient/util/RenderUtils.java +++ b/src/main/java/net/wurstclient/util/RenderUtils.java @@ -13,18 +13,12 @@ import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.class_9801; import net.minecraft.block.Blocks; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; -import net.minecraft.client.render.Camera; -import net.minecraft.client.render.DiffuseLighting; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.render.Tessellator; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; @@ -131,102 +125,59 @@ public static void drawSolidBox(MatrixStack matrixStack) public static void drawSolidBox(Box bb, MatrixStack matrixStack) { + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - tessellator.draw(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, minY, maxZ); + + bufferBuilder.vertex(matrix, minX, maxY, minZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, minY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, maxZ); + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, minX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawSolidBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); drawSolidBox(bb, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -235,35 +186,42 @@ public static void drawSolidBox(Box bb, VertexBuffer vertexBuffer) public static void drawSolidBox(Box bb, BufferBuilder bufferBuilder) { - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); - - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); - - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(minX, minY, maxZ); + + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(minX, maxY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(maxX, maxY, minZ); + + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(maxX, minY, minZ); + + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(maxX, minY, maxZ); + + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); + + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, minZ); } public static void drawOutlinedBox(MatrixStack matrixStack) @@ -275,106 +233,63 @@ public static void drawOutlinedBox(Box bb, MatrixStack matrixStack) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, minY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, minY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, minY, minZ); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - tessellator.draw(); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawOutlinedBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawOutlinedBox(bb, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -383,146 +298,110 @@ public static void drawOutlinedBox(Box bb, VertexBuffer vertexBuffer) public static void drawOutlinedBox(Box bb, BufferBuilder bufferBuilder) { - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(maxX, minY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, minY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(minX, minY, maxZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(minX, minY, minZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(minX, maxY, maxZ); + bufferBuilder.vertex(minX, maxY, minZ); } public static void drawCrossBox(Box bb, MatrixStack matrixStack) { + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.maxY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.maxY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.minZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.maxZ) - .next(); - - bufferBuilder - .vertex(matrix, (float)bb.maxX, (float)bb.minY, (float)bb.maxZ) - .next(); - bufferBuilder - .vertex(matrix, (float)bb.minX, (float)bb.minY, (float)bb.minZ) - .next(); - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, maxZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, minX, maxY, minZ); + + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, minY, minZ); + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + + bufferBuilder.vertex(matrix, minX, maxY, minZ); + bufferBuilder.vertex(matrix, maxX, maxY, minZ); + + bufferBuilder.vertex(matrix, minX, maxY, maxZ); + bufferBuilder.vertex(matrix, maxX, maxY, maxZ); + + bufferBuilder.vertex(matrix, maxX, minY, minZ); + bufferBuilder.vertex(matrix, minX, minY, maxZ); + + bufferBuilder.vertex(matrix, maxX, minY, maxZ); + bufferBuilder.vertex(matrix, maxX, minY, minZ); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawCrossBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawCrossBox(bb, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -531,129 +410,109 @@ public static void drawCrossBox(Box bb, VertexBuffer vertexBuffer) public static void drawCrossBox(Box bb, BufferBuilder bufferBuilder) { - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(maxX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(maxX, maxY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(minX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(minX, maxY, minZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(maxX, maxY, minZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(minX, minY, maxZ); + bufferBuilder.vertex(maxX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(minX, minY, minZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(minX, maxY, minZ); + bufferBuilder.vertex(maxX, maxY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, maxY, minZ); + bufferBuilder.vertex(minX, maxY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, minY, minZ); + bufferBuilder.vertex(minX, minY, maxZ); - bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next(); + bufferBuilder.vertex(maxX, minY, maxZ); + bufferBuilder.vertex(minX, minY, minZ); } public static void drawNode(Box bb, MatrixStack matrixStack) { Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); double midX = (bb.minX + bb.maxX) / 2; double midY = (bb.minY + bb.maxY) / 2; double midZ = (bb.minZ + bb.maxZ) / 2; - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ) - .next(); - - bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ) - .next(); - bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ) - .next(); - - tessellator.draw(); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); + bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ); + bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ); + bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ); + bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.maxY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ); + bufferBuilder.vertex(matrix, (float)bb.maxX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ); + bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.minZ); + + bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ); + bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); + + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawNode(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawNode(bb, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -662,45 +521,51 @@ public static void drawNode(Box bb, VertexBuffer vertexBuffer) public static void drawNode(Box bb, BufferBuilder bufferBuilder) { - double midX = (bb.minX + bb.maxX) / 2; - double midY = (bb.minY + bb.maxY) / 2; - double midZ = (bb.minZ + bb.maxZ) / 2; + float minX = (float)bb.minX; + float minY = (float)bb.minY; + float minZ = (float)bb.minZ; + float maxX = (float)bb.maxX; + float maxY = (float)bb.maxY; + float maxZ = (float)bb.maxZ; + float midX = (minX + maxX) / 2F; + float midY = (minY + maxY) / 2F; + float midZ = (minZ + maxZ) / 2F; - bufferBuilder.vertex(midX, midY, bb.maxZ).next(); - bufferBuilder.vertex(bb.minX, midY, midZ).next(); + bufferBuilder.vertex(midX, midY, maxZ); + bufferBuilder.vertex(minX, midY, midZ); - bufferBuilder.vertex(bb.minX, midY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.minZ).next(); + bufferBuilder.vertex(minX, midY, midZ); + bufferBuilder.vertex(midX, midY, minZ); - bufferBuilder.vertex(midX, midY, bb.minZ).next(); - bufferBuilder.vertex(bb.maxX, midY, midZ).next(); + bufferBuilder.vertex(midX, midY, minZ); + bufferBuilder.vertex(maxX, midY, midZ); - bufferBuilder.vertex(bb.maxX, midY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.maxZ).next(); + bufferBuilder.vertex(maxX, midY, midZ); + bufferBuilder.vertex(midX, midY, maxZ); - bufferBuilder.vertex(midX, bb.maxY, midZ).next(); - bufferBuilder.vertex(bb.maxX, midY, midZ).next(); + bufferBuilder.vertex(midX, maxY, midZ); + bufferBuilder.vertex(maxX, midY, midZ); - bufferBuilder.vertex(midX, bb.maxY, midZ).next(); - bufferBuilder.vertex(bb.minX, midY, midZ).next(); + bufferBuilder.vertex(midX, maxY, midZ); + bufferBuilder.vertex(minX, midY, midZ); - bufferBuilder.vertex(midX, bb.maxY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.minZ).next(); + bufferBuilder.vertex(midX, maxY, midZ); + bufferBuilder.vertex(midX, midY, minZ); - bufferBuilder.vertex(midX, bb.maxY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.maxZ).next(); + bufferBuilder.vertex(midX, maxY, midZ); + bufferBuilder.vertex(midX, midY, maxZ); - bufferBuilder.vertex(midX, bb.minY, midZ).next(); - bufferBuilder.vertex(bb.maxX, midY, midZ).next(); + bufferBuilder.vertex(midX, minY, midZ); + bufferBuilder.vertex(maxX, midY, midZ); - bufferBuilder.vertex(midX, bb.minY, midZ).next(); - bufferBuilder.vertex(bb.minX, midY, midZ).next(); + bufferBuilder.vertex(midX, minY, midZ); + bufferBuilder.vertex(minX, midY, midZ); - bufferBuilder.vertex(midX, bb.minY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.minZ).next(); + bufferBuilder.vertex(midX, minY, midZ); + bufferBuilder.vertex(midX, midY, minZ); - bufferBuilder.vertex(midX, bb.minY, midZ).next(); - bufferBuilder.vertex(midX, midY, bb.maxZ).next(); + bufferBuilder.vertex(midX, minY, midZ); + bufferBuilder.vertex(midX, midY, maxZ); } public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) @@ -708,9 +573,8 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) RenderSystem.setShader(GameRenderer::getPositionProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); double startX = from.x; double startY = from.y; @@ -723,10 +587,9 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) matrixStack.push(); Matrix4f matrix = matrixStack.peek().getPositionMatrix(); - bufferBuilder - .vertex(matrix, (float)startX, (float)startY, (float)startZ).next(); - bufferBuilder.vertex(matrix, (float)endX, (float)endY, (float)endZ) - .next(); + bufferBuilder.vertex(matrix, (float)startX, (float)startY, + (float)startZ); + bufferBuilder.vertex(matrix, (float)endX, (float)endY, (float)endZ); matrixStack.translate(endX, endY, endZ); matrixStack.scale(0.1F, 0.1F, 0.1F); @@ -742,51 +605,49 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) float zAngle = (float)Math.atan2(xDiff, yzDiff); matrix.rotate(zAngle, new Vector3f(0, 0, 1)); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, -1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, -1); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); matrixStack.pop(); - tessellator.draw(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); } public static void drawArrow(Vec3d from, Vec3d to, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator.method_60827( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawArrow(from, to, bufferBuilder); - BuiltBuffer buffer = bufferBuilder.end(); + class_9801 buffer = bufferBuilder.method_60800(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -807,10 +668,9 @@ public static void drawArrow(Vec3d from, Vec3d to, Matrix4f matrix = new Matrix4f(); matrix.identity(); - bufferBuilder - .vertex(matrix, (float)startX, (float)startY, (float)startZ).next(); - bufferBuilder.vertex(matrix, (float)endX, (float)endY, (float)endZ) - .next(); + bufferBuilder.vertex(matrix, (float)startX, (float)startY, + (float)startZ); + bufferBuilder.vertex(matrix, (float)endX, (float)endY, (float)endZ); matrix.translate((float)endX, (float)endY, (float)endZ); matrix.scale(0.1F, 0.1F, 0.1F); @@ -826,35 +686,35 @@ public static void drawArrow(Vec3d from, Vec3d to, float zAngle = (float)Math.atan2(xDiff, yzDiff); matrix.rotate(zAngle, new Vector3f(0, 0, 1)); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, -1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 2, -1); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 1, 2, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 2, 1); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, -1, 2, 0).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, -1, 2, 0); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, -1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, -1); - bufferBuilder.vertex(matrix, 0, 0, 0).next(); - bufferBuilder.vertex(matrix, 0, 2, 1).next(); + bufferBuilder.vertex(matrix, 0, 0, 0); + bufferBuilder.vertex(matrix, 0, 2, 1); } public static void drawItem(DrawContext context, ItemStack stack, int x, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e17259ce44..66dac03e74 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.98.2", - "minecraft": "~1.21-alpha.24.20.a", + "fabric-api": ">=0.99.1", + "minecraft": "~1.21-alpha.24.21.a", "java": ">=21" }, "suggests": { From fbe7940898fa37ef3cd4a6efe483b43a7ddc93b0 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 18:29:07 +0200 Subject: [PATCH 09/17] [Wurst-Bot] Update to 1.21-pre1 --- gradle.properties | 8 +- .../java/net/wurstclient/WurstClient.java | 2 +- .../java/net/wurstclient/ai/PathRenderer.java | 8 +- .../wurstclient/altmanager/AltRenderer.java | 4 +- .../altmanager/screens/AltEditorScreen.java | 4 +- .../altmanager/screens/AltManagerScreen.java | 8 +- .../net/wurstclient/clickgui/ClickGui.java | 112 +++++++++--------- .../wurstclient/clickgui/ComboBoxPopup.java | 8 +- .../components/AbstractListEditButton.java | 12 +- .../clickgui/components/BlockComponent.java | 4 +- .../components/CheckboxComponent.java | 20 ++-- .../clickgui/components/ColorComponent.java | 12 +- .../components/ComboBoxComponent.java | 24 ++-- .../clickgui/components/FeatureButton.java | 24 ++-- .../clickgui/components/FileComponent.java | 12 +- .../clickgui/components/RadarComponent.java | 16 +-- .../clickgui/components/SliderComponent.java | 24 ++-- .../components/TextFieldEditButton.java | 12 +- .../net/wurstclient/hacks/BaseFinderHack.java | 7 +- .../net/wurstclient/hacks/BowAimbotHack.java | 4 +- .../net/wurstclient/hacks/CaveFinderHack.java | 7 +- .../net/wurstclient/hacks/ExcavatorHack.java | 4 +- .../net/wurstclient/hacks/FreecamHack.java | 4 +- .../net/wurstclient/hacks/ItemEspHack.java | 4 +- .../net/wurstclient/hacks/MobEspHack.java | 4 +- .../wurstclient/hacks/MobSpawnEspHack.java | 7 +- .../net/wurstclient/hacks/PlayerEspHack.java | 4 +- .../net/wurstclient/hacks/SearchHack.java | 7 +- .../net/wurstclient/hacks/SkinDerpHack.java | 3 +- .../wurstclient/hacks/TrajectoriesHack.java | 4 +- .../net/wurstclient/hacks/TunnellerHack.java | 19 ++- .../hacks/autofarm/AutoFarmRenderer.java | 15 ++- .../hacks/autofish/AutoFishDebugDraw.java | 4 +- .../hacks/chestesp/ChestEspRenderer.java | 4 +- .../newchunks/NewChunksChunkRenderer.java | 5 +- .../newchunks/NewChunksOutlineRenderer.java | 9 +- .../newchunks/NewChunksReasonsRenderer.java | 9 +- .../hacks/newchunks/NewChunksRenderer.java | 5 +- .../newchunks/NewChunksSquareRenderer.java | 9 +- .../hacks/portalesp/PortalEspRenderer.java | 4 +- .../net/wurstclient/hacks/treebot/Tree.java | 7 +- src/main/java/net/wurstclient/hud/TabGui.java | 12 +- .../java/net/wurstclient/hud/WurstLogo.java | 4 +- .../mixin/BackgroundRendererMixin.java | 3 +- .../net/wurstclient/mixin/CameraMixin.java | 3 +- .../mixin/DisconnectedScreenMixin.java | 5 +- .../navigator/NavigatorFeatureScreen.java | 8 +- .../navigator/NavigatorMainScreen.java | 20 ++-- .../navigator/NavigatorScreen.java | 20 ++-- .../java/net/wurstclient/util/ListWidget.java | 44 +++---- .../net/wurstclient/util/RenderUtils.java | 42 ++++--- 51 files changed, 303 insertions(+), 321 deletions(-) diff --git a/gradle.properties b/gradle.properties index 62883df9e5..0763f0db3d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=24w21b -yarn_mappings=24w21b+build.3 +minecraft_version=1.21-pre1 +yarn_mappings=1.21-pre1+build.2 loader_version=0.15.11 # Fabric API -fabric_version=0.99.1+1.21 +fabric_version=0.99.2+1.21 # Mod Properties -mod_version = v7.42-MC24w21b +mod_version = v7.42-MC1.21-pre1 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 82ac0f29b3..2bca7d27d5 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "24w21b"; + public static final String MC_VERSION = "1.21-pre1"; private WurstAnalytics analytics; private EventManager eventManager; diff --git a/src/main/java/net/wurstclient/ai/PathRenderer.java b/src/main/java/net/wurstclient/ai/PathRenderer.java index 09a179da21..edb8570ffd 100644 --- a/src/main/java/net/wurstclient/ai/PathRenderer.java +++ b/src/main/java/net/wurstclient/ai/PathRenderer.java @@ -29,7 +29,7 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, { Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); int startX = start.getX() - region.x(); @@ -96,7 +96,7 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, matrixStack.pop(); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void renderNode(MatrixStack matrixStack, BlockPos pos, @@ -112,7 +112,7 @@ public static void renderNode(MatrixStack matrixStack, BlockPos pos, Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); // middle part @@ -154,7 +154,7 @@ public static void renderNode(MatrixStack matrixStack, BlockPos pos, bufferBuilder.vertex(matrix, 0, -1, 0); bufferBuilder.vertex(matrix, 0, 0, 1); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); matrixStack.pop(); } diff --git a/src/main/java/net/wurstclient/altmanager/AltRenderer.java b/src/main/java/net/wurstclient/altmanager/AltRenderer.java index 2231bef6fe..1d984414af 100644 --- a/src/main/java/net/wurstclient/altmanager/AltRenderer.java +++ b/src/main/java/net/wurstclient/altmanager/AltRenderer.java @@ -67,14 +67,14 @@ private static void drawTexture(DrawContext context, int x, int y, float u, RenderSystem.setShader(GameRenderer::getPositionTexProgram); MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); - BufferBuilder bufferBuilder = Tessellator.getInstance().method_60827( + BufferBuilder bufferBuilder = Tessellator.getInstance().begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh); bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh); bufferBuilder.vertex(matrix4f, x2, y2, z).texture(uPlusWOverFw, vPlusHOverFh); bufferBuilder.vertex(matrix4f, x2, y, z).texture(uPlusWOverFw, vOverFh); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawAltFace(DrawContext context, String name, int x, diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java index 7d666aacb4..7b2ad6d07a 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java @@ -384,13 +384,13 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, width, 0, 0); bufferBuilder.vertex(matrix, width, height, 0); bufferBuilder.vertex(matrix, 0, height, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java index b7578c8743..a72ccb90a5 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java @@ -459,13 +459,13 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, width, 0, 0); bufferBuilder.vertex(matrix, width, height, 0); bufferBuilder.vertex(matrix, 0, height, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); @@ -660,14 +660,14 @@ protected void renderItem(DrawContext context, int id, int x, int y, RenderSystem.setShaderColor(0, 1, 0, opacity); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x - 2, y - 2, 0); bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0); bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0); bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/net/wurstclient/clickgui/ClickGui.java b/src/main/java/net/wurstclient/clickgui/ClickGui.java index 7b2fde2ccb..78336b26b8 100644 --- a/src/main/java/net/wurstclient/clickgui/ClickGui.java +++ b/src/main/java/net/wurstclient/clickgui/ClickGui.java @@ -565,23 +565,23 @@ public void renderTooltip(DrawContext context, int mouseX, int mouseY) RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], ttOpacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xt1, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xt1, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // text RenderSystem.setShaderColor(1, 1, 1, 1); @@ -676,7 +676,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs2, ys1, 0); bufferBuilder.vertex(matrix, xs2, ys2, 0); @@ -691,7 +691,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, xs2, ys2, 0); bufferBuilder.vertex(matrix, xs2, ys4, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); boolean hovering = mouseX >= xs1 && mouseY >= ys3 && mouseX < xs2 && mouseY < ys4; @@ -700,20 +700,20 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], hovering ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs1, ys3, 0); bufferBuilder.vertex(matrix, xs1, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys3, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs1, ys3, 0); @@ -722,7 +722,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, xs2, ys3, 0); bufferBuilder.vertex(matrix, xs1, ys3, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); } int x3 = x1 + 2; @@ -735,7 +735,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); @@ -745,7 +745,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, x5, y2, 0); bufferBuilder.vertex(matrix, x4, y2, 0); bufferBuilder.vertex(matrix, x4, y3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); net.minecraft.client.util.Window sr = MC.getWindow(); int sf = (int)sr.getScaleFactor(); @@ -759,7 +759,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); // window background @@ -793,7 +793,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, xc2, yc1, 0); bufferBuilder.vertex(matrix, xc2, yc2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // render children int cMouseX = mouseX - x1; @@ -813,23 +813,23 @@ private void renderWindow(DrawContext context, Window window, int mouseX, // window outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); if(!window.isMinimized()) { // title bar outline - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x2, y3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } // title bar buttons @@ -868,7 +868,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y4, 0); @@ -878,17 +878,17 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, x3, y3, 0); bufferBuilder.vertex(matrix, x2, y3, 0); bufferBuilder.vertex(matrix, x2, y5, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // title bar background // behind title - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x3, y3, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // window title RenderSystem.setShaderColor(1, 1, 1, 1); @@ -912,34 +912,34 @@ private void renderTitleBarButton(MatrixStack matrixStack, int x1, int y1, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hovering ? opacity * 1.5F : opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // background between buttons RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // button outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, @@ -970,22 +970,22 @@ private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, } // arrow - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void renderPinButton(MatrixStack matrixStack, int x1, int y1, @@ -1009,7 +1009,7 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(h, 0, 0, 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk1, 0); @@ -1019,7 +1019,7 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xk4, yk2, 0); bufferBuilder.vertex(matrix, xk4, yk3, 0); bufferBuilder.vertex(matrix, xk3, yk3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); float xn1 = x1 + 3.5F; float xn2 = x2 - 3.5F; @@ -1028,40 +1028,40 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); bufferBuilder.vertex(matrix, xn1, yn2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outlines RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); bufferBuilder.vertex(matrix, xk1, yk2, 0); bufferBuilder.vertex(matrix, xk1, yk1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk3, yk2, 0); bufferBuilder.vertex(matrix, xk4, yk2, 0); bufferBuilder.vertex(matrix, xk4, yk3, 0); bufferBuilder.vertex(matrix, xk3, yk3, 0); bufferBuilder.vertex(matrix, xk3, yk2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); bufferBuilder.vertex(matrix, xn1, yn2, 0); bufferBuilder.vertex(matrix, xn1, yn1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); }else { @@ -1082,7 +1082,7 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(0, h, 0, 1); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); @@ -1092,7 +1092,7 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xk6, yk6, 0); bufferBuilder.vertex(matrix, xk3, yk7, 0); bufferBuilder.vertex(matrix, xk7, yk4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); float xn1 = x1 + 3; float xn2 = x1 + 4; @@ -1103,38 +1103,38 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); bufferBuilder.vertex(matrix, xn3, yn3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outlines RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); bufferBuilder.vertex(matrix, xk3, yk3, 0); bufferBuilder.vertex(matrix, xk4, yk4, 0); bufferBuilder.vertex(matrix, xk1, yk1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk5, yk5, 0); bufferBuilder.vertex(matrix, xk6, yk6, 0); bufferBuilder.vertex(matrix, xk3, yk7, 0); bufferBuilder.vertex(matrix, xk7, yk4, 0); bufferBuilder.vertex(matrix, xk5, yk5, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); bufferBuilder.vertex(matrix, xn3, yn3, 0); bufferBuilder.vertex(matrix, xn1, yn1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } } @@ -1164,7 +1164,7 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, // cross RenderSystem.setShaderColor(hovering ? 1 : 0.85F, 0, 0, 1); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xc1, yc1, 0); bufferBuilder.vertex(matrix, xc2, yc2, 0); bufferBuilder.vertex(matrix, xc3, yc3, 0); @@ -1177,11 +1177,11 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xc5, yc6, 0); bufferBuilder.vertex(matrix, xc1, yc3, 0); bufferBuilder.vertex(matrix, xc2, yc4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xc1, yc1, 0); bufferBuilder.vertex(matrix, xc2, yc2, 0); @@ -1195,7 +1195,7 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xc2, yc4, 0); bufferBuilder.vertex(matrix, xc1, yc3, 0); bufferBuilder.vertex(matrix, xc5, yc6, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public float[] getBgColor() diff --git a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java index 3af9a37242..978e214858 100644 --- a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java +++ b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java @@ -119,14 +119,14 @@ private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, float[] acColor = gui.getAcColor(); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawValueBackground(MatrixStack matrixStack, int x1, int x2, @@ -141,12 +141,12 @@ private void drawValueBackground(MatrixStack matrixStack, int x1, int x2, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], alpha); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, yi1, 0); bufferBuilder.vertex(matrix, x1, yi2, 0); bufferBuilder.vertex(matrix, x2, yi2, 0); bufferBuilder.vertex(matrix, x2, yi1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawValueName(DrawContext context, int x1, int yi1, diff --git a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java index 02b4cc0168..bb78616566 100644 --- a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java @@ -94,32 +94,32 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java index 4e75989a33..74f38a7901 100644 --- a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java @@ -109,12 +109,12 @@ else if(hBlock) RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java index 036b82284b..318794d5e2 100644 --- a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java @@ -122,12 +122,12 @@ private void drawBackground(MatrixStack matrixStack, int x2, int x3, int y1, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawBox(MatrixStack matrixStack, int x1, int x3, int y1, @@ -143,22 +143,22 @@ private void drawBox(MatrixStack matrixStack, int x1, int x3, int y1, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hovering ? opacity * 1.5F : opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawCheck(MatrixStack matrixStack, int x1, int y1, @@ -184,7 +184,7 @@ private void drawCheck(MatrixStack matrixStack, int x1, int y1, else RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xc2, yc3, 0); bufferBuilder.vertex(matrix, xc3, yc4, 0); bufferBuilder.vertex(matrix, xc3, yc5, 0); @@ -193,11 +193,11 @@ private void drawCheck(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xc5, yc2, 0); bufferBuilder.vertex(matrix, xc3, yc5, 0); bufferBuilder.vertex(matrix, xc3, yc4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xc2, yc3, 0); bufferBuilder.vertex(matrix, xc3, yc4, 0); @@ -206,7 +206,7 @@ private void drawCheck(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, xc3, yc5, 0); bufferBuilder.vertex(matrix, xc1, yc4, 0); bufferBuilder.vertex(matrix, xc2, yc3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawName(DrawContext context, int x3, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java index 0abe1fc22e..cf0321df89 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java @@ -114,13 +114,13 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x2, int y1, opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawBox(MatrixStack matrixStack, int x1, int x2, int y2, @@ -137,23 +137,23 @@ private void drawBox(MatrixStack matrixStack, int x1, int x2, int y2, hovering ? 1F : opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x2, y3, 0); bufferBuilder.vertex(matrix, x2, y2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x2, y3, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x1, y2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawNameAndValue(DrawContext context, int x1, int x2, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java index 776407b2a3..d6c4a23f3f 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java @@ -158,12 +158,12 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x4, int y1, opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x4, y2, 0); bufferBuilder.vertex(matrix, x4, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawBox(MatrixStack matrixStack, int x2, int x4, int y1, @@ -181,23 +181,23 @@ private void drawBox(MatrixStack matrixStack, int x2, int x4, int y1, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], bgAlpha); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x4, y1, 0); bufferBuilder.vertex(matrix, x4, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x4, y1, 0); bufferBuilder.vertex(matrix, x4, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x4, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) @@ -205,11 +205,11 @@ private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, @@ -238,22 +238,22 @@ private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, } // arrow - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawNameAndValue(DrawContext context, int x1, int x4, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java index 199e664e8e..634a6312d6 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java @@ -170,7 +170,7 @@ private void drawButtonBackground(MatrixStack matrixStack, int x1, int x3, Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); if(feature.isEnabled()) // if(feature.isBlocked()) @@ -187,7 +187,7 @@ private void drawButtonBackground(MatrixStack matrixStack, int x1, int x3, bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawSettingsBackground(MatrixStack matrixStack, int x2, int x3, @@ -200,14 +200,14 @@ private void drawSettingsBackground(MatrixStack matrixStack, int x2, int x3, Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hSettings ? opacity * 1.5F : opacity); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, @@ -218,7 +218,7 @@ private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); bufferBuilder.vertex(matrix, x1, y1, 0); @@ -226,7 +226,7 @@ private void drawOutline(MatrixStack matrixStack, int x1, int x2, int y1, bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x1, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) @@ -235,11 +235,11 @@ private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) Tessellator tessellator = RenderSystem.renderThreadTesselator(); // separator - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, @@ -268,22 +268,22 @@ private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, } // arrow - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawName(DrawContext context, int x1, int x3, int y1) diff --git a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java index 1aa1dfec42..6608076492 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java @@ -100,32 +100,32 @@ else if(hBox) RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x3, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // setting name RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java index b9f9b0111f..1d5ccd1b95 100644 --- a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java @@ -79,12 +79,12 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); float middleX = (x1 + x2) / 2.0F; float middleY = (y1 + y2) / 2.0F; @@ -108,24 +108,24 @@ public void render(DrawContext context, int mouseX, int mouseY, // arrow RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya3, 0); bufferBuilder.vertex(matrix, xa3, ya2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya3, 0); bufferBuilder.vertex(matrix, xa3, ya2, 0); bufferBuilder.vertex(matrix, xa1, ya1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); matrixStack.pop(); matrix = matrixStack.peek().getPositionMatrix(); @@ -134,7 +134,7 @@ public void render(DrawContext context, int mouseX, int mouseY, // points RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); for(Entity e : hack.getEntities()) { @@ -190,7 +190,7 @@ else if(e instanceof AnimalEntity || e instanceof AmbientEntity middleY + (float)renderY + 0.5F, 0) .color(red, green, blue, alpha); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } @Override diff --git a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java index 61a4f3039c..5c0c831588 100644 --- a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java @@ -178,7 +178,7 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x2, int x3, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y4, 0); @@ -200,7 +200,7 @@ private void drawBackground(MatrixStack matrixStack, int x1, int x2, int x3, bufferBuilder.vertex(matrix, x2, y5, 0); bufferBuilder.vertex(matrix, x2, y4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, @@ -226,7 +226,7 @@ private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, RenderSystem.setShaderColor(1, 0, 0, hSlider ? opacity * 1.5F : opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y4, 0); bufferBuilder.vertex(matrix, x3, y5, 0); bufferBuilder.vertex(matrix, xl1, y5, 0); @@ -235,29 +235,29 @@ private void drawRail(MatrixStack matrixStack, int x3, int x4, int y4, bufferBuilder.vertex(matrix, xl2, y5, 0); bufferBuilder.vertex(matrix, x4, y5, 0); bufferBuilder.vertex(matrix, x4, y4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hSlider ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xl1, y4, 0); bufferBuilder.vertex(matrix, xl1, y5, 0); bufferBuilder.vertex(matrix, xl2, y5, 0); bufferBuilder.vertex(matrix, xl2, y4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y4, 0); bufferBuilder.vertex(matrix, x3, y5, 0); bufferBuilder.vertex(matrix, x4, y5, 0); bufferBuilder.vertex(matrix, x4, y4, 0); bufferBuilder.vertex(matrix, x3, y4, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawKnob(MatrixStack matrixStack, int x1, int x2, int y2, @@ -281,23 +281,23 @@ private void drawKnob(MatrixStack matrixStack, int x1, int x2, int y2, RenderSystem.setShaderColor(c[0], c[1], c[2], hSlider ? 1 : 0.75F); } BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk1, yk2, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); bufferBuilder.vertex(matrix, xk2, yk1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk1, yk2, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); bufferBuilder.vertex(matrix, xk2, yk1, 0); bufferBuilder.vertex(matrix, xk1, yk1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawNameAndValue(DrawContext context, int x1, int x2, int y1, diff --git a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java index 79a6178947..7c185a2826 100644 --- a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java @@ -102,32 +102,32 @@ else if(hBox) RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // box RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], hBox ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y3, 0); bufferBuilder.vertex(matrix, x1, y3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); int maxLength = tr.getTextHandler().getLimitedStringLength( setting.getValue(), getWidth() - 8, Style.EMPTY); diff --git a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java index 1b9f6a1e90..b07835a3d8 100644 --- a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java @@ -16,11 +16,10 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -206,14 +205,14 @@ public void onUpdate() vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); for(int[] vertex : vertices) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], vertex[2] - region.z()); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); diff --git a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java index 9cf9985a95..37714eb7e1 100644 --- a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java +++ b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java @@ -286,12 +286,12 @@ public void onRenderGUI(DrawContext context, float partialTicks) RenderSystem.setShader(GameRenderer::getPositionProgram); RenderSystem.setShaderColor(0, 0, 0, 0.5F); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, msgWidth + 3, 0, 0); bufferBuilder.vertex(matrix, msgWidth + 3, 10, 0); bufferBuilder.vertex(matrix, 0, 10, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // text RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java index 41752f9a45..143c72f84c 100644 --- a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java @@ -19,12 +19,11 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.block.Blocks; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -256,14 +255,14 @@ private void setBufferFromTask() { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); for(int[] vertex : compileVerticesTask.join()) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], vertex[2] - region.z()); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); if(vertexBuffer != null) vertexBuffer.close(); diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 28ac6eb0fd..bcf60d8080 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -359,12 +359,12 @@ public void onRenderGUI(DrawContext context, float partialTicks) RenderSystem.setShader(GameRenderer::getPositionProgram); RenderSystem.setShaderColor(0, 0, 0, 0.5F); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, msgWidth + 2, 0, 0); bufferBuilder.vertex(matrix, msgWidth + 2, 10, 0); bufferBuilder.vertex(matrix, 0, 10, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // text RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index 5dafb9e39c..023387f19b 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -215,12 +215,12 @@ public void onRender(MatrixStack matrixStack, float partialTicks) Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, (float)start.z); bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, (float)end.z); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); matrixStack.pop(); diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index 314d07c84d..138a691226 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -172,7 +172,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionVec); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(ItemEntity e : items) { @@ -184,6 +184,6 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, (float)end.z); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } } diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 16402baa0b..a2c58304f9 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -206,7 +206,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); Vec3d regionVec = region.toVec3d(); @@ -231,6 +231,6 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, .color(r, g, 0, 0.5F); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } } diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index 601f8132eb..a7dc3d9cf8 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -16,12 +16,11 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.block.BlockState; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -300,7 +299,7 @@ private void compileBuffer() vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = - tessellator.method_60827(VertexFormat.DrawMode.DEBUG_LINES, + tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); new ArrayList<>(red).stream().filter(Objects::nonNull) @@ -337,7 +336,7 @@ private void compileBuffer() .color(1, 1, 0, 0.5F); }); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index ffcc5f8e60..dcd883fda8 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -188,7 +188,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); Vec3d regionVec = region.toVec3d(); @@ -225,6 +225,6 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, .color(r, g, b, 0.5F); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } } diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index 213dac7c7d..4855577b17 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -18,12 +18,11 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.block.Block; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -259,14 +258,14 @@ private void setBufferFromTask() { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); for(int[] vertex : compileVerticesTask.join()) bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], vertex[2] - region.z()); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); if(vertexBuffer != null) vertexBuffer.close(); diff --git a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java index 6f80362cd8..618a8338fe 100644 --- a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java +++ b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java @@ -8,8 +8,7 @@ package net.wurstclient.hacks; import java.util.Random; - -import net.minecraft.client.render.entity.PlayerModelPart; +import net.minecraft.entity.player.PlayerModelPart; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; diff --git a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java index fea32f78e2..056f1cb51f 100644 --- a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java +++ b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java @@ -128,7 +128,7 @@ private void drawLine(MatrixStack matrixStack, ArrayList path, Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); float[] colorF = color.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.75F); @@ -137,7 +137,7 @@ private void drawLine(MatrixStack matrixStack, ArrayList path, bufferBuilder.vertex(matrix, (float)(point.x - camPos.x), (float)(point.y - camPos.y), (float)(point.z - camPos.z)); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private void drawEndOfLine(MatrixStack matrixStack, Vec3d end, diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 55ce73e9a6..6f201fe4b2 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -16,8 +16,6 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -29,6 +27,7 @@ import net.minecraft.client.option.GameOptions; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -272,7 +271,7 @@ private void updateCyanBuffer() vertexBuffers[0] = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); @@ -288,7 +287,7 @@ private void updateCyanBuffer() .multiply(Math.max(0.5, length)).add(offset); RenderUtils.drawArrow(arrowStart, arrowEnd, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffers[0].bind(); vertexBuffers[0].upload(buffer); VertexBuffer.unbind(); @@ -393,7 +392,7 @@ public void run() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); currentBlock = null; @@ -412,7 +411,7 @@ public void run() RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); } - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffers[1].bind(); vertexBuffers[1].upload(buffer); VertexBuffer.unbind(); @@ -503,13 +502,13 @@ public boolean canRun() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocks) RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffers[2].bind(); vertexBuffers[2].upload(buffer); VertexBuffer.unbind(); @@ -644,13 +643,13 @@ public boolean canRun() .offset(region.negate().toVec3d()); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : liquids) RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffers[3].bind(); vertexBuffers[3].upload(buffer); diff --git a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java index eabd13b5bb..298f392e6c 100644 --- a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java +++ b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java @@ -16,11 +16,10 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -116,7 +115,7 @@ private void updateGreenBuffer(List blocksToHarvest, greenBuffer.close(); greenBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToHarvest) @@ -125,7 +124,7 @@ private void updateGreenBuffer(List blocksToHarvest, RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); } - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); greenBuffer.bind(); greenBuffer.upload(buffer); VertexBuffer.unbind(); @@ -138,7 +137,7 @@ private void updateCyanBuffer(Set plants, Tessellator tessellator, cyanBuffer.close(); cyanBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : plants) @@ -147,7 +146,7 @@ private void updateCyanBuffer(Set plants, Tessellator tessellator, RenderUtils.drawNode(renderNode, bufferBuilder); } - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); cyanBuffer.bind(); cyanBuffer.upload(buffer); VertexBuffer.unbind(); @@ -160,7 +159,7 @@ private void updateRedBuffer(List blocksToReplant, redBuffer.close(); redBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToReplant) @@ -169,7 +168,7 @@ private void updateRedBuffer(List blocksToReplant, RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); } - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); redBuffer.bind(); redBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java index 3952f7b47f..079119bc59 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java @@ -141,13 +141,13 @@ private void drawLastBite(MatrixStack matrixStack, RegionPos region) float[] colorF = ddColor.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, -0.125F, 0, -0.125F); bufferBuilder.vertex(matrix, 0.125F, 0, 0.125F); bufferBuilder.vertex(matrix, 0.125F, 0, -0.125F); bufferBuilder.vertex(matrix, -0.125F, 0, 0.125F); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); matrixStack.pop(); } diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java index 97cf13556a..0c659216c9 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java @@ -86,7 +86,7 @@ public void renderLines(ChestEspGroup group) float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) @@ -100,7 +100,7 @@ public void renderLines(ChestEspGroup group) (float)end.z); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void prepareBuffers() diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java index 10365369e0..bc40c0ace4 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java @@ -8,11 +8,10 @@ package net.wurstclient.hacks.newchunks; import java.util.Set; - -import net.minecraft.class_9801; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.util.math.ChunkPos; public interface NewChunksChunkRenderer { - public class_9801 buildBuffer(Set chunks, int drawDistance); + public BuiltBuffer buildBuffer(Set chunks, int drawDistance); } diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java index 0640b5c259..b1dab13eab 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java @@ -12,9 +12,8 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -26,13 +25,13 @@ public final class NewChunksOutlineRenderer implements NewChunksChunkRenderer { @Override - public class_9801 buildBuffer(Set chunks, int drawDistance) + public BuiltBuffer buildBuffer(Set chunks, int drawDistance) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.method_60800(); + return bufferBuilder.end(); } private void renderChunks(List chunks, int drawDistance, diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java index 210d463125..40f26d76fd 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java @@ -12,9 +12,8 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -34,13 +33,13 @@ public NewChunksReasonsRenderer(SliderSetting drawDistance) this.drawDistance = drawDistance; } - public class_9801 buildBuffer(Set reasons) + public BuiltBuffer buildBuffer(Set reasons) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); renderBlocks(new ArrayList<>(reasons), bufferBuilder); - return bufferBuilder.method_60800(); + return bufferBuilder.end(); } private void renderBlocks(List blocks, diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java index b5e0f57c84..2f7a09d58e 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java @@ -11,10 +11,9 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; import net.wurstclient.settings.ColorSetting; @@ -39,7 +38,7 @@ public NewChunksRenderer(SliderSetting altitude, SliderSetting opacity, this.oldChunksColor = oldChunksColor; } - public void updateBuffer(int i, class_9801 buffer) + public void updateBuffer(int i, BuiltBuffer buffer) { vertexBuffers[i] = new VertexBuffer(VertexBuffer.Usage.STATIC); vertexBuffers[i].bind(); diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java index d15e6d941b..87083e5b7d 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java @@ -12,9 +12,8 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -26,13 +25,13 @@ public final class NewChunksSquareRenderer implements NewChunksChunkRenderer { @Override - public class_9801 buildBuffer(Set chunks, int drawDistance) + public BuiltBuffer buildBuffer(Set chunks, int drawDistance) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.method_60800(); + return bufferBuilder.end(); } private void renderChunks(List chunks, int drawDistance, diff --git a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java index 2aa4a2e2e0..d579d9be75 100644 --- a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java @@ -86,7 +86,7 @@ public void renderLines(PortalEspBlockGroup group) float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) @@ -100,7 +100,7 @@ public void renderLines(PortalEspBlockGroup group) (float)end.z); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void prepareBuffers() diff --git a/src/main/java/net/wurstclient/hacks/treebot/Tree.java b/src/main/java/net/wurstclient/hacks/treebot/Tree.java index a77b6b92ae..e9b6b88ec8 100644 --- a/src/main/java/net/wurstclient/hacks/treebot/Tree.java +++ b/src/main/java/net/wurstclient/hacks/treebot/Tree.java @@ -13,11 +13,10 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -55,7 +54,7 @@ public void compileBuffer() .offset(regionOffset); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RenderUtils.drawCrossBox(box.offset(stump), bufferBuilder); @@ -63,7 +62,7 @@ public void compileBuffer() for(BlockPos log : logs) RenderUtils.drawOutlinedBox(box.offset(log), bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); VertexBuffer.unbind(); diff --git a/src/main/java/net/wurstclient/hud/TabGui.java b/src/main/java/net/wurstclient/hud/TabGui.java index 13431e648f..4adbecdddf 100644 --- a/src/main/java/net/wurstclient/hud/TabGui.java +++ b/src/main/java/net/wurstclient/hud/TabGui.java @@ -226,14 +226,14 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, // box BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); { bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x1, y2, 0); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline positions float xi1 = x1 - 0.1F; @@ -244,7 +244,7 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, // outline GL11.glLineWidth(1); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); { bufferBuilder.vertex(matrix, xi1, yi1, 0); @@ -253,7 +253,7 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, bufferBuilder.vertex(matrix, xi1, yi2, 0); bufferBuilder.vertex(matrix, xi1, yi1, 0); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // shadow positions xi1 -= 0.9; @@ -265,7 +265,7 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, RenderSystem.setShaderColor(1, 1, 1, 1); // top left - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); // top @@ -300,7 +300,7 @@ private void drawBox(MatrixStack matrixStack, int x1, int y1, int x2, bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], acColor[2], 0.75F); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } private static final class Tab diff --git a/src/main/java/net/wurstclient/hud/WurstLogo.java b/src/main/java/net/wurstclient/hud/WurstLogo.java index 4ee3eb4e59..1246d02422 100644 --- a/src/main/java/net/wurstclient/hud/WurstLogo.java +++ b/src/main/java/net/wurstclient/hud/WurstLogo.java @@ -82,12 +82,12 @@ private void drawQuads(MatrixStack matrices, int x1, int y1, int x2, int y2, RenderSystem.setShader(GameRenderer::getPositionColorProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(matrix, x1, y2, 0.0F).color(r, g, b, a); bufferBuilder.vertex(matrix, x2, y2, 0.0F).color(r, g, b, a); bufferBuilder.vertex(matrix, x2, y1, 0.0F).color(r, g, b, a); bufferBuilder.vertex(matrix, x1, y1, 0.0F).color(r, g, b, a); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } } diff --git a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java index 4fe47fe9ae..5e00da47f3 100644 --- a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java @@ -14,11 +14,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.mojang.blaze3d.systems.RenderSystem; - +import net.minecraft.block.enums.CameraSubmersionType; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; import net.minecraft.client.render.Camera; -import net.minecraft.client.render.CameraSubmersionType; import net.minecraft.entity.Entity; import net.wurstclient.WurstClient; diff --git a/src/main/java/net/wurstclient/mixin/CameraMixin.java b/src/main/java/net/wurstclient/mixin/CameraMixin.java index 5b0ad170c1..880675f9bb 100644 --- a/src/main/java/net/wurstclient/mixin/CameraMixin.java +++ b/src/main/java/net/wurstclient/mixin/CameraMixin.java @@ -12,9 +12,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - +import net.minecraft.block.enums.CameraSubmersionType; import net.minecraft.client.render.Camera; -import net.minecraft.client.render.CameraSubmersionType; import net.wurstclient.WurstClient; import net.wurstclient.hacks.CameraDistanceHack; diff --git a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java index 0c47703f32..229bf6ca90 100644 --- a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java @@ -15,12 +15,11 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.class_9812; import net.minecraft.client.gui.screen.DisconnectedScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.DirectionalLayoutWidget; +import net.minecraft.network.DisconnectionInfo; import net.minecraft.text.Text; import net.wurstclient.WurstClient; import net.wurstclient.hacks.AutoReconnectHack; @@ -36,7 +35,7 @@ public class DisconnectedScreenMixin extends Screen @Shadow @Final - private class_9812 field_52131;// reason container thing + private DisconnectionInfo field_52131;// reason container thing @Shadow @Final private Screen parent; diff --git a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java index 729da57359..d4abb4f69b 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java @@ -380,7 +380,7 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, // window background // left & right setColorToBackground(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); @@ -390,10 +390,10 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, bufferBuilder.vertex(matrix, x5, y2, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x2, y3, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); setColorToBackground(); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); // window background @@ -432,7 +432,7 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, bufferBuilder.vertex(matrix, xc2, yc1, 0); bufferBuilder.vertex(matrix, xc2, yc2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } for(int i = 0; i < window.countChildren(); i++) diff --git a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java index 648b5cc910..b91c62b123 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java @@ -303,25 +303,25 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], 0.75F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xt1, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xt1, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -428,11 +428,11 @@ else if(clickTimer == 0) int by2 = by1 + area.height - 4; float[] acColor = WurstClient.INSTANCE.getGui().getAcColor(); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, bx1, by1, 0); bufferBuilder.vertex(matrix, bx1, by2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // hovering if(hovering) @@ -449,22 +449,22 @@ else if(clickTimer == 0) // arrow RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, ax1, ay1, 0); bufferBuilder.vertex(matrix, ax2, ay1, 0); bufferBuilder.vertex(matrix, ax3, ay2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // arrow shadow RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, ax1, ay1, 0); bufferBuilder.vertex(matrix, ax2, ay1, 0); bufferBuilder.vertex(matrix, ax3, ay2, 0); bufferBuilder.vertex(matrix, ax1, ay1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // text if(!clickTimerRunning) diff --git a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java index a6744d6fb4..b5d859106a 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java @@ -246,12 +246,12 @@ protected final void drawQuads(MatrixStack matrixStack, int x1, int y1, RenderSystem.setShader(GameRenderer::getPositionProgram); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y1, 0); bufferBuilder.vertex(matrix, x2, y1, 0); bufferBuilder.vertex(matrix, x2, y2, 0); bufferBuilder.vertex(matrix, x1, y2, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, @@ -272,14 +272,14 @@ protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xi1, yi1, 0); bufferBuilder.vertex(matrix, xi2, yi1, 0); bufferBuilder.vertex(matrix, xi2, yi2, 0); bufferBuilder.vertex(matrix, xi1, yi2, 0); bufferBuilder.vertex(matrix, xi1, yi1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // shadow positions xi1 -= 0.9; @@ -290,7 +290,7 @@ protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); // top @@ -325,7 +325,7 @@ protected final void drawBoxShadow(MatrixStack matrixStack, int x1, int y1, bufferBuilder.vertex(matrix, x2, y2, 0).color(acColor[0], acColor[1], acColor[2], 0.75F); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, @@ -341,16 +341,16 @@ protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, // outline float yi1 = y1 + 0.1F; RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, yi1, 0); bufferBuilder.vertex(matrix, x2, yi1, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // shadow RenderSystem.setShader(GameRenderer::getPositionColorProgram); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(matrix, x1, y1, 0).color(acColor[0], acColor[1], acColor[2], 0.75F); @@ -358,7 +358,7 @@ protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, acColor[2], 0.75F); bufferBuilder.vertex(matrix, x2, y2, 0).color(0, 0, 0, 0); bufferBuilder.vertex(matrix, x1, y2, 0).color(0, 0, 0, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } protected final void drawBox(MatrixStack matrixStack, int x1, int y1, diff --git a/src/main/java/net/wurstclient/util/ListWidget.java b/src/main/java/net/wurstclient/util/ListWidget.java index f0569cb4a8..289b69a0cf 100644 --- a/src/main/java/net/wurstclient/util/ListWidget.java +++ b/src/main/java/net/wurstclient/util/ListWidget.java @@ -153,7 +153,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); BufferBuilder bufferBuilder = - tessellator.method_60827(VertexFormat.DrawMode.QUADS, + tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, bottom, 0) @@ -169,7 +169,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) .texture(left / 32, (top + (int)scrollAmount) / 32) .color(32, 32, 32, 255); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); int k = left + width / 2 - getRowWidth() / 2 + 2; int l = top + 4 - (int)scrollAmount; @@ -188,7 +188,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) GlStateManager.SrcFactor.ZERO, GlStateManager.DstFactor.ONE); RenderSystem.setShaderColor(1, 1, 1, 1); bufferBuilder = - tessellator.method_60827(VertexFormat.DrawMode.QUADS, + tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, top + 4, 0).texture(0, 1).color(0, 0, 0, 0); @@ -198,9 +198,9 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) 255); bufferBuilder.vertex(left, top, 0).texture(0, 0).color(0, 0, 0, 255); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); bufferBuilder = - tessellator.method_60827(VertexFormat.DrawMode.QUADS, + tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, bottom, 0).texture(0, 1).color(0, 0, 0, 255); @@ -210,7 +210,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) 0, 0); bufferBuilder.vertex(left, bottom - 4, 0).texture(0, 0).color(0, 0, 0, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); int n = getMaxScroll(); if(n > 0) { @@ -222,23 +222,23 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) p = top; RenderSystem.setShader(GameRenderer::getPositionColorProgram); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, bottom, 0).color(0, 0, 0, 255); bufferBuilder.vertex(j, bottom, 0).color(0, 0, 0, 255); bufferBuilder.vertex(j, top, 0).color(0, 0, 0, 255); bufferBuilder.vertex(i, top, 0).color(0, 0, 0, 255); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + .drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, p + o, 0).color(128, 128, 128, 255); bufferBuilder.vertex(j, p + o, 0).color(128, 128, 128, 255); bufferBuilder.vertex(j, p, 0).color(128, 128, 128, 255); bufferBuilder.vertex(i, p, 0).color(128, 128, 128, 255); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); - bufferBuilder = tessellator.method_60827( + .drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, p + o - 1, 0).color(192, 192, 192, 255); bufferBuilder.vertex(j - 1, p + o - 1, 0).color(192, 192, 192, @@ -246,7 +246,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) bufferBuilder.vertex(j - 1, p, 0).color(192, 192, 192, 255); bufferBuilder.vertex(i, p, 0).color(192, 192, 192, 255); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); } renderDecorations(mouseX, mouseY); @@ -394,23 +394,23 @@ protected void renderList(DrawContext context, int i, int j, int k, int l, int r = left + width / 2 + getRowWidth() / 2; float g = isFocused() ? 1 : 0.5F; RenderSystem.setShaderColor(g, g, g, 1); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(q, o + p + 2, 0); bufferBuilder.vertex(r, o + p + 2, 0); bufferBuilder.vertex(r, o - 2, 0); bufferBuilder.vertex(q, o - 2, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(0, 0, 0, 1); - bufferBuilder = tessellator.method_60827( + bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(q + 1, o + p + 1, 0); bufferBuilder.vertex(r - 1, o + p + 1, 0); bufferBuilder.vertex(r - 1, o - 1, 0); bufferBuilder.vertex(q + 1, o - 1, 0); BufferRenderer - .drawWithGlobalProgram(bufferBuilder.method_60800()); + .drawWithGlobalProgram(bufferBuilder.end()); } RenderSystem.setShaderColor(1, 1, 1, 1); @@ -439,7 +439,7 @@ protected void renderHoleBackground(int top, int bottom, int topAlpha, RenderSystem.setShaderColor(1, 1, 1, 1); RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, bottom, 0).texture(0, bottom / 32).color(64, 64, 64, bottomAlpha); @@ -450,7 +450,7 @@ protected void renderHoleBackground(int top, int bottom, int topAlpha, bufferBuilder.vertex(left, top, 0).texture(0, top / 32).color(64, 64, 64, topAlpha); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public double getScrollAmount() @@ -469,21 +469,21 @@ protected void drawSelectionOutline(MatrixStack matrixStack, int x, int y) RenderSystem.setShaderColor(0.5F, 0.5F, 0.5F, 1); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x - 2, y - 2, 0); bufferBuilder.vertex(matrix, x + 218, y - 2, 0); bufferBuilder.vertex(matrix, x + 218, y + 28, 0); bufferBuilder.vertex(matrix, x - 2, y + 28, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(0, 0, 0, 1); - bufferBuilder = tessellator.method_60827(VertexFormat.DrawMode.QUADS, + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x - 1, y - 1, 0); bufferBuilder.vertex(matrix, x + 217, y - 1, 0); bufferBuilder.vertex(matrix, x + 217, y + 27, 0); bufferBuilder.vertex(matrix, x - 1, y + 27, 0); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(1, 1, 1, 1); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/src/main/java/net/wurstclient/util/RenderUtils.java b/src/main/java/net/wurstclient/util/RenderUtils.java index 5c25e117dd..48b5874cf2 100644 --- a/src/main/java/net/wurstclient/util/RenderUtils.java +++ b/src/main/java/net/wurstclient/util/RenderUtils.java @@ -12,8 +12,6 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.class_9801; import net.minecraft.block.Blocks; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gl.VertexBuffer; @@ -136,7 +134,7 @@ public static void drawSolidBox(Box bb, MatrixStack matrixStack) RenderSystem.setShader(GameRenderer::getPositionProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, minX, minY, minZ); bufferBuilder.vertex(matrix, maxX, minY, minZ); @@ -168,16 +166,16 @@ public static void drawSolidBox(Box bb, MatrixStack matrixStack) bufferBuilder.vertex(matrix, minX, maxY, maxZ); bufferBuilder.vertex(matrix, minX, maxY, minZ); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawSolidBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator - .method_60827(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); drawSolidBox(bb, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -234,7 +232,7 @@ public static void drawOutlinedBox(Box bb, MatrixStack matrixStack) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); float minX = (float)bb.minX; @@ -280,16 +278,16 @@ public static void drawOutlinedBox(Box bb, MatrixStack matrixStack) bufferBuilder.vertex(matrix, minX, maxY, maxZ); bufferBuilder.vertex(matrix, minX, maxY, minZ); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawOutlinedBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawOutlinedBox(bb, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -353,7 +351,7 @@ public static void drawCrossBox(Box bb, MatrixStack matrixStack) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, minX, minY, minZ); @@ -392,16 +390,16 @@ public static void drawCrossBox(Box bb, MatrixStack matrixStack) bufferBuilder.vertex(matrix, maxX, minY, maxZ); bufferBuilder.vertex(matrix, maxX, minY, minZ); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawCrossBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawCrossBox(bb, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -464,7 +462,7 @@ public static void drawNode(Box bb, MatrixStack matrixStack) double midY = (bb.minY + bb.maxY) / 2; double midZ = (bb.minZ + bb.maxZ) / 2; - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); @@ -503,16 +501,16 @@ public static void drawNode(Box bb, MatrixStack matrixStack) bufferBuilder.vertex(matrix, (float)midX, (float)bb.minY, (float)midZ); bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawNode(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawNode(bb, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); @@ -573,7 +571,7 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) RenderSystem.setShader(GameRenderer::getPositionProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); double startX = from.x; @@ -637,17 +635,17 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) matrixStack.pop(); - BufferRenderer.drawWithGlobalProgram(bufferBuilder.method_60800()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } public static void drawArrow(Vec3d from, Vec3d to, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.method_60827( + BufferBuilder bufferBuilder = tessellator.begin( VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawArrow(from, to, bufferBuilder); - class_9801 buffer = bufferBuilder.method_60800(); + BuiltBuffer buffer = bufferBuilder.end(); vertexBuffer.bind(); vertexBuffer.upload(buffer); From ffa13bd95189b4f63f06de7a1b4a53a3a851a4f6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 20:46:12 +0200 Subject: [PATCH 10/17] Update to 1.21-pre1 --- .../java/net/wurstclient/ai/PathRenderer.java | 8 +- .../wurstclient/altmanager/AltRenderer.java | 4 +- .../altmanager/screens/AltEditorScreen.java | 4 +- .../altmanager/screens/AltManagerScreen.java | 11 +- .../net/wurstclient/clickgui/ClickGui.java | 59 ++++----- .../components/ComboBoxComponent.java | 8 +- .../clickgui/components/FeatureButton.java | 8 +- .../clickgui/components/RadarComponent.java | 5 +- .../net/wurstclient/hacks/BaseFinderHack.java | 36 +++--- .../net/wurstclient/hacks/CaveFinderHack.java | 36 ++++-- .../net/wurstclient/hacks/FreecamHack.java | 4 +- .../net/wurstclient/hacks/ItemEspHack.java | 4 +- .../wurstclient/hacks/MobSpawnEspHack.java | 29 +++-- .../net/wurstclient/hacks/SearchHack.java | 36 ++++-- .../net/wurstclient/hacks/SkinDerpHack.java | 1 + .../net/wurstclient/hacks/TunnellerHack.java | 120 ++++++++++-------- .../hacks/autofarm/AutoFarmRenderer.java | 31 ++++- .../hacks/autofish/AutoFishDebugDraw.java | 4 +- .../hacks/autolibrarian/BookOffer.java | 2 +- .../hacks/chestesp/ChestEspRenderer.java | 4 +- .../newchunks/NewChunksChunkRenderer.java | 1 + .../newchunks/NewChunksOutlineRenderer.java | 5 +- .../newchunks/NewChunksReasonsRenderer.java | 1 + .../hacks/newchunks/NewChunksRenderer.java | 7 + .../newchunks/NewChunksSquareRenderer.java | 3 +- .../hacks/portalesp/PortalEspRenderer.java | 4 +- .../net/wurstclient/hacks/treebot/Tree.java | 5 +- .../java/net/wurstclient/hud/WurstLogo.java | 4 +- .../mixin/BackgroundRendererMixin.java | 1 + .../net/wurstclient/mixin/CameraMixin.java | 3 +- .../mixin/DisconnectedScreenMixin.java | 5 +- .../navigator/NavigatorFeatureScreen.java | 8 +- .../navigator/NavigatorMainScreen.java | 12 +- .../navigator/NavigatorScreen.java | 4 +- .../java/net/wurstclient/util/ListWidget.java | 45 +++---- .../net/wurstclient/util/RenderUtils.java | 33 ++--- src/main/resources/fabric.mod.json | 6 +- 37 files changed, 319 insertions(+), 242 deletions(-) diff --git a/src/main/java/net/wurstclient/ai/PathRenderer.java b/src/main/java/net/wurstclient/ai/PathRenderer.java index edb8570ffd..626e7eba0e 100644 --- a/src/main/java/net/wurstclient/ai/PathRenderer.java +++ b/src/main/java/net/wurstclient/ai/PathRenderer.java @@ -29,8 +29,8 @@ public static void renderArrow(MatrixStack matrixStack, BlockPos start, { Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); int startX = start.getX() - region.x(); int startY = start.getY(); @@ -112,8 +112,8 @@ public static void renderNode(MatrixStack matrixStack, BlockPos pos, Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); // middle part bufferBuilder.vertex(matrix, 0, 0, 1); diff --git a/src/main/java/net/wurstclient/altmanager/AltRenderer.java b/src/main/java/net/wurstclient/altmanager/AltRenderer.java index 1d984414af..4c85d301f6 100644 --- a/src/main/java/net/wurstclient/altmanager/AltRenderer.java +++ b/src/main/java/net/wurstclient/altmanager/AltRenderer.java @@ -67,8 +67,8 @@ private static void drawTexture(DrawContext context, int x, int y, float u, RenderSystem.setShader(GameRenderer::getPositionTexProgram); MatrixStack matrixStack = context.getMatrices(); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); - BufferBuilder bufferBuilder = Tessellator.getInstance().begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); + BufferBuilder bufferBuilder = Tessellator.getInstance() + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); bufferBuilder.vertex(matrix4f, x, y, z).texture(uOverFw, vOverFh); bufferBuilder.vertex(matrix4f, x, y2, z).texture(uOverFw, vPlusHOverFh); bufferBuilder.vertex(matrix4f, x2, y2, z).texture(uPlusWOverFw, diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java index 7b2ad6d07a..4c54f11147 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java @@ -384,8 +384,8 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, width, 0, 0); bufferBuilder.vertex(matrix, width, height, 0); diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java index a72ccb90a5..5d97b2cbd0 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java @@ -459,8 +459,8 @@ public void render(DrawContext context, int mouseX, int mouseY, RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, 0, 0, 0); bufferBuilder.vertex(matrix, width, 0, 0); bufferBuilder.vertex(matrix, width, height, 0); @@ -660,14 +660,13 @@ protected void renderItem(DrawContext context, int id, int x, int y, RenderSystem.setShaderColor(0, 1, 0, opacity); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x - 2, y - 2, 0); bufferBuilder.vertex(matrix, x - 2 + 220, y - 2, 0); bufferBuilder.vertex(matrix, x - 2 + 220, y - 2 + 30, 0); bufferBuilder.vertex(matrix, x - 2, y - 2 + 30, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/net/wurstclient/clickgui/ClickGui.java b/src/main/java/net/wurstclient/clickgui/ClickGui.java index 78336b26b8..e17d1ae438 100644 --- a/src/main/java/net/wurstclient/clickgui/ClickGui.java +++ b/src/main/java/net/wurstclient/clickgui/ClickGui.java @@ -676,8 +676,8 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs2, ys1, 0); bufferBuilder.vertex(matrix, xs2, ys2, 0); bufferBuilder.vertex(matrix, xs3, ys2, 0); @@ -690,8 +690,7 @@ private void renderWindow(DrawContext context, Window window, int mouseX, bufferBuilder.vertex(matrix, xs1, ys2, 0); bufferBuilder.vertex(matrix, xs2, ys2, 0); bufferBuilder.vertex(matrix, xs2, ys4, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); boolean hovering = mouseX >= xs1 && mouseY >= ys3 && mouseX < xs2 && mouseY < ys4; @@ -700,29 +699,27 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], hovering ? opacity * 1.5F : opacity); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs1, ys3, 0); bufferBuilder.vertex(matrix, xs1, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys3, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); // outline RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINE_STRIP, - VertexFormats.POSITION); + bufferBuilder = + tessellator.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, xs1, ys3, 0); bufferBuilder.vertex(matrix, xs1, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys4, 0); bufferBuilder.vertex(matrix, xs2, ys3, 0); bufferBuilder.vertex(matrix, xs1, ys3, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } int x3 = x1 + 2; @@ -735,8 +732,8 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); @@ -759,8 +756,8 @@ private void renderWindow(DrawContext context, Window window, int mouseX, RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], opacity); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION); // window background // between children @@ -825,8 +822,8 @@ private void renderWindow(DrawContext context, Window window, int mouseX, if(!window.isMinimized()) { // title bar outline - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x2, y3, 0); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); @@ -970,8 +967,8 @@ private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, } // arrow - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); @@ -1009,8 +1006,8 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(h, 0, 0, 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); @@ -1028,8 +1025,8 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); @@ -1082,8 +1079,8 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // knob RenderSystem.setShaderColor(0, h, 0, 1); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xk1, yk1, 0); bufferBuilder.vertex(matrix, xk2, yk2, 0); bufferBuilder.vertex(matrix, xk3, yk3, 0); @@ -1103,8 +1100,8 @@ private void renderPinButton(MatrixStack matrixStack, int x1, int y1, // needle RenderSystem.setShaderColor(h, h, h, 1); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.TRIANGLES, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, xn1, yn1, 0); bufferBuilder.vertex(matrix, xn2, yn2, 0); bufferBuilder.vertex(matrix, xn3, yn3, 0); @@ -1181,8 +1178,8 @@ private void renderCloseButton(MatrixStack matrixStack, int x1, int y1, // outline RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, xc1, yc1, 0); bufferBuilder.vertex(matrix, xc2, yc2, 0); bufferBuilder.vertex(matrix, xc6, yc5, 0); diff --git a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java index d6c4a23f3f..6ba454e70b 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java @@ -205,8 +205,8 @@ private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); @@ -238,8 +238,8 @@ private void drawArrow(MatrixStack matrixStack, int x2, int x3, int y1, } // arrow - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); diff --git a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java index 634a6312d6..3f2989dfac 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java @@ -235,8 +235,8 @@ private void drawSeparator(MatrixStack matrixStack, int x3, int y1, int y2) Tessellator tessellator = RenderSystem.renderThreadTesselator(); // separator - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x3, y1, 0); bufferBuilder.vertex(matrix, x3, y2, 0); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); @@ -268,8 +268,8 @@ private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, } // arrow - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xa1, ya1, 0); bufferBuilder.vertex(matrix, xa3, ya1, 0); bufferBuilder.vertex(matrix, xa2, ya2, 0); diff --git a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java index 1d5ccd1b95..6f5b795f58 100644 --- a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java @@ -16,6 +16,7 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BufferRenderer; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -190,7 +191,9 @@ else if(e instanceof AnimalEntity || e instanceof AmbientEntity middleY + (float)renderY + 0.5F, 0) .color(red, green, blue, alpha); } - BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + BuiltBuffer buffer = bufferBuilder.endNullable(); + if(buffer != null) + BufferRenderer.drawWithGlobalProgram(buffer); } @Override diff --git a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java index b07835a3d8..b3d5bb2473 100644 --- a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java @@ -16,6 +16,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; @@ -200,23 +201,28 @@ public void onUpdate() if(modulo == 0 || !region.equals(lastRegion)) { if(vertexBuffer != null) + { vertexBuffer.close(); + vertexBuffer = null; + } - vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - - for(int[] vertex : vertices) - bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()); - - BuiltBuffer buffer = bufferBuilder.end(); - - vertexBuffer.bind(); - vertexBuffer.upload(buffer); - VertexBuffer.unbind(); + if(!vertices.isEmpty()) + { + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + for(int[] vertex : vertices) + bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], + vertex[2] - region.z()); + + BuiltBuffer buffer = bufferBuilder.end(); + + vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffer.bind(); + vertexBuffer.upload(buffer); + VertexBuffer.unbind(); + } lastRegion = region; } diff --git a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java index 143c72f84c..1f6cdb6a25 100644 --- a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java @@ -19,6 +19,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.Blocks; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; @@ -253,24 +254,31 @@ else if(notify) private void setBufferFromTask() { - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator - .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - + ArrayList vertices = compileVerticesTask.join(); RegionPos region = RenderUtils.getCameraRegion(); - for(int[] vertex : compileVerticesTask.join()) - bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()); - - BuiltBuffer buffer = bufferBuilder.end(); - if(vertexBuffer != null) + { vertexBuffer.close(); + vertexBuffer = null; + } - vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - vertexBuffer.bind(); - vertexBuffer.upload(buffer); - VertexBuffer.unbind(); + if(!vertices.isEmpty()) + { + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + for(int[] vertex : vertices) + bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], + vertex[2] - region.z()); + + BuiltBuffer buffer = bufferBuilder.end(); + + vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffer.bind(); + vertexBuffer.upload(buffer); + VertexBuffer.unbind(); + } bufferUpToDate = true; bufferRegion = region; diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index 023387f19b..40378213dc 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -215,8 +215,8 @@ public void onRender(MatrixStack matrixStack, float partialTicks) Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, (float)start.x, (float)start.y, (float)start.z); bufferBuilder.vertex(matrix, (float)end.x, (float)end.y, (float)end.z); diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index 138a691226..fbe4f4e372 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -172,8 +172,8 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionVec); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(ItemEntity e : items) { Vec3d end = EntityUtils.getLerpedBox(e, partialTicks).getCenter() diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index a7dc3d9cf8..bc10af12f7 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -7,7 +7,13 @@ */ package net.wurstclient.hacks; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.ConcurrentModificationException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.stream.Collectors; @@ -16,6 +22,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.BlockState; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; @@ -294,15 +301,17 @@ private void compileBuffer() RegionPos region = RegionPos.of(chunk.getPos()); if(vertexBuffer != null) + { vertexBuffer.close(); + vertexBuffer = null; + } - vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); - new ArrayList<>(red).stream().filter(Objects::nonNull) + new ArrayList<>(red).stream() .map(pos -> new BlockPos(pos.getX() - region.x(), pos.getY(), pos.getZ() - region.z())) .forEach(pos -> { @@ -319,7 +328,7 @@ private void compileBuffer() .color(1, 0, 0, 0.5F); }); - new ArrayList<>(yellow).stream().filter(Objects::nonNull) + new ArrayList<>(yellow).stream() .map(pos -> new BlockPos(pos.getX() - region.x(), pos.getY(), pos.getZ() - region.z())) .forEach(pos -> { @@ -336,10 +345,14 @@ private void compileBuffer() .color(1, 1, 0, 0.5F); }); - BuiltBuffer buffer = bufferBuilder.end(); - vertexBuffer.bind(); - vertexBuffer.upload(buffer); - VertexBuffer.unbind(); + BuiltBuffer buffer = bufferBuilder.endNullable(); + if(buffer != null) + { + vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffer.bind(); + vertexBuffer.upload(buffer); + VertexBuffer.unbind(); + } doneCompiling = true; } diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index 4855577b17..87a445a7c1 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -18,6 +18,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.Block; import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; @@ -256,24 +257,31 @@ else if(notify) private void setBufferFromTask() { - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator - .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - + ArrayList vertices = compileVerticesTask.join(); RegionPos region = RenderUtils.getCameraRegion(); - for(int[] vertex : compileVerticesTask.join()) - bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], - vertex[2] - region.z()); - - BuiltBuffer buffer = bufferBuilder.end(); - if(vertexBuffer != null) + { vertexBuffer.close(); + vertexBuffer = null; + } - vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - vertexBuffer.bind(); - vertexBuffer.upload(buffer); - VertexBuffer.unbind(); + if(!vertices.isEmpty()) + { + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + for(int[] vertex : vertices) + bufferBuilder.vertex(vertex[0] - region.x(), vertex[1], + vertex[2] - region.z()); + + BuiltBuffer buffer = bufferBuilder.endNullable(); + + vertexBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffer.bind(); + vertexBuffer.upload(buffer); + VertexBuffer.unbind(); + } bufferUpToDate = true; bufferRegion = region; diff --git a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java index 618a8338fe..9a8f336688 100644 --- a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java +++ b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java @@ -8,6 +8,7 @@ package net.wurstclient.hacks; import java.util.Random; + import net.minecraft.entity.player.PlayerModelPart; import net.wurstclient.Category; import net.wurstclient.SearchTags; diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 6f201fe4b2..f3e05f885e 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -16,6 +16,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -271,8 +272,8 @@ private void updateCyanBuffer() vertexBuffers[0] = new VertexBuffer(VertexBuffer.Usage.STATIC); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RegionPos region = RenderUtils.getCameraRegion(); Vec3d offset = Vec3d.ofCenter(start).subtract(region.toVec3d()); @@ -383,9 +384,10 @@ public void run() getAllInBox(from, to).forEach(blocks::add); if(vertexBuffers[1] != null) + { vertexBuffers[1].close(); - - vertexBuffers[1] = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffers[1] = null; + } RegionPos region = RenderUtils.getCameraRegion(); Box box = new Box(0.1, 0.1, 0.1, 0.9, 0.9, 0.9) @@ -411,10 +413,14 @@ public void run() RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); } - BuiltBuffer buffer = bufferBuilder.end(); - vertexBuffers[1].bind(); - vertexBuffers[1].upload(buffer); - VertexBuffer.unbind(); + BuiltBuffer buffer = bufferBuilder.endNullable(); + if(buffer != null) + { + vertexBuffers[1] = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffers[1].bind(); + vertexBuffers[1].upload(buffer); + VertexBuffer.unbind(); + } if(currentBlock == null) { @@ -493,27 +499,32 @@ public boolean canRun() blocks.add(pos); if(vertexBuffers[2] != null) + { vertexBuffers[2].close(); + vertexBuffers[2] = null; + } - vertexBuffers[2] = new VertexBuffer(VertexBuffer.Usage.STATIC); - - RegionPos region = RenderUtils.getCameraRegion(); - Box box = new Box(0.1, 0.1, 0.1, 0.9, 0.9, 0.9) - .offset(region.negate().toVec3d()); - - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); - - for(BlockPos pos : blocks) - RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - - BuiltBuffer buffer = bufferBuilder.end(); - vertexBuffers[2].bind(); - vertexBuffers[2].upload(buffer); - VertexBuffer.unbind(); + if(!blocks.isEmpty()) + { + RegionPos region = RenderUtils.getCameraRegion(); + Box box = new Box(0.1, 0.1, 0.1, 0.9, 0.9, 0.9) + .offset(region.negate().toVec3d()); + + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.begin( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + for(BlockPos pos : blocks) + RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); + + vertexBuffers[2] = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffers[2].bind(); + vertexBuffers[2].upload(bufferBuilder.end()); + VertexBuffer.unbind(); + return true; + } - return !blocks.isEmpty(); + return false; } private BlockPos offsetFloor(BlockPos pos, Vec3i vec) @@ -634,26 +645,32 @@ public boolean canRun() ChatUtils.error("The tunnel is flooded, cannot continue."); if(vertexBuffers[3] != null) + { vertexBuffers[3].close(); + vertexBuffers[3] = null; + } - vertexBuffers[3] = new VertexBuffer(VertexBuffer.Usage.STATIC); - - RegionPos region = RenderUtils.getCameraRegion(); - Box box = new Box(0.1, 0.1, 0.1, 0.9, 0.9, 0.9) - .offset(region.negate().toVec3d()); - - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); - - for(BlockPos pos : liquids) - RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); - - BuiltBuffer buffer = bufferBuilder.end(); + if(!liquids.isEmpty()) + { + RegionPos region = RenderUtils.getCameraRegion(); + Box box = new Box(0.1, 0.1, 0.1, 0.9, 0.9, 0.9) + .offset(region.negate().toVec3d()); + + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.begin( + VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + for(BlockPos pos : liquids) + RenderUtils.drawOutlinedBox(box.offset(pos), bufferBuilder); + + BuiltBuffer buffer = bufferBuilder.end(); + + vertexBuffers[3] = new VertexBuffer(VertexBuffer.Usage.STATIC); + vertexBuffers[3].bind(); + vertexBuffers[3].upload(buffer); + VertexBuffer.unbind(); + } - vertexBuffers[3].bind(); - vertexBuffers[3].upload(buffer); - VertexBuffer.unbind(); return true; } @@ -711,15 +728,16 @@ private class PlaceTorchTask extends Task @Override public boolean canRun() { + if(vertexBuffers[4] != null) + { + vertexBuffers[4].close(); + vertexBuffers[4] = null; + } + if(!torches.isChecked()) { lastTorch = null; nextTorch = BlockPos.ofFloored(MC.player.getPos()); - if(vertexBuffers[4] != null) - { - vertexBuffers[4].close(); - vertexBuffers[4] = null; - } return false; } @@ -730,15 +748,11 @@ public boolean canRun() nextTorch = lastTorch.offset(direction, size.getSelected().torchDistance); - if(vertexBuffers[4] != null) - vertexBuffers[4].close(); - - vertexBuffers[4] = new VertexBuffer(VertexBuffer.Usage.STATIC); - RegionPos region = RenderUtils.getCameraRegion(); Vec3d torchVec = Vec3d.ofBottomCenter(nextTorch).subtract(region.toVec3d()); + vertexBuffers[4] = new VertexBuffer(VertexBuffer.Usage.STATIC); RenderUtils.drawArrow(torchVec, torchVec.add(0, 0.5, 0), vertexBuffers[4]); diff --git a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java index 298f392e6c..22a2594609 100644 --- a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java +++ b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java @@ -16,6 +16,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; @@ -112,11 +113,17 @@ private void updateGreenBuffer(List blocksToHarvest, Tessellator tessellator, Box box, Vec3d regionOffset) { if(greenBuffer != null) + { greenBuffer.close(); + greenBuffer = null; + } + + if(blocksToHarvest.isEmpty()) + return; greenBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToHarvest) { @@ -134,11 +141,17 @@ private void updateCyanBuffer(Set plants, Tessellator tessellator, Box node, Vec3d regionOffset) { if(cyanBuffer != null) + { cyanBuffer.close(); + cyanBuffer = null; + } + + if(plants.isEmpty()) + return; cyanBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : plants) { @@ -156,11 +169,17 @@ private void updateRedBuffer(List blocksToReplant, Tessellator tessellator, Box box, Vec3d regionOffset) { if(redBuffer != null) + { redBuffer.close(); + redBuffer = null; + } + + if(blocksToReplant.isEmpty()) + return; redBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(BlockPos pos : blocksToReplant) { diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java index 079119bc59..820e098cba 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java @@ -141,8 +141,8 @@ private void drawLastBite(MatrixStack matrixStack, RegionPos region) float[] colorF = ddColor.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, -0.125F, 0, -0.125F); bufferBuilder.vertex(matrix, 0.125F, 0, 0.125F); bufferBuilder.vertex(matrix, 0.125F, 0, -0.125F); diff --git a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java index 095c067f46..e0b6214508 100644 --- a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java +++ b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java @@ -102,7 +102,7 @@ public boolean isFullyValid() */ public boolean isMostlyValid() { - return Identifier.isValid(id) && level >= 1 && price >= 1 + return Identifier.tryParse(id) != null && level >= 1 && price >= 1 && price <= 64; } diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java index 0c659216c9..e49263dad0 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java @@ -86,8 +86,8 @@ public void renderLines(ChestEspGroup group) float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) { diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java index bc40c0ace4..880d5c2234 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java @@ -8,6 +8,7 @@ package net.wurstclient.hacks.newchunks; import java.util.Set; + import net.minecraft.client.render.BuiltBuffer; import net.minecraft.util.math.ChunkPos; diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java index b1dab13eab..54a3533bbf 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java @@ -12,6 +12,7 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; @@ -28,8 +29,8 @@ public final class NewChunksOutlineRenderer implements NewChunksChunkRenderer public BuiltBuffer buildBuffer(Set chunks, int drawDistance) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); return bufferBuilder.end(); } diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java index 40f26d76fd..beaa167403 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java @@ -12,6 +12,7 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java index 2f7a09d58e..3e5ea82816 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java @@ -11,6 +11,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BuiltBuffer; @@ -40,6 +41,12 @@ public NewChunksRenderer(SliderSetting altitude, SliderSetting opacity, public void updateBuffer(int i, BuiltBuffer buffer) { + if(buffer == null) + { + vertexBuffers[i] = null; + return; + } + vertexBuffers[i] = new VertexBuffer(VertexBuffer.Usage.STATIC); vertexBuffers[i].bind(); vertexBuffers[i].upload(buffer); diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java index 87083e5b7d..1e531af9b5 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java @@ -12,6 +12,7 @@ import java.util.Set; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.Tessellator; @@ -31,7 +32,7 @@ public BuiltBuffer buildBuffer(Set chunks, int drawDistance) BufferBuilder bufferBuilder = tessellator .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.end(); + return bufferBuilder.endNullable(); } private void renderChunks(List chunks, int drawDistance, diff --git a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java index d579d9be75..e56b08db28 100644 --- a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java @@ -86,8 +86,8 @@ public void renderLines(PortalEspBlockGroup group) float[] colorF = group.getColorF(); RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); for(Box box : group.getBoxes()) { diff --git a/src/main/java/net/wurstclient/hacks/treebot/Tree.java b/src/main/java/net/wurstclient/hacks/treebot/Tree.java index e9b6b88ec8..7b0202ed86 100644 --- a/src/main/java/net/wurstclient/hacks/treebot/Tree.java +++ b/src/main/java/net/wurstclient/hacks/treebot/Tree.java @@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.client.gl.ShaderProgram; import net.minecraft.client.gl.VertexBuffer; import net.minecraft.client.render.BufferBuilder; @@ -54,8 +55,8 @@ public void compileBuffer() .offset(regionOffset); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); RenderUtils.drawCrossBox(box.offset(stump), bufferBuilder); diff --git a/src/main/java/net/wurstclient/hud/WurstLogo.java b/src/main/java/net/wurstclient/hud/WurstLogo.java index 1246d02422..29889940ce 100644 --- a/src/main/java/net/wurstclient/hud/WurstLogo.java +++ b/src/main/java/net/wurstclient/hud/WurstLogo.java @@ -82,8 +82,8 @@ private void drawQuads(MatrixStack matrices, int x1, int y1, int x2, int y2, RenderSystem.setShader(GameRenderer::getPositionColorProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(matrix, x1, y2, 0.0F).color(r, g, b, a); bufferBuilder.vertex(matrix, x2, y2, 0.0F).color(r, g, b, a); bufferBuilder.vertex(matrix, x2, y1, 0.0F).color(r, g, b, a); diff --git a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java index 5e00da47f3..552fcd1abb 100644 --- a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java @@ -14,6 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.enums.CameraSubmersionType; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; diff --git a/src/main/java/net/wurstclient/mixin/CameraMixin.java b/src/main/java/net/wurstclient/mixin/CameraMixin.java index 880675f9bb..f82efa7a79 100644 --- a/src/main/java/net/wurstclient/mixin/CameraMixin.java +++ b/src/main/java/net/wurstclient/mixin/CameraMixin.java @@ -12,6 +12,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + import net.minecraft.block.enums.CameraSubmersionType; import net.minecraft.client.render.Camera; import net.wurstclient.WurstClient; @@ -42,7 +43,7 @@ private void onClipToSpace(float desiredCameraDistance, } @Inject(at = @At("HEAD"), - method = "getSubmersionType()Lnet/minecraft/client/render/CameraSubmersionType;", + method = "getSubmersionType()Lnet/minecraft/block/enums/CameraSubmersionType;", cancellable = true) private void onGetSubmersionType( CallbackInfoReturnable cir) diff --git a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java index 229bf6ca90..c166585cdf 100644 --- a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java @@ -15,6 +15,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + import net.minecraft.client.gui.screen.DisconnectedScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; @@ -35,7 +36,7 @@ public class DisconnectedScreenMixin extends Screen @Shadow @Final - private DisconnectionInfo field_52131;// reason container thing + private DisconnectionInfo info; @Shadow @Final private Screen parent; @@ -54,7 +55,7 @@ private void onInit(CallbackInfo ci) if(!WurstClient.INSTANCE.isEnabled()) return; - Text reason = field_52131.reason(); + Text reason = info.reason(); System.out.println("Disconnected: " + reason); if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) diff --git a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java index d4abb4f69b..418f62d219 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java @@ -380,8 +380,8 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, // window background // left & right setColorToBackground(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, y3, 0); bufferBuilder.vertex(matrix, x1, y2, 0); bufferBuilder.vertex(matrix, x3, y2, 0); @@ -393,8 +393,8 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); setColorToBackground(); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION); // window background // between children diff --git a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java index b91c62b123..d60232f1d1 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java @@ -303,8 +303,8 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, // background RenderSystem.setShaderColor(bgColor[0], bgColor[1], bgColor[2], 0.75F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(matrix, xt1, yt1, 0); bufferBuilder.vertex(matrix, xt1, yt2, 0); bufferBuilder.vertex(matrix, xt2, yt2, 0); @@ -428,8 +428,8 @@ else if(clickTimer == 0) int by2 = by1 + area.height - 4; float[] acColor = WurstClient.INSTANCE.getGui().getAcColor(); RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, bx1, by1, 0); bufferBuilder.vertex(matrix, bx1, by2, 0); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); @@ -449,8 +449,8 @@ else if(clickTimer == 0) // arrow RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.TRIANGLES, + VertexFormats.POSITION); bufferBuilder.vertex(matrix, ax1, ay1, 0); bufferBuilder.vertex(matrix, ax2, ay1, 0); bufferBuilder.vertex(matrix, ax3, ay2, 0); diff --git a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java index b5d859106a..1f4351dc7f 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java @@ -341,8 +341,8 @@ protected final void drawDownShadow(MatrixStack matrixStack, int x1, int y1, // outline float yi1 = y1 + 0.1F; RenderSystem.setShaderColor(acColor[0], acColor[1], acColor[2], 0.5F); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, x1, yi1, 0); bufferBuilder.vertex(matrix, x2, yi1, 0); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); diff --git a/src/main/java/net/wurstclient/util/ListWidget.java b/src/main/java/net/wurstclient/util/ListWidget.java index 289b69a0cf..a6b43229ae 100644 --- a/src/main/java/net/wurstclient/util/ListWidget.java +++ b/src/main/java/net/wurstclient/util/ListWidget.java @@ -187,9 +187,8 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ZERO, GlStateManager.DstFactor.ONE); RenderSystem.setShaderColor(1, 1, 1, 1); - bufferBuilder = - tessellator.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, top + 4, 0).texture(0, 1).color(0, 0, 0, 0); bufferBuilder.vertex(right, top + 4, 0).texture(1, 1).color(0, 0, 0, @@ -199,9 +198,8 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) bufferBuilder.vertex(left, top, 0).texture(0, 0).color(0, 0, 0, 255); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); - bufferBuilder = - tessellator.begin(VertexFormat.DrawMode.QUADS, - VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_TEXTURE_COLOR); bufferBuilder.vertex(left, bottom, 0).texture(0, 1).color(0, 0, 0, 255); bufferBuilder.vertex(right, bottom, 0).texture(1, 1).color(0, 0, 0, @@ -222,31 +220,28 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) p = top; RenderSystem.setShader(GameRenderer::getPositionColorProgram); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, bottom, 0).color(0, 0, 0, 255); bufferBuilder.vertex(j, bottom, 0).color(0, 0, 0, 255); bufferBuilder.vertex(j, top, 0).color(0, 0, 0, 255); bufferBuilder.vertex(i, top, 0).color(0, 0, 0, 255); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, p + o, 0).color(128, 128, 128, 255); bufferBuilder.vertex(j, p + o, 0).color(128, 128, 128, 255); bufferBuilder.vertex(j, p, 0).color(128, 128, 128, 255); bufferBuilder.vertex(i, p, 0).color(128, 128, 128, 255); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION_COLOR); bufferBuilder.vertex(i, p + o - 1, 0).color(192, 192, 192, 255); bufferBuilder.vertex(j - 1, p + o - 1, 0).color(192, 192, 192, 255); bufferBuilder.vertex(j - 1, p, 0).color(192, 192, 192, 255); bufferBuilder.vertex(i, p, 0).color(192, 192, 192, 255); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } renderDecorations(mouseX, mouseY); @@ -394,23 +389,21 @@ protected void renderList(DrawContext context, int i, int j, int k, int l, int r = left + width / 2 + getRowWidth() / 2; float g = isFocused() ? 1 : 0.5F; RenderSystem.setShaderColor(g, g, g, 1); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); bufferBuilder.vertex(q, o + p + 2, 0); bufferBuilder.vertex(r, o + p + 2, 0); bufferBuilder.vertex(r, o - 2, 0); bufferBuilder.vertex(q, o - 2, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); RenderSystem.setShaderColor(0, 0, 0, 1); - bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, + VertexFormats.POSITION); bufferBuilder.vertex(q + 1, o + p + 1, 0); bufferBuilder.vertex(r - 1, o + p + 1, 0); bufferBuilder.vertex(r - 1, o - 1, 0); bufferBuilder.vertex(q + 1, o - 1, 0); - BufferRenderer - .drawWithGlobalProgram(bufferBuilder.end()); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } RenderSystem.setShaderColor(1, 1, 1, 1); diff --git a/src/main/java/net/wurstclient/util/RenderUtils.java b/src/main/java/net/wurstclient/util/RenderUtils.java index 48b5874cf2..4c36c4eaa6 100644 --- a/src/main/java/net/wurstclient/util/RenderUtils.java +++ b/src/main/java/net/wurstclient/util/RenderUtils.java @@ -12,6 +12,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; + import net.minecraft.block.Blocks; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gl.VertexBuffer; @@ -232,8 +233,8 @@ public static void drawOutlinedBox(Box bb, MatrixStack matrixStack) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); RenderSystem.setShader(GameRenderer::getPositionProgram); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); float minX = (float)bb.minX; float minY = (float)bb.minY; @@ -284,8 +285,8 @@ public static void drawOutlinedBox(Box bb, MatrixStack matrixStack) public static void drawOutlinedBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawOutlinedBox(bb, bufferBuilder); BuiltBuffer buffer = bufferBuilder.end(); @@ -351,8 +352,8 @@ public static void drawCrossBox(Box bb, MatrixStack matrixStack) Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, minX, minY, minZ); bufferBuilder.vertex(matrix, maxX, maxY, minZ); @@ -396,8 +397,8 @@ public static void drawCrossBox(Box bb, MatrixStack matrixStack) public static void drawCrossBox(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawCrossBox(bb, bufferBuilder); BuiltBuffer buffer = bufferBuilder.end(); @@ -462,8 +463,8 @@ public static void drawNode(Box bb, MatrixStack matrixStack) double midY = (bb.minY + bb.maxY) / 2; double midZ = (bb.minZ + bb.maxZ) / 2; - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); bufferBuilder.vertex(matrix, (float)midX, (float)midY, (float)bb.maxZ); bufferBuilder.vertex(matrix, (float)bb.minX, (float)midY, (float)midZ); @@ -507,8 +508,8 @@ public static void drawNode(Box bb, MatrixStack matrixStack) public static void drawNode(Box bb, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawNode(bb, bufferBuilder); BuiltBuffer buffer = bufferBuilder.end(); @@ -571,8 +572,8 @@ public static void drawArrow(Vec3d from, Vec3d to, MatrixStack matrixStack) RenderSystem.setShader(GameRenderer::getPositionProgram); Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); double startX = from.x; double startY = from.y; @@ -642,8 +643,8 @@ public static void drawArrow(Vec3d from, Vec3d to, VertexBuffer vertexBuffer) { Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.begin( - VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + BufferBuilder bufferBuilder = tessellator + .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); drawArrow(from, to, bufferBuilder); BuiltBuffer buffer = bufferBuilder.end(); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 66dac03e74..61729aab29 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,9 +29,9 @@ "accessWidener" : "wurst.accesswidener", "depends": { - "fabricloader": ">=0.15.9", - "fabric-api": ">=0.99.1", - "minecraft": "~1.21-alpha.24.21.a", + "fabricloader": ">=0.15.10", + "fabric-api": ">=0.99.2", + "minecraft": "~1.21-beta.1", "java": ">=21" }, "suggests": { From cc72c8d737b453de5081f60046b63eda1c1c4d5c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 31 May 2024 16:40:52 +0200 Subject: [PATCH 11/17] [Wurst-Bot] Update to 1.21-pre2 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- .../java/net/wurstclient/hacks/AutoLibrarianHack.java | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0763f0db3d..1fcb369ca4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=1.21-pre1 -yarn_mappings=1.21-pre1+build.2 +minecraft_version=1.21-pre2 +yarn_mappings=1.21-pre2+build.1 loader_version=0.15.11 # Fabric API -fabric_version=0.99.2+1.21 +fabric_version=0.99.4+1.21 # Mod Properties -mod_version = v7.42-MC1.21-pre1 +mod_version = v7.42-MC1.21-pre2 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 2bca7d27d5..9bac128636 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "1.21-pre1"; + public static final String MC_VERSION = "1.21-pre2"; private WurstAnalytics analytics; private EventManager eventManager; diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 7a097ca782..1914c6803d 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -423,7 +423,8 @@ private BookOffer findEnchantedBookOffer(TradeOfferList tradeOffers) continue; Set>> enchantmentLevelMap = - EnchantmentHelper.getEnchantments(stack).getEnchantmentsMap(); + EnchantmentHelper.getEnchantments(stack) + .getEnchantmentEntries(); if(enchantmentLevelMap.isEmpty()) continue; From 9248ad5453f9b6b6547929e93a6042e985ccb529 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 5 Jun 2024 19:18:15 +0200 Subject: [PATCH 12/17] [Wurst-Bot] Update to 1.21-pre3 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1fcb369ca4..f036c7a1c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=1.21-pre2 -yarn_mappings=1.21-pre2+build.1 +minecraft_version=1.21-pre3 +yarn_mappings=1.21-pre3+build.1 loader_version=0.15.11 # Fabric API -fabric_version=0.99.4+1.21 +fabric_version=0.99.5+1.21 # Mod Properties -mod_version = v7.42-MC1.21-pre2 +mod_version = v7.42-MC1.21-pre3 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 9bac128636..3cd56ec88e 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "1.21-pre2"; + public static final String MC_VERSION = "1.21-pre3"; private WurstAnalytics analytics; private EventManager eventManager; From 3c664b5be24504c3b03d4ffd1de20d786974c95e Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 5 Jun 2024 19:22:24 +0200 Subject: [PATCH 13/17] Update to 1.21-pre3 --- src/main/resources/fabric.mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 61729aab29..ac972418a6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ "depends": { "fabricloader": ">=0.15.10", - "fabric-api": ">=0.99.2", + "fabric-api": ">=0.99.5", "minecraft": "~1.21-beta.1", "java": ">=21" }, From 0ef830b9911476d6ab4dee0ecc74177ae7b46412 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 7 Jun 2024 19:07:55 +0200 Subject: [PATCH 14/17] [Wurst-Bot] Update to 1.21-pre4 --- gradle.properties | 6 +++--- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f036c7a1c8..164aceb87a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=1.21-pre3 -yarn_mappings=1.21-pre3+build.1 +minecraft_version=1.21-pre4 +yarn_mappings=1.21-pre4+build.2 loader_version=0.15.11 # Fabric API fabric_version=0.99.5+1.21 # Mod Properties -mod_version = v7.42-MC1.21-pre3 +mod_version = v7.42-MC1.21-pre4 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 3cd56ec88e..1ee308692b 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "1.21-pre3"; + public static final String MC_VERSION = "1.21-pre4"; private WurstAnalytics analytics; private EventManager eventManager; From fdd2e2670c0daf0cf25ddf0e659e5ba3fc34f4e1 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 10 Jun 2024 17:35:13 +0200 Subject: [PATCH 15/17] [Wurst-Bot] Update to 1.21-rc1 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 164aceb87a..5a0ac2111d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=1.21-pre4 -yarn_mappings=1.21-pre4+build.2 +minecraft_version=1.21-rc1 +yarn_mappings=1.21-rc1+build.1 loader_version=0.15.11 # Fabric API -fabric_version=0.99.5+1.21 +fabric_version=0.100.0+1.21 # Mod Properties -mod_version = v7.42-MC1.21-pre4 +mod_version = v7.42-MC1.21-rc1 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 1ee308692b..5571c4a696 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "1.21-pre4"; + public static final String MC_VERSION = "1.21-rc1"; private WurstAnalytics analytics; private EventManager eventManager; From 0e4114633ae4a9dcc24a0b19521f825a590f0366 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 11 Jun 2024 07:07:07 +0200 Subject: [PATCH 16/17] Fix NewChunks crash Fixes https://wurstforum.net/d/581 --- .../wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java index 54a3533bbf..8d3568401f 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java @@ -32,7 +32,7 @@ public BuiltBuffer buildBuffer(Set chunks, int drawDistance) BufferBuilder bufferBuilder = tessellator .begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); renderChunks(new ArrayList<>(chunks), drawDistance, bufferBuilder); - return bufferBuilder.end(); + return bufferBuilder.endNullable(); } private void renderChunks(List chunks, int drawDistance, From 9a5803988cd1368279f924578786b445bd20a7d9 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 13 Jun 2024 17:15:29 +0200 Subject: [PATCH 17/17] [Wurst-Bot] Update to 1.21 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5a0ac2111d..6a05cb6949 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions -minecraft_version=1.21-rc1 -yarn_mappings=1.21-rc1+build.1 +minecraft_version=1.21 +yarn_mappings=1.21+build.1 loader_version=0.15.11 # Fabric API -fabric_version=0.100.0+1.21 +fabric_version=0.100.1+1.21 # Mod Properties -mod_version = v7.42-MC1.21-rc1 +mod_version = v7.42-MC1.21 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 5571c4a696..68f980a2c3 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.42"; - public static final String MC_VERSION = "1.21-rc1"; + public static final String MC_VERSION = "1.21"; private WurstAnalytics analytics; private EventManager eventManager;