Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -12,22 +12,19 @@ import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Base tile class.
*
* <p>
* Handles data syncing and core data writing/reading.
*/
public class TileBase extends TileEntity
{
public class TileBase extends TileEntity {
@Override
public final void readFromNBT(NBTTagCompound compound)
{
public final void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
deserializeBase(compound);
deserialize(compound);
}
@Override
public final NBTTagCompound writeToNBT(NBTTagCompound compound)
{
public final NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
serializeBase(compound);
return serialize(compound);
@ -35,38 +32,34 @@ public class TileBase extends TileEntity
/**
* Called by {@link #readFromNBT(NBTTagCompound)}
*
* <p>
* Internal data (such as coordinates) are handled for you. Just read the data you need.
*
* @param tagCompound - The tag compound to read from
*/
public void deserialize(NBTTagCompound tagCompound)
{
public void deserialize(NBTTagCompound tagCompound) {
}
/**
* Package private method for reading base data from the tag compound.
*
* @see TileTicking
*
* @param tagCompound - The tag compound to read from
* @see TileTicking
*/
void deserializeBase(NBTTagCompound tagCompound)
{
void deserializeBase(NBTTagCompound tagCompound) {
}
/**
* Called by {@link #writeToNBT(NBTTagCompound)}
*
* <p>
* Internal data (such as coordinates) are handled for you. Just read the data you need.
*
* @param tagCompound - The tag compound to write to.
* @return the modified tag compound
*/
public NBTTagCompound serialize(NBTTagCompound tagCompound)
{
public NBTTagCompound serialize(NBTTagCompound tagCompound) {
return tagCompound;
}
@ -74,13 +67,11 @@ public class TileBase extends TileEntity
/**
* Package private method for writing base data to the tag compound.
*
* @see TileTicking
*
* @param tagCompound - The tag compound to write to.
* @return the modified tag compound
* @see TileTicking
*/
NBTTagCompound serializeBase(NBTTagCompound tagCompound)
{
NBTTagCompound serializeBase(NBTTagCompound tagCompound) {
return tagCompound;
}
@ -91,34 +82,29 @@ public class TileBase extends TileEntity
// Data syncing
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState)
{
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
return oldState.getBlock() != newState.getBlock();
}
@Override
public final SPacketUpdateTileEntity getUpdatePacket()
{
public final SPacketUpdateTileEntity getUpdatePacket() {
return new SPacketUpdateTileEntity(getPos(), -999, writeToNBT(new NBTTagCompound()));
}
@Override
@SideOnly(Side.CLIENT)
public final void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
public final void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
super.onDataPacket(net, pkt);
readFromNBT(pkt.getNbtCompound());
}
@Override
public final NBTTagCompound getUpdateTag()
{
public final NBTTagCompound getUpdateTag() {
return writeToNBT(new NBTTagCompound());
}
@Override
public final void handleUpdateTag(NBTTagCompound tag)
{
public final void handleUpdateTag(NBTTagCompound tag) {
readFromNBT(tag);
}
}