final int[] lightEmission = new int[Block.lightEmission.length];
System.arraycopy(Block.lightEmission, 0, lightEmission, 0, Block.lightEmission.length);
for (int i = 0; i < Block.byId.length; i++) {
if (Block.byId[i] != null) {
Block parent = Block.byId[i];
Block.byId[i] = null;
float strength = 0;
try {
final Field field = getField(parent.getClass(), "strength");
field.setAccessible(true);
strength = field.getFloat(parent);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
float durability = 0;
try {
final Field field = getField(parent.getClass(), "durability");
field.setAccessible(true);
durability = field.getFloat(parent);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
try {
Block fake = createProxy(parent);
if (fake != null) {
Block.byId[i] = fake;
} else {
Block.byId[i] = parent;
}
final Field strengthField = getField(fake.getClass(), "strength");
strengthField.setAccessible(true);
strengthField.setFloat(fake, strength);
final Field durabilityField = getField(fake.getClass(), "durability");
durabilityField.setAccessible(true);
durabilityField.setFloat(fake, durability);
} catch (Throwable t) {
System.err.println("Error replacing : " + parent.getClass().getName());