diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-10-22 22:40:44 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-10-22 22:40:44 +0800 |
| commit | becefcce17a7130bb5642fc4cbf3ad4f7cbdcadf (patch) | |
| tree | 80a06203b1f1905e2054b971fb063560d964dbe5 | |
| parent | 83b7f0488de9cc91951f4d9b2017f6ca1c0fa17e (diff) | |
| download | RoughlyEnoughItems-becefcce17a7130bb5642fc4cbf3ad4f7cbdcadf.tar.gz RoughlyEnoughItems-becefcce17a7130bb5642fc4cbf3ad4f7cbdcadf.tar.bz2 RoughlyEnoughItems-becefcce17a7130bb5642fc4cbf3ad4f7cbdcadf.zip | |
Remove useless class
| -rw-r--r-- | api/src/main/java/me/shedaniel/rei/impl/VersionAdapter.java | 2 | ||||
| -rw-r--r-- | forge/src/main/java/me/shedaniel/rei/impl/client/forge/CommandSenderImpl.java | 60 |
2 files changed, 2 insertions, 60 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/impl/VersionAdapter.java b/api/src/main/java/me/shedaniel/rei/impl/VersionAdapter.java index 12a91f0df..159dfeddf 100644 --- a/api/src/main/java/me/shedaniel/rei/impl/VersionAdapter.java +++ b/api/src/main/java/me/shedaniel/rei/impl/VersionAdapter.java @@ -33,11 +33,13 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.ApiStatus; import java.util.Comparator; import java.util.List; import java.util.Optional; +@ApiStatus.Internal public interface VersionAdapter { VersionAdapter INSTANCE = load(); diff --git a/forge/src/main/java/me/shedaniel/rei/impl/client/forge/CommandSenderImpl.java b/forge/src/main/java/me/shedaniel/rei/impl/client/forge/CommandSenderImpl.java deleted file mode 100644 index 83253fc9c..000000000 --- a/forge/src/main/java/me/shedaniel/rei/impl/client/forge/CommandSenderImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020, 2021, 2022 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei.impl.client.forge; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.player.LocalPlayer; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -public class CommandSenderImpl { - public static void sendCommand(String command) { - LocalPlayer player = Minecraft.getInstance().player; - if (player == null) return; - Method method = null; - try { - // 1.19 - method = ObfuscationReflectionHelper.findMethod(LocalPlayer.class, "m_234156_", String.class); - } catch (ObfuscationReflectionHelper.UnableToFindMethodException ignored) { - } - if (method == null) { - try { - // 1.19.1 - method = ObfuscationReflectionHelper.findMethod(LocalPlayer.class, "m_242614_", String.class); - } catch (ObfuscationReflectionHelper.UnableToFindMethodException ignored) { - } - } - if (method == null) { - throw new RuntimeException("Unable to find method"); - } - - try { - method.invoke(player, command); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); - } - } -} |
