fixed loading of destroying builders blocks, fix #1623
This commit is contained in:
parent
5a8000707d
commit
69c8d75371
2 changed files with 17 additions and 6 deletions
|
@ -8,6 +8,8 @@
|
||||||
*/
|
*/
|
||||||
package buildcraft.api.blueprints;
|
package buildcraft.api.blueprints;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
public class SchematicFactoryBlock extends SchematicFactory <SchematicBlock> {
|
public class SchematicFactoryBlock extends SchematicFactory <SchematicBlock> {
|
||||||
|
@ -15,15 +17,24 @@ public class SchematicFactoryBlock extends SchematicFactory <SchematicBlock> {
|
||||||
@Override
|
@Override
|
||||||
protected SchematicBlock loadSchematicFromWorldNBT (NBTTagCompound nbt, MappingRegistry registry) {
|
protected SchematicBlock loadSchematicFromWorldNBT (NBTTagCompound nbt, MappingRegistry registry) {
|
||||||
int blockId = nbt.getInteger("blockId");
|
int blockId = nbt.getInteger("blockId");
|
||||||
SchematicBlock s = SchematicRegistry.newSchematicBlock(registry.getBlockForId(blockId));
|
Block b = registry.getBlockForId(blockId);
|
||||||
|
|
||||||
|
if (b == Blocks.air) {
|
||||||
|
SchematicBlock s = new SchematicBlock();
|
||||||
|
s.meta = 0;
|
||||||
|
s.block = Blocks.air;
|
||||||
|
|
||||||
|
return s;
|
||||||
|
} else {
|
||||||
|
SchematicBlock s = SchematicRegistry.newSchematicBlock(b);
|
||||||
|
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
s.readFromNBT(nbt, registry);
|
s.readFromNBT(nbt, registry);
|
||||||
} else {
|
return s;
|
||||||
return null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -228,7 +228,7 @@ public class BuildingItem implements IBuilder {
|
||||||
destination.writeToNBT(destinationNBT);
|
destination.writeToNBT(destinationNBT);
|
||||||
nbt.setTag ("destination", destinationNBT);
|
nbt.setTag ("destination", destinationNBT);
|
||||||
|
|
||||||
nbt.setDouble("lifeTime", lifetime);
|
nbt.setDouble("lifetime", lifetime);
|
||||||
|
|
||||||
NBTTagList items = new NBTTagList();
|
NBTTagList items = new NBTTagList();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue