<commit_before>package de.comeight.crystallogy.tileEntitys;

import de.comeight.crystallogy.network.NetworkPacketTileEntityRequestSync;
import de.comeight.crystallogy.network.NetworkPacketTileEntitySync;
import de.comeight.crystallogy.util.NetworkUtilitis;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class BaseTileEntity extends TileEntity {
	//-----------------------------------------------Variabeln:---------------------------------------------

	
	//-----------------------------------------------Constructor:-------------------------------------------

	
	//-----------------------------------------------Set-, Get-Methoden:------------------------------------

	
	//-----------------------------------------------Sonstige Methoden:-------------------------------------
	public abstract void onCustomDataPacket(NetworkPacketTileEntitySync packet);
	
	public abstract NetworkPacketTileEntitySync getCustomDataPacket(NBTTagCompound compound);
	
	public void sync(){
		if(worldObj != null){
			NetworkPacketTileEntitySync packet = getCustomDataPacket(new NBTTagCompound());
			NetworkUtilitis.sendAllAround(packet, worldObj.isRemote);
		}
		markDirty();
	}
	
	@Override
	public SPacketUpdateTileEntity getUpdatePacket() {
		NBTTagCompound nbt = new NBTTagCompound();
        writeToNBT(nbt);
		return new SPacketUpdateTileEntity(pos, 0, nbt);
	}
	
	@Override
	public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
		super.onDataPacket(net, pkt);
		readFromNBT(pkt.getNbtCompound());
	}

	@SideOnly(Side.CLIENT)
	public void requestSync(){
		NetworkPacketTileEntityRequestSync packet = new NetworkPacketTileEntityRequestSync(pos);
		NetworkUtilitis.sendToServer(packet);
	}
	
}<commit_msg>Fixed a bunch of not syncing erros<commit_after>package de.comeight.crystallogy.tileEntitys;

import de.comeight.crystallogy.network.NetworkPacketTileEntityRequestSync;
import de.comeight.crystallogy.network.NetworkPacketTileEntitySync;
import de.comeight.crystallogy.util.NetworkUtilitis;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class BaseTileEntity extends TileEntity {
	//-----------------------------------------------Variabeln:---------------------------------------------

	
	//-----------------------------------------------Constructor:-------------------------------------------

	
	//-----------------------------------------------Set-, Get-Methoden:------------------------------------

	
	//-----------------------------------------------Sonstige Methoden:-------------------------------------
	public abstract void onCustomDataPacket(NetworkPacketTileEntitySync packet);
	
	public abstract NetworkPacketTileEntitySync getCustomDataPacket(NBTTagCompound compound);
	
	public void sync(){
		if(worldObj != null){
			NetworkPacketTileEntitySync packet = getCustomDataPacket(new NBTTagCompound());
			NetworkUtilitis.sendAllAround(packet, worldObj.isRemote);
		}
		markDirty();
	}
	
	@Override
	public SPacketUpdateTileEntity getUpdatePacket() {
		NBTTagCompound nbt = new NBTTagCompound();
        writeToNBT(nbt);
		return new SPacketUpdateTileEntity(pos, 0, nbt);
	}
	
	@Override
	public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
		super.onDataPacket(net, pkt);
		readFromNBT(pkt.getNbtCompound());
	}

	@SideOnly(Side.CLIENT)
	public void requestSync(){
		NetworkPacketTileEntityRequestSync packet = new NetworkPacketTileEntityRequestSync(pos);
		NetworkUtilitis.sendToServer(packet);
		System.out.println("request Sync");
	}
	
	@Override
	public void onLoad() {
		if(worldObj.isRemote){
			requestSync();
		}
	}
	
}
{'fraction_non_alphanumeric': 0.24695567462250365, 'fraction_numerical': 0.0004870920603994155, 'mean_word_length': 2.4834605597964376, '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': '5110298', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1056, 'n_words': 188}