mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Fix ring of far reach and fix proxy selection
This commit is contained in:
3 files changed
+10
-6
No files matched your search
@@ -70,9 +70,11 @@ public class Botania {
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
try {
|
||||
if ("1.10".equals(Loader.MC_VERSION)) {
|
||||
if ("Minecraft 1.10".equals(Loader.instance().getMCVersionString())) {
|
||||
Botania.LOGGER.info("Enabling proxy for Minecraft 1.10");
|
||||
crossVersionProxy = (ICrossVersionProxy) Class.forName("vazkii.botania.common.core.proxy.CrossVersionProxy_110").newInstance();
|
||||
} else if ("1.9.4".equals(Loader.MC_VERSION)) {
|
||||
} else if ("Minecraft 1.9.4".equals(Loader.instance().getMCVersionString())) {
|
||||
Botania.LOGGER.info("Enabling proxy for Minecraft 1.9.4");
|
||||
crossVersionProxy = (ICrossVersionProxy) Class.forName("vazkii.botania.common.core.proxy.CrossVersionProxy_19").newInstance();
|
||||
} else {
|
||||
throw new IllegalStateException("Botania couldn't find a cross version proxy!");
|
||||
|
||||
@@ -29,8 +29,9 @@ public class CrossVersionProxy_110 implements ICrossVersionProxy {
|
||||
public void copyGameType(PlayerControllerMP from, BotaniaPlayerController to) {
|
||||
try {
|
||||
Class<?> gameTypeClazz = Class.forName("net.minecraft.world.GameType");
|
||||
Object gameType = from.getCurrentGameType();
|
||||
Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz);
|
||||
Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "getCurrentGameType", "func_178889_l", "l" });
|
||||
Object gameType = m.invoke(from);
|
||||
m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz);
|
||||
m.invoke(to, gameType);
|
||||
} catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,9 @@ public class CrossVersionProxy_19 implements ICrossVersionProxy {
|
||||
public void copyGameType(PlayerControllerMP from, BotaniaPlayerController to) {
|
||||
try {
|
||||
Class<?> gameTypeClazz = Class.forName("net.minecraft.world.WorldSettings.GameType");
|
||||
Object gameType = from.getCurrentGameType();
|
||||
Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz);
|
||||
Method m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "getCurrentGameType", "func_178889_l", "l" });
|
||||
Object gameType = m.invoke(from);
|
||||
m = ReflectionHelper.findMethod(PlayerControllerMP.class, null, new String[]{ "setGameType", "func_78746_a", "a" }, gameTypeClazz);
|
||||
m.invoke(to, gameType);
|
||||
} catch (IllegalAccessException | InvocationTargetException | ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user