Code cleanup

This commit is contained in:
LemADEC 2016-01-02 01:18:31 +01:00
parent 4b61a486ae
commit b297fb8b17
3 changed files with 25 additions and 23 deletions

View file

@ -3,7 +3,7 @@ package cr0s.warpdrive.client;
import cr0s.warpdrive.CommonProxy;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
}
@Override
public void registerRenderers() {
}
}

View file

@ -379,32 +379,28 @@ public class Dictionary {
// open access to Block.blockHardness
Field fieldHardness = null;
Class<?> classBlock = null;
try {
classBlock = Class.forName("net.minecraft.block.Block");
} catch (Exception exception) {
exception.printStackTrace();
}
Class<?> classBlock = Block.class;
if (classBlock != null) {
try {
fieldHardness = classBlock.getDeclaredField("blockHardness");
} catch (Exception exception1) {
try {
fieldHardness = classBlock.getDeclaredField("blockHardness");
} catch (Exception exception1) {
try {
fieldHardness = classBlock.getDeclaredField("field_149782_v");
} catch (Exception exception2) {
exception2.printStackTrace();
String map = "";
for(Field field : classBlock.getDeclaredFields()) {
if (!map.isEmpty()) {
map += ", ";
}
map += field.getName();
fieldHardness = classBlock.getDeclaredField("field_149782_v");
} catch (Exception exception2) {
exception2.printStackTrace();
String map = "";
for(Field field : classBlock.getDeclaredFields()) {
if (!map.isEmpty()) {
map += ", ";
}
WarpDrive.logger.error("Unable to find blockHardness field in " + Blocks.air.getClass() + " class. Available fields are: " + map);
map += field.getName();
}
WarpDrive.logger.error("Unable to find blockHardness field in " + classBlock + " class. Available fields are: " + map);
}
}
if (fieldHardness != null) {
fieldHardness.setAccessible(true);
}
// adjust IC2 Reinforced stone stats
if (WarpDriveConfig.isIndustrialCraft2loaded) {

View file

@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.Packet;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
@ -129,4 +130,9 @@ public class PacketHandler {
}
return null;
}
@Deprecated
public static void sendTileEntityUpdate(TileEntity tileEntity) {
tileEntity.getWorldObj().markBlockForUpdate(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
}
}