Skip to content

Instantly share code, notes, and snippets.

@Asherslab
Created June 30, 2018 04:03
Show Gist options
  • Save Asherslab/846acb3aaa8981ec52ae9c158146addf to your computer and use it in GitHub Desktop.
Save Asherslab/846acb3aaa8981ec52ae9c158146addf to your computer and use it in GitHub Desktop.
[14:01:44] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Preparing start region for level 0
[14:01:44] [Server thread/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:42]: Compound: {x:-1274,y:64,z:-280,id:"minecraft:minecolonies.shingle",type:1}
[14:01:44] [Server thread/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:43]: Thing: type:1
[14:01:44] [Server thread/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:44]: Thing2: spruce
[14:01:45] [Server thread/INFO] [FML]: Unloading dimension -1
[14:01:45] [Server thread/INFO] [FML]: Unloading dimension 1
[14:01:47] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving chunks for level 'Test World'/overworld
[14:01:47] [Server thread/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:writeToNBT:31]: Thing: type:1
[14:01:47] [Server thread/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:writeToNBT:33]: Compound: {x:-1274,y:64,z:-280,id:"minecraft:minecolonies.shingle",type:1}
[14:01:47] [main/INFO] [net.minecraft.advancements.AdvancementList]: Loaded 3 advancements
[14:01:47] [main/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:42]: Compound: {x:-1274,y:64,z:-280,id:"minecraft:minecolonies.shingle"}
[14:01:47] [main/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:43]: Thing: type:0
[14:01:47] [main/INFO] [STDOUT]: [com.minecolonies.coremod.tileentities.TileEntityShingle:readFromNBT:44]: Thing2: oak
package com.minecolonies.coremod.tileentities;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.block.BlockPlanks.EnumType;
import static com.minecolonies.api.util.constant.NbtTagConstants.*;
public class TileEntityShingle extends TileEntity
{
private EnumType woodType;
public EnumType getWoodType()
{
return woodType;
}
public void setWoodType(final EnumType woodType)
{
this.woodType = woodType;
}
public TileEntityShingle()
{
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound compound)
{
super.writeToNBT(compound);
System.out.println("Thing: " + TAG_WOOD_TYPE + ":" + woodType.getMetadata());
compound.setInteger(TAG_WOOD_TYPE, woodType.getMetadata());
System.out.println("Compound: " + compound);
return compound;
}
@Override
public void readFromNBT(final NBTTagCompound compound)
{
super.readFromNBT(compound);
this.woodType = EnumType.byMetadata(compound.getInteger(TAG_WOOD_TYPE));
System.out.println("Compound: " + compound);
System.out.println("Thing: " + TAG_WOOD_TYPE + ":" + compound.getInteger(TAG_WOOD_TYPE));
System.out.println("Thing2: " + this.woodType);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment