001 package org.bukkit.material; 002 003 import org.bukkit.Material; 004 005 /** 006 * Represents a cauldron 007 */ 008 public class Cauldron extends MaterialData { 009 private static final int CAULDRON_FULL = 3; 010 private static final int CAULDRON_EMPTY = 0; 011 012 public Cauldron() { 013 super(Material.CAULDRON); 014 } 015 016 /** 017 * 018 * @deprecated Magic value 019 */ 020 @Deprecated 021 public Cauldron(int type, byte data){ 022 super(type, data); 023 } 024 025 /** 026 * 027 * @deprecated Magic value 028 */ 029 @Deprecated 030 public Cauldron(byte data) { 031 super(Material.CAULDRON, data); 032 } 033 034 /** 035 * Check if the cauldron is full. 036 * 037 * @return True if it is full. 038 */ 039 public boolean isFull() { 040 return getData() >= CAULDRON_FULL; 041 } 042 043 /** 044 * Check if the cauldron is empty. 045 * 046 * @return True if it is empty. 047 */ 048 public boolean isEmpty() { 049 return getData() <= CAULDRON_EMPTY; 050 } 051 052 @Override 053 public String toString() { 054 return (isEmpty() ? "EMPTY" : (isFull() ? "FULL" : getData() + "/3 FULL")) + " CAULDRON"; 055 } 056 057 @Override 058 public Cauldron clone() { 059 return (Cauldron) super.clone(); 060 } 061 }