mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 09:54:25 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -15,10 +15,10 @@ public class TileVariant extends TileEntity {
|
||||
public static int variantVersion = 1;
|
||||
|
||||
int version = variantVersion;
|
||||
public int variant = 14;
|
||||
public int rotation;
|
||||
public int variant = 14;
|
||||
public int rotation;
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
version = compound.getInteger("CNPCVersion");
|
||||
FixTileData(version, compound, this);
|
||||
@@ -26,65 +26,65 @@ public class TileVariant extends TileEntity {
|
||||
rotation = compound.getInteger("CNPCRotation");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeToNBT(NBTTagCompound compound) {
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("CNPCVersion", version);
|
||||
compound.setInteger("CNPCVariant", variant);
|
||||
compound.setInteger("CNPCRotation", rotation);
|
||||
compound.setInteger("CNPCVariant", variant);
|
||||
compound.setInteger("CNPCRotation", rotation);
|
||||
}
|
||||
|
||||
public boolean canUpdate(){
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
|
||||
NBTTagCompound compound = pkt.func_148857_g();
|
||||
readFromNBT(compound);
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound compound = pkt.func_148857_g();
|
||||
readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
writeToNBT(compound);
|
||||
compound.removeTag("Items");
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, compound);
|
||||
return packet;
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
writeToNBT(compound);
|
||||
compound.removeTag("Items");
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, compound);
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox(){
|
||||
return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
|
||||
}
|
||||
|
||||
public int powerProvided(){
|
||||
return 0;
|
||||
}
|
||||
public int powerProvided() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public static void FixTileData(int version, NBTTagCompound compound, TileEntity tileEntity){
|
||||
if(version == variantVersion)
|
||||
public static void FixTileData(int version, NBTTagCompound compound, TileEntity tileEntity) {
|
||||
if (version == variantVersion)
|
||||
return;
|
||||
boolean fixMade = false;
|
||||
if(version < 1){
|
||||
if(compound.hasKey("BannerColor")){
|
||||
if (version < 1) {
|
||||
if (compound.hasKey("BannerColor")) {
|
||||
int bannerColor = compound.getInteger("BannerColor");
|
||||
if(isColorTile(tileEntity)){
|
||||
if (isColorTile(tileEntity)) {
|
||||
compound.setInteger(BRUSH_COLOR_TAG, ColorUtil.colorTableInts[bannerColor]);
|
||||
}
|
||||
compound.setInteger("CNPCVariant", bannerColor);
|
||||
fixMade = true;
|
||||
}
|
||||
if(compound.hasKey("BannerRotation")){
|
||||
if (compound.hasKey("BannerRotation")) {
|
||||
compound.setInteger("CNPCRotation", compound.getInteger("BannerRotation"));
|
||||
fixMade = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(fixMade)
|
||||
if (fixMade)
|
||||
tileEntity.markDirty();
|
||||
}
|
||||
|
||||
public static boolean isColorTile(TileEntity tileEntity){
|
||||
public static boolean isColorTile(TileEntity tileEntity) {
|
||||
return tileEntity instanceof TileColorable;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user