Skip to content

Commit

Permalink
fixed loading of destroying builders blocks, fix #1623
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceToad committed Apr 26, 2014
1 parent 5a80007 commit 69c8d75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions common/buildcraft/api/blueprints/SchematicFactoryBlock.java
Expand Up @@ -8,22 +8,33 @@
*/
package buildcraft.api.blueprints;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;

public class SchematicFactoryBlock extends SchematicFactory <SchematicBlock> {

@Override
protected SchematicBlock loadSchematicFromWorldNBT (NBTTagCompound nbt, MappingRegistry registry) {
int blockId = nbt.getInteger("blockId");
SchematicBlock s = SchematicRegistry.newSchematicBlock(registry.getBlockForId(blockId));
Block b = registry.getBlockForId(blockId);

if (s != null) {
s.readFromNBT(nbt, registry);
if (b == Blocks.air) {
SchematicBlock s = new SchematicBlock();
s.meta = 0;
s.block = Blocks.air;

return s;
} else {
return null;
SchematicBlock s = SchematicRegistry.newSchematicBlock(b);

if (s != null) {
s.readFromNBT(nbt, registry);
return s;
}
}

return s;
return null;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion common/buildcraft/builders/BuildingItem.java
Expand Up @@ -228,7 +228,7 @@ public void writeToNBT (NBTTagCompound nbt) {
destination.writeToNBT(destinationNBT);
nbt.setTag ("destination", destinationNBT);

nbt.setDouble("lifeTime", lifetime);
nbt.setDouble("lifetime", lifetime);

NBTTagList items = new NBTTagList();

Expand Down

0 comments on commit 69c8d75

Please sign in to comment.