mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 16:29:39 +00:00
Brush Color Tag
This commit is contained in:
1 parent
4703faa515
commit
c94f928f5e
2 files changed
+7
-3
No files matched your search
@@ -8,18 +8,20 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.items.ItemNpcTool;
|
||||
|
||||
import static noppes.npcs.items.ItemNpcTool.BRUSH_COLOR_TAG;
|
||||
|
||||
public class TileColorable extends TileVariant {
|
||||
|
||||
public int color = 0xFFFFFF;
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
color = compound.getInteger("BrushColor");
|
||||
color = compound.getInteger(BRUSH_COLOR_TAG);
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("BrushColor", color);
|
||||
compound.setInteger(BRUSH_COLOR_TAG, color);
|
||||
}
|
||||
|
||||
public void setColor(int color){
|
||||
|
||||
@@ -8,6 +8,8 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import static noppes.npcs.items.ItemNpcTool.BRUSH_COLOR_TAG;
|
||||
|
||||
public class TileVariant extends TileEntity {
|
||||
|
||||
public static int variantVersion = 1;
|
||||
@@ -67,7 +69,7 @@ public class TileVariant extends TileEntity {
|
||||
if(compound.hasKey("BannerColor")){
|
||||
int bannerColor = compound.getInteger("BannerColor");
|
||||
if(isColorTile(tileEntity)){
|
||||
compound.setInteger("BrushColor", ColorUtil.colorTableInts[bannerColor]);
|
||||
compound.setInteger(BRUSH_COLOR_TAG, ColorUtil.colorTableInts[bannerColor]);
|
||||
}
|
||||
compound.setInteger("CNPCVariant", bannerColor);
|
||||
fixMade = true;
|
||||
|
||||
Reference in new issue
Block a user