Skip to content

Commit 8a37187

Browse files
davenonymousthraaawn
authored andcommitted
Save schema name in item tags
1 parent 9696598 commit 8a37187

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/java/org/dave/compactmachines3/block/BlockMachine.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,17 @@ public static void spawnItemWithNBT(World world, BlockPos pos, EnumMachineSize s
234234
if(te.hasOwner()) {
235235
compound.setUniqueId("owner", te.getOwner());
236236
}
237+
if(te.hasNewSchema()) {
238+
compound.setString("schema", te.getSchemaName());
239+
}
237240
stack.setTagCompound(compound);
238241

239242
if(te.getCustomName().length() > 0) {
240243
stack.setStackDisplayName(te.getCustomName());
241244
}
242245

246+
247+
243248
EntityItem entityItem = new EntityItem(world, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f, stack);
244249
entityItem.lifespan = 1200;
245250
entityItem.setPickupDelay(10);
@@ -280,6 +285,10 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, Entity
280285
}
281286
}
282287

288+
if(stack.getTagCompound().hasKey("schema")) {
289+
tileEntityMachine.setSchema(stack.getTagCompound().getString("schema"));
290+
}
291+
283292
if(stack.hasDisplayName()) {
284293
tileEntityMachine.setCustomName(stack.getDisplayName());
285294
}

src/main/java/org/dave/compactmachines3/block/BlockWall.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import net.minecraftforge.fml.relauncher.Side;
2020
import net.minecraftforge.fml.relauncher.SideOnly;
2121
import org.dave.compactmachines3.init.Blockss;
22-
import org.dave.compactmachines3.item.ItemPersonalShrinkingDevice;
2322
import org.dave.compactmachines3.item.ItemRedstoneTunnelTool;
2423
import org.dave.compactmachines3.item.ItemTunnelTool;
2524
import org.dave.compactmachines3.misc.ConfigurationHandler;

0 commit comments

Comments
 (0)