From 9a15a65ad52f819baf98b2de176d5673f852cf41 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 19 Mar 2019 13:59:56 -0700 Subject: [PATCH] not needed anymore --- .../baritone/gradle/util/MappingType.java | 29 --------- .../baritone/gradle/util/ReobfWrapper.java | 63 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 buildSrc/src/main/java/baritone/gradle/util/MappingType.java delete mode 100644 buildSrc/src/main/java/baritone/gradle/util/ReobfWrapper.java diff --git a/buildSrc/src/main/java/baritone/gradle/util/MappingType.java b/buildSrc/src/main/java/baritone/gradle/util/MappingType.java deleted file mode 100644 index a3be9b49..00000000 --- a/buildSrc/src/main/java/baritone/gradle/util/MappingType.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of Baritone. - * - * Baritone is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Baritone is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Baritone. If not, see . - */ - -package baritone.gradle.util; - -/** - * All credits go to AsmLibGradle and its contributors. - * - * @see Original Source - */ -public enum MappingType { - SEARGE, - NOTCH, - CUSTOM // forgegradle -} diff --git a/buildSrc/src/main/java/baritone/gradle/util/ReobfWrapper.java b/buildSrc/src/main/java/baritone/gradle/util/ReobfWrapper.java deleted file mode 100644 index f752cd94..00000000 --- a/buildSrc/src/main/java/baritone/gradle/util/ReobfWrapper.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of Baritone. - * - * Baritone is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Baritone is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Baritone. If not, see . - */ - -package baritone.gradle.util; - -import java.lang.reflect.Field; -import java.util.Objects; - -/** - * All credits go to AsmLibGradle and its contributors. - * - * @see Original Source - */ -public class ReobfWrapper { - - private final Object instance; - private final Class type; - - public ReobfWrapper(Object instance) { - this.instance = instance; - Objects.requireNonNull(instance); - this.type = instance.getClass(); - } - - public String getName() { - try { - Field nameField = type.getDeclaredField("name"); - nameField.setAccessible(true); - return (String) nameField.get(this.instance); - } catch (ReflectiveOperationException ex) { - throw new IllegalStateException(ex); - } - } - - public MappingType getMappingType() { - try { - Field enumField = type.getDeclaredField("mappingType"); - enumField.setAccessible(true); - Enum aEnum = (Enum) enumField.get(this.instance); - MappingType mappingType = MappingType.values()[aEnum.ordinal()]; - if (!aEnum.name().equals(mappingType.name())) { - throw new IllegalStateException("ForgeGradle ReobfMappingType is not equivalent to MappingType (version error?)"); - } - return mappingType; - } catch (ReflectiveOperationException ex) { - throw new IllegalStateException(ex); - } - } -}