diff --git a/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java b/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java index 8e1bbf7..da4d489 100644 --- a/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java +++ b/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java @@ -59,7 +59,6 @@ public class MeteorRejectsAddon extends MeteorAddon { commands.add(new SetBlockCommand()); commands.add(new TeleportCommand()); commands.add(new TerrainExport()); - commands.add(new RecipeCommand()); HUD hud = modules.get(HUD.class); hud.elements.add(new AppleHud(hud)); diff --git a/src/main/java/cloudburst/rejects/commands/RecipeCommand.java b/src/main/java/cloudburst/rejects/commands/RecipeCommand.java deleted file mode 100644 index 3ca0ed5..0000000 --- a/src/main/java/cloudburst/rejects/commands/RecipeCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -package cloudburst.rejects.commands; - -import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; - -import meteordevelopment.orbit.EventHandler; -import minegame159.meteorclient.events.packets.PacketEvent; -import minegame159.meteorclient.systems.commands.Command; - -import net.minecraft.command.CommandSource; -import net.minecraft.network.packet.c2s.play.RecipeBookDataC2SPacket; -import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket; -import net.minecraft.network.packet.s2c.play.UnlockRecipesS2CPacket; -import net.minecraft.recipe.Recipe; -import net.minecraft.text.LiteralText; -import net.minecraft.util.Identifier; - -import java.util.*; - -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; - -public class RecipeCommand extends Command { - - private final static SimpleCommandExceptionType NO_RECIPES = new SimpleCommandExceptionType(new LiteralText("Couldn't obtain any recipes.")); - public Iterable> recipes = null; - - public RecipeCommand() { - super("recipe", "Grants or removes recipes"); - } - - @Override - public void build(LiteralArgumentBuilder builder) { - builder.then(literal("grant").executes(ctx -> { - if (recipes == null) throw NO_RECIPES.create(); - - List recipeIdentifiers = new ArrayList<>(); - - recipes.forEach(recipe -> { - recipeIdentifiers.add(recipe.getId()); - }); - - new UnlockRecipesS2CPacket(UnlockRecipesS2CPacket.Action.INIT, recipeIdentifiers, recipeIdentifiers, mc.player.getRecipeBook().getOptions()).apply(mc.getNetworkHandler()); - new UnlockRecipesS2CPacket(UnlockRecipesS2CPacket.Action.ADD, recipeIdentifiers, recipeIdentifiers, mc.player.getRecipeBook().getOptions()).apply(mc.getNetworkHandler()); - - return SINGLE_SUCCESS; - })); - - builder.then(literal("revoke").executes(ctx -> { - if (recipes == null) throw NO_RECIPES.create(); - - List recipeIdentifiers = new ArrayList<>(); - - recipes.forEach(recipe -> { - recipeIdentifiers.add(recipe.getId()); - }); - - new UnlockRecipesS2CPacket(UnlockRecipesS2CPacket.Action.REMOVE, recipeIdentifiers, recipeIdentifiers, mc.player.getRecipeBook().getOptions()).apply(mc.getNetworkHandler()); - - return SINGLE_SUCCESS; - })); - } -} diff --git a/src/main/java/cloudburst/rejects/mixin/RecipeManagerMixin.java b/src/main/java/cloudburst/rejects/mixin/RecipeManagerMixin.java deleted file mode 100644 index 2caa5b9..0000000 --- a/src/main/java/cloudburst/rejects/mixin/RecipeManagerMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package cloudburst.rejects.mixin; - -import net.minecraft.client.gui.screen.ingame.InventoryScreen; -import org.spongepowered.asm.mixin.Mixin; -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.recipebook.ClientRecipeBook; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeManager; - -import cloudburst.rejects.commands.RecipeCommand; -import minegame159.meteorclient.systems.commands.Commands; - -@Mixin(RecipeManager.class) -public class RecipeManagerMixin { - @Inject(method = "setRecipes", at = @At(value = "HEAD")) - public void setRecipes(Iterable> recipes, CallbackInfo ci) { - if (Commands.get().get(RecipeCommand.class).recipes == null) { - Commands.get().get(RecipeCommand.class).recipes = recipes; - } - } -} diff --git a/src/main/resources/meteor-rejects.mixins.json b/src/main/resources/meteor-rejects.mixins.json index b4a4e38..4cf2242 100644 --- a/src/main/resources/meteor-rejects.mixins.json +++ b/src/main/resources/meteor-rejects.mixins.json @@ -3,7 +3,6 @@ "package": "cloudburst.rejects.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ - "RecipeManagerMixin" ], "client": [ "ClientPlayerInteractionManagerMixin",