net.minecraft.tileentity.TileEntityFlowerPot Java Examples

The following examples show how to use net.minecraft.tileentity.TileEntityFlowerPot. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdapterFlowerPot.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
@ScriptCallable(returnTypes = ReturnType.TABLE)
public ItemStack getContents(TileEntityFlowerPot pot) {
	Item item = pot.getFlowerPotItem();

	if (item == null) return null;
	int data = pot.getFlowerPotData();
	return new ItemStack(item, 1, data);
}
 
Example #2
Source File: StructureGenHelper.java    From Artifacts with MIT License 5 votes vote down vote up
public static void generatePotContents(Random rand, TileEntityFlowerPot te) {
	int[] possibleContents = {6, 32, 37, 38, 39, 40, 81}; //{"minecraft:sapling", "minecraft:deadbush", "minecraft:yellow_flower", "minecraft:red_flower", "minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:cactus"}
	int[][] possibleMeta = {{0, 1, 2, 3, 4, 5}, {0}, {0}, {0, 1, 2, 3, 4, 5, 6, 7, 8}, {0}, {0}, {0}};
	
	int contentIndex = rand.nextInt(possibleContents.length);
	int metaIndex = rand.nextInt(possibleMeta[contentIndex].length);
	
	te.func_145964_a(Item.getItemById(possibleContents[contentIndex]), possibleMeta[contentIndex][metaIndex]);
}
 
Example #3
Source File: CraftFlowerPot.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftFlowerPot(Block block) {
    super(block, TileEntityFlowerPot.class);
}
 
Example #4
Source File: CraftFlowerPot.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftFlowerPot(Material material, TileEntityFlowerPot te) {
    super(material, te);
}
 
Example #5
Source File: CraftFlowerPot.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void load(TileEntityFlowerPot pot) {
    super.load(pot);

    contents = (pot.getFlowerPotItem() == null) ? null : CraftItemStack.asBukkitCopy(pot.getFlowerItemStack()).getData();
}
 
Example #6
Source File: CraftFlowerPot.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void applyTo(TileEntityFlowerPot pot) {
    super.applyTo(pot);

    pot.setItemStack(contents == null ? ItemStack.EMPTY : CraftItemStack.asNMSCopy(contents.toItemStack(1)));
}
 
Example #7
Source File: AdapterFlowerPot.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@Override
public Class<?> getTargetClass() {
	return TileEntityFlowerPot.class;
}