Hopefully fixed an issue with servers

This commit is contained in:
Adubbz 2013-10-19 08:16:15 +11:00
parent f8f1b53715
commit edeff11cbc

View file

@ -1,5 +1,7 @@
package biomesoplenty.asm.smoothing; package biomesoplenty.asm.smoothing;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -16,48 +18,73 @@ public class BOPBiomeTransitionSmoothing implements IClassTransformer
@Override @Override
public byte[] transform(String name, String newname, byte[] bytes) public byte[] transform(String name, String newname, byte[] bytes)
{ {
try
{
Class minecraft = Class.forName("net.minecraft.client.Minecraft");
if (name.equals("net.minecraft.block.BlockFluid")) if (name.equals("net.minecraft.block.BlockFluid"))
{ {
return BlockFluid.patchColourMultiplier(newname, bytes, false); return BlockFluid.patchColourMultiplier(newname, bytes, false);
} }
if (name.equals("apc"))
{
return BlockFluid.patchColourMultiplier(newname, bytes, true);
}
if (name.equals("net.minecraft.block.BlockGrass")) if (name.equals("net.minecraft.block.BlockGrass"))
{ {
return BlockGrass.patchColourMultiplier(newname, bytes, false); return BlockGrass.patchColourMultiplier(newname, bytes, false);
} }
if (name.equals("aon"))
{
return BlockGrass.patchColourMultiplier(newname, bytes, true);
}
if (name.equals("net.minecraft.block.BlockLeaves")) if (name.equals("net.minecraft.block.BlockLeaves"))
{ {
return BlockLeaves.patchColourMultiplier(newname, bytes, false); return BlockLeaves.patchColourMultiplier(newname, bytes, false);
} }
if (name.equals("aoz"))
{
return BlockLeaves.patchColourMultiplier(newname, bytes, true);
}
if (name.equals("net.minecraft.block.BlockTallGrass")) if (name.equals("net.minecraft.block.BlockTallGrass"))
{ {
return BlockTallGrass.patchColourMultiplier(newname, bytes, false); return BlockTallGrass.patchColourMultiplier(newname, bytes, false);
} }
}
catch (ClassNotFoundException e)
{
}
try
{
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")) if (name.equals("aqv"))
{ {
return BlockTallGrass.patchColourMultiplier(newname, bytes, true); return BlockTallGrass.patchColourMultiplier(newname, bytes, true);
} }
}
catch (ClassNotFoundException e)
{
}
return bytes; return bytes;
} }
public static int getGrassColourMultiplier(IBlockAccess world, int ox, int oy, int oz) 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 r = 0;
int g = 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) 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 r = 0;
int g = 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) 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 r = 0;
int g = 0; int g = 0;