<commit_before>package com.creativemd.creativecore.common.tileentity;

import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class TileEntityCreative extends TileEntity{
	
	public void getDescriptionNBT(NBTTagCompound nbt)
	{
		
	}
	
	@SideOnly(Side.CLIENT)
	public void receiveUpdatePacket(NBTTagCompound nbt)
	{
		
	}
	
	@Override
	public NBTTagCompound getUpdateTag()
    {
        return writeToNBT(new NBTTagCompound());
    }
	
	@Override
	public void handleUpdateTag(NBTTagCompound tag)
    {
        this.readFromNBT(tag);
    }
	
	@Override
	public SPacketUpdateTileEntity getUpdatePacket()
    {
		NBTTagCompound nbt = new NBTTagCompound();
		getDescriptionNBT(nbt);
        return new SPacketUpdateTileEntity(pos, getBlockMetadata(), nbt);
    }
	
	public double getDistance(BlockPos coord)
	{
		return Math.sqrt(pos.distanceSq(coord));
	}
	
	@SideOnly(Side.CLIENT)
	public void updateRender()
	{
		worldObj.markBlockRangeForRenderUpdate(pos, pos);
	}
	
	public void updateBlock()
	{
		if(!worldObj.isRemote)
		{
			IBlockState state = worldObj.getBlockState(pos);
			worldObj.notifyBlockUpdate(pos, state, state, 3);
			//worldObj.markBlockForUpdate(pos);
			//markDirty();
		}
	}<commit_msg>Fixed potential issue of not saving tileentity<commit_after>package com.creativemd.creativecore.common.tileentity;

import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class TileEntityCreative extends TileEntity{
	
	public void getDescriptionNBT(NBTTagCompound nbt)
	{
		
	}
	
	@SideOnly(Side.CLIENT)
	public void receiveUpdatePacket(NBTTagCompound nbt)
	{
		
	}
	
	@Override
	public NBTTagCompound getUpdateTag()
    {
        return writeToNBT(new NBTTagCompound());
    }
	
	@Override
	public void handleUpdateTag(NBTTagCompound tag)
    {
        this.readFromNBT(tag);
    }
	
	@Override
	public SPacketUpdateTileEntity getUpdatePacket()
    {
		NBTTagCompound nbt = new NBTTagCompound();
		getDescriptionNBT(nbt);
        return new SPacketUpdateTileEntity(pos, getBlockMetadata(), nbt);
    }
	
	public double getDistance(BlockPos coord)
	{
		return Math.sqrt(pos.distanceSq(coord));
	}
	
	@SideOnly(Side.CLIENT)
	public void updateRender()
	{
		worldObj.markBlockRangeForRenderUpdate(pos, pos);
	}
	
	public void updateBlock()
	{
		if(!worldObj.isRemote)
		{
			IBlockState state = worldObj.getBlockState(pos);
			worldObj.notifyBlockUpdate(pos, state, state, 3);
			worldObj.markChunkDirty(getPos(), this);
			//worldObj.markBlockForUpdate(pos);
			//markDirty();
		}
	}
{'fraction_non_alphanumeric': 0.09947643979057591, 'fraction_numerical': 0.0006159531875577456, 'mean_word_length': 4.708260105448154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3113687', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1077, 'n_words': 182}