mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 19:39:37 +00:00
Start to work on ceramic blocks
This commit is contained in:
1 parent
4b6e3e5424
commit
9e68539431
28 files changed
+1009
-661
No files matched your search
@@ -1,10 +1,46 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileCeramic extends TileEntity {
|
||||
|
||||
protected EnumFlowerColor color;
|
||||
|
||||
public void setColor(EnumFlowerColor color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public EnumFlowerColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("Color", color.getID());
|
||||
return super.writeToNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
color = EnumFlowerColor.VALUES[compound.getInteger("Color")];
|
||||
}
|
||||
|
||||
public ItemStack getStack(){
|
||||
return getStack(1);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount){
|
||||
int ID = 0;
|
||||
if(color != null){
|
||||
ID = color.getID();
|
||||
}
|
||||
return new ItemStack(Botany.ceramic, amount, ID);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user