From edeff11cbc01921c90e9c4f3b7c6e19acdb8075d Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 19 Oct 2013 08:16:15 +1100 Subject: [PATCH] Hopefully fixed an issue with servers --- .../BOPBiomeTransitionSmoothing.java | 93 ++++++++++++------- 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/common/biomesoplenty/asm/smoothing/BOPBiomeTransitionSmoothing.java b/common/biomesoplenty/asm/smoothing/BOPBiomeTransitionSmoothing.java index b31fd112c..69917c1bc 100644 --- a/common/biomesoplenty/asm/smoothing/BOPBiomeTransitionSmoothing.java +++ b/common/biomesoplenty/asm/smoothing/BOPBiomeTransitionSmoothing.java @@ -1,5 +1,7 @@ package biomesoplenty.asm.smoothing; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; import net.minecraft.client.Minecraft; import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.world.IBlockAccess; @@ -16,48 +18,73 @@ public class BOPBiomeTransitionSmoothing implements IClassTransformer @Override public byte[] transform(String name, String newname, byte[] bytes) { - if (name.equals("net.minecraft.block.BlockFluid")) + try { - return BlockFluid.patchColourMultiplier(newname, bytes, false); + Class minecraft = Class.forName("net.minecraft.client.Minecraft"); + + if (name.equals("net.minecraft.block.BlockFluid")) + { + return BlockFluid.patchColourMultiplier(newname, bytes, false); + } + + if (name.equals("net.minecraft.block.BlockGrass")) + { + return BlockGrass.patchColourMultiplier(newname, bytes, false); + } + + if (name.equals("net.minecraft.block.BlockLeaves")) + { + return BlockLeaves.patchColourMultiplier(newname, bytes, false); + } + + if (name.equals("net.minecraft.block.BlockTallGrass")) + { + return BlockTallGrass.patchColourMultiplier(newname, bytes, false); + } } - if (name.equals("apc")) - { - return BlockFluid.patchColourMultiplier(newname, bytes, true); + catch (ClassNotFoundException e) + { + } - if (name.equals("net.minecraft.block.BlockGrass")) + try { - return BlockGrass.patchColourMultiplier(newname, bytes, false); + Class minecraft = Class.forName("atv"); + + if (name.equals("apc")) + { + return BlockFluid.patchColourMultiplier(newname, bytes, true); + } + + + if (name.equals("aon")) + { + return BlockGrass.patchColourMultiplier(newname, bytes, true); + } + + + if (name.equals("aoz")) + { + return BlockLeaves.patchColourMultiplier(newname, bytes, true); + } + + + if (name.equals("aqv")) + { + return BlockTallGrass.patchColourMultiplier(newname, bytes, true); + } } - if (name.equals("aon")) + catch (ClassNotFoundException e) { - return BlockGrass.patchColourMultiplier(newname, bytes, true); - } - - if (name.equals("net.minecraft.block.BlockLeaves")) - { - return BlockLeaves.patchColourMultiplier(newname, bytes, false); - } - if (name.equals("aoz")) - { - return BlockLeaves.patchColourMultiplier(newname, bytes, true); - } - - if (name.equals("net.minecraft.block.BlockTallGrass")) - { - return BlockTallGrass.patchColourMultiplier(newname, bytes, false); - } - if (name.equals("aqv")) - { - return BlockTallGrass.patchColourMultiplier(newname, bytes, true); - } - + + } + return bytes; } - + public static int getGrassColourMultiplier(IBlockAccess world, int ox, int oy, int oz) { - int distance = Minecraft.getMinecraft().gameSettings.fancyGraphics ? BOPConfigurationMisc.grassColourSmoothingArea : 1; + int distance = FMLClientHandler.instance().getClient().gameSettings.fancyGraphics ? BOPConfigurationMisc.grassColourSmoothingArea : 1; int r = 0; int g = 0; @@ -83,7 +110,7 @@ public class BOPBiomeTransitionSmoothing implements IClassTransformer public static int getLeavesColourMultiplier(IBlockAccess world, int ox, int oy, int oz) { - int distance = Minecraft.getMinecraft().gameSettings.fancyGraphics ? BOPConfigurationMisc.leavesColourSmoothingArea : 1; + int distance = FMLClientHandler.instance().getClient().gameSettings.fancyGraphics ? BOPConfigurationMisc.leavesColourSmoothingArea : 1; int r = 0; int g = 0; @@ -109,7 +136,7 @@ public class BOPBiomeTransitionSmoothing implements IClassTransformer public static int getWaterColourMultiplier(IBlockAccess world, int ox, int oy, int oz) { - int distance = Minecraft.getMinecraft().gameSettings.fancyGraphics ? BOPConfigurationMisc.waterColourSmoothingArea : 1; + int distance = FMLClientHandler.instance().getClient().gameSettings.fancyGraphics ? BOPConfigurationMisc.waterColourSmoothingArea : 1; int r = 0; int g = 0;