Best MockBukkit code snippet using be.seeseemelk.mockbukkit.block.state.CampfireMock
Source:BlockStateMock.java
...322 case REPEATING_COMMAND_BLOCK:323 return new CommandBlockMock(block);324 case CAMPFIRE:325 case SOUL_CAMPFIRE:326 return new CampfireMock(block);327 case BELL:328 return new BellMock(block);329 case LECTERN:330 return new LecternMock(block);331 case HOPPER:332 return new HopperMock(block);333 case BARREL:334 return new BarrelMock(block);335 case DISPENSER:336 return new DispenserMock(block);337 case DROPPER:338 return new DropperMock(block);339 case CHEST:340 case TRAPPED_CHEST:...
Source:CampfireMockTest.java
...15import static org.junit.jupiter.api.Assertions.assertNotSame;16import static org.junit.jupiter.api.Assertions.assertNull;17import static org.junit.jupiter.api.Assertions.assertThrowsExactly;18import static org.junit.jupiter.api.Assertions.assertTrue;19class CampfireMockTest20{21 private WorldMock world;22 private BlockMock block;23 private CampfireMock campfire;24 @BeforeEach25 void setUp()26 {27 this.world = new WorldMock();28 this.block = world.getBlockAt(0, 10, 0);29 this.block.setType(Material.CAMPFIRE);30 this.campfire = new CampfireMock(this.block);31 }32 @Test33 void constructor_Material()34 {35 assertDoesNotThrow(() -> new CampfireMock(Material.CAMPFIRE));36 assertDoesNotThrow(() -> new CampfireMock(Material.SOUL_CAMPFIRE));37 }38 @Test39 void constructor_Material_NotCampfire_ThrowsException()40 {41 assertThrowsExactly(IllegalArgumentException.class, () -> new CampfireMock(Material.BEDROCK));42 }43 @Test44 void constructor_Block()45 {46 assertDoesNotThrow(() -> new CampfireMock(new BlockMock(Material.CAMPFIRE)));47 assertDoesNotThrow(() -> new CampfireMock(new BlockMock(Material.SOUL_CAMPFIRE)));48 }49 @Test50 void constructor_Block_NotCampfire_ThrowsException()51 {52 assertThrowsExactly(IllegalArgumentException.class, () -> new CampfireMock(new BlockMock(Material.BEDROCK)));53 }54 @Test55 void constructor_Copy_CopiesValues()56 {57 campfire.setItem(0, new ItemStack(Material.PORKCHOP));58 campfire.setCookTime(0, 10);59 campfire.setCookTimeTotal(0, 5);60 campfire.startCooking(0);61 CampfireMock clone = new CampfireMock(campfire);62 assertNotNull(clone.getItem(0).getType());63 assertEquals(Material.PORKCHOP, clone.getItem(0).getType());64 assertEquals(10, clone.getCookTime(0));65 assertEquals(5, clone.getCookTimeTotal(0));66 assertFalse(clone.isCookingDisabled(0));67 }68 @Test69 void getSnapshot_DifferentInstance()70 {71 assertNotSame(campfire, campfire.getSnapshot());72 }73 @ParameterizedTest74 @CsvSource("0,1,2,3")75 void getItems_Default_AllNull(int idx)76 {77 assertNull(campfire.getItem(idx));78 }79 @Test80 void setItem_SetsItem()81 {82 ItemStack item = new ItemStack(Material.PORKCHOP);83 campfire.setItem(0, item);84 assertEquals(item, campfire.getItem(0));85 }86 @Test87 void setCookTime_Sets()88 {89 campfire.setCookTime(0, 10);90 assertEquals(10, campfire.getCookTime(0));91 }92 @Test93 void setCookTime_LessThanZero_ThrowsException()94 {95 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.setCookTime(-1, 5));96 }97 @Test98 void setCookTime_GreaterThanThree_ThrowsException()99 {100 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.setCookTime(4, 5));101 }102 @Test103 void setCookTimeTotal_Sets()104 {105 campfire.setCookTimeTotal(0, 10);106 assertEquals(10, campfire.getCookTimeTotal(0));107 }108 @Test109 void setCookTimeTotal_LessThanZero_ThrowsException()110 {111 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.setCookTimeTotal(-1, 5));112 }113 @Test114 void setCookTimeTotal_GreaterThanThree_ThrowsException()115 {116 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.setCookTimeTotal(4, 5));117 }118 @ParameterizedTest119 @CsvSource("0,1,2,3")120 void startStopCooking_ModifiesAll(int idx)121 {122 campfire.startCooking();123 assertFalse(campfire.isCookingDisabled(idx));124 campfire.stopCooking();125 assertTrue(campfire.isCookingDisabled(idx));126 }127 @Test128 void startStopCooking_StopsCooking()129 {130 campfire.startCooking(0);131 assertFalse(campfire.isCookingDisabled(0));132 campfire.stopCooking(0);133 assertTrue(campfire.isCookingDisabled(0));134 }135 @Test136 void startCooking_LessThanZero_ThrowsException()137 {138 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.startCooking(-1));139 }140 @Test141 void startCooking_GreaterThanThree_ThrowsException()142 {143 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.startCooking(4));144 }145 @Test146 void stopCooking_LessThanZero_ThrowsException()147 {148 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.stopCooking(-1));149 }150 @Test151 void stopCooking_GreaterThanThree_ThrowsException()152 {153 assertThrowsExactly(IllegalArgumentException.class, () -> campfire.stopCooking(4));154 }155 @Test156 void blockStateMock_Mock_CorrectType()157 {158 assertInstanceOf(CampfireMock.class, BlockStateMock.mockState(new BlockMock(Material.CAMPFIRE)));159 assertInstanceOf(CampfireMock.class, BlockStateMock.mockState(new BlockMock(Material.SOUL_CAMPFIRE)));160 }161}...
Source:CampfireMock.java
...7import org.bukkit.block.Campfire;8import org.bukkit.inventory.ItemStack;9import org.jetbrains.annotations.NotNull;10import org.jetbrains.annotations.Nullable;11public class CampfireMock extends TileStateMock implements Campfire12{13 private static final int MAX_SLOTS = 4;14 private ItemStack[] items = new ItemStack[MAX_SLOTS];15 private int[] cookingProgress = new int[MAX_SLOTS];16 private int[] cookingTime = new int[MAX_SLOTS];17 private boolean[] cookingDisabled = new boolean[MAX_SLOTS];18 public CampfireMock(@NotNull Material material)19 {20 super(material);21 checkType(material, Tag.CAMPFIRES);22 }23 protected CampfireMock(@NotNull Block block)24 {25 super(block);26 checkType(block, Tag.CAMPFIRES);27 }28 protected CampfireMock(@NotNull CampfireMock state)29 {30 super(state);31 this.items = state.items.clone();32 this.cookingProgress = state.cookingProgress.clone();33 this.cookingTime = state.cookingTime.clone();34 this.cookingDisabled = state.cookingDisabled.clone();35 }36 @Override37 public @NotNull BlockState getSnapshot()38 {39 return new CampfireMock(this);40 }41 @Override42 public int getSize()43 {44 return MAX_SLOTS;45 }46 @Override47 public @Nullable ItemStack getItem(int index)48 {49 checkSlot(index); // Sanity check50 return this.items[index];51 }52 @Override53 public void setItem(int index, @Nullable ItemStack item)...
CampfireMock
Using AI Code Generation
1package be.seeseemelk.mockbukkit.block.state;2import org.bukkit.Material;3import org.bukkit.block.Block;4import org.bukkit.block.BlockFace;5import org.bukkit.block.BlockState;6import org.bukkit.block.Campfire;7import org.bukkit.inventory.ItemStack;8import org.bukkit.material.MaterialData;9import org.jetbrains.annotations.NotNull;10import org.jetbrains.annotations.Nullable;11import java.util.ArrayList;12import java.util.List;13public class CampfireMock extends ContainerMock implements Campfire {14 private final List<ItemStack> items = new ArrayList<>();15 private boolean lit = false;16 public CampfireMock(@NotNull Block block) {17 super(block);18 }19 public CampfireMock(@NotNull Material material) {20 super(material);21 }22 public CampfireMock(@NotNull MaterialData material) {23 super(material);24 }25 public CampfireMock(@NotNull Material material, byte data) {26 super(material, data);27 }28 public boolean isLit() {29 return lit;30 }31 public void setLit(boolean lit) {32 this.lit = lit;33 }34 public int getMaximumItems() {35 return 4;36 }37 public int getMaximumItemStackSize() {38 return 64;39 }40 public boolean addItem(@NotNull ItemStack item) {41 return false;42 }43 public boolean removeItem(int index) {44 return false;45 }46 public boolean removeItem(@NotNull ItemStack item) {47 return false;48 }49 public void clearItems() {50 }51 public @Nullable ItemStack getItem(int index) {52 return null;53 }54 public @NotNull ItemStack[] getContents() {55 return new ItemStack[0];56 }57 public void setContents(@NotNull ItemStack[] items) throws IllegalArgumentException {58 }59 public @NotNull ItemStack[] getStorageContents() {60 return new ItemStack[0];61 }62 public void setStorageContents(@NotNull ItemStack[] items) throws IllegalArgumentException {63 }64 public @NotNull BlockFace getFacing() {65 return null;66 }67 public @NotNull BlockState getSnapshot() {68 return null;69 }70}
CampfireMock
Using AI Code Generation
1package com.example;2import be.seeseemelk.mockbukkit.block.state.CampfireMock;3import be.seeseemelk.mockbukkit.inventory.InventoryMock;4import be.seeseemelk.mockbukkit.inventory.ItemStackBuilder;5import be.seeseemelk.mockbukkit.inventory.meta.FireworkMetaMock;6import be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock;7import org.bukkit.FireworkEffect;8import org.bukkit.Material;9import org.bukkit.inventory.ItemStack;10import org.bukkit.inventory.meta.FireworkEffectMeta;11import org.bukkit.inventory.meta.ItemMeta;12public class CampfireMockTest {13 public static void main(String[] args) {14 CampfireMock campfireMock = new CampfireMock();15 InventoryMock inventoryMock = campfireMock.getInventory();16 ItemStack itemStack = new ItemStackBuilder(Material.FIREWORK_ROCKET).amount(2).build();17 ItemMeta itemMeta = itemStack.getItemMeta();18 FireworkMetaMock fireworkMetaMock = (FireworkMetaMock) itemMeta;19 FireworkEffectMeta fireworkEffectMeta = (FireworkEffectMeta) itemMeta;20 FireworkEffect fireworkEffect = fireworkEffectMeta.getEffect();21 FireworkEffect fireworkEffect1 = FireworkEffect.builder().withColor(0x000000).build();22 fireworkMetaMock.setEffect(fireworkEffect1);23 inventoryMock.setItem(0, itemStack);24 campfireMock.update(true);25 }26}27package com.example;28import be.seeseemelk.mockbukkit.block.state.CampfireMock;29import be.seeseemelk.mockbukkit.inventory.InventoryMock;30import be.seeseemelk.mockbukkit.inventory.ItemStackBuilder;31import be.seeseemelk.mockbukkit.inventory.meta.FireworkMetaMock;32import be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock;33import org.bukkit.FireworkEffect;34import org.bukkit.Material;35import org.bukkit.inventory.ItemStack;36import org.bukkit.inventory.meta.FireworkEffectMeta;37import org.bukkit.inventory.meta.ItemMeta;38public class CampfireMockTest {39 public static void main(String[] args) {40 CampfireMock campfireMock = new CampfireMock();41 InventoryMock inventoryMock = campfireMock.getInventory();
CampfireMock
Using AI Code Generation
1import be.seeseemelk.mockbukkit.block.state.CampfireMock;2import org.bukkit.Material;3import org.bukkit.block.data.type.Campfire;4import org.bukkit.inventory.ItemStack;5import org.junit.jupiter.api.Test;6import static org.junit.jupiter.api.Assertions.*;7{8 public void test()9 {10 CampfireMock campfireMock = new CampfireMock(Material.CAMPFIRE);11 campfireMock.setCookingTime(10);12 campfireMock.setCookingTimeTotal(20);13 campfireMock.setSignalFire(true);14 campfireMock.setLit(true);15 campfireMock.setWaterlogged(true);16 campfireMock.setInfiniteFuel(true);17 campfireMock.setFuelLevel(4);18 campfireMock.setInventorySlot(0, new ItemStack(Material.COOKED_BEEF));19 campfireMock.setInventorySlot(1, new ItemStack(Material.BEEF));20 campfireMock.setInventorySlot(2, new ItemStack(Material.COOKED_PORKCHOP));21 campfireMock.setInventorySlot(3, new ItemStack(Material.PORKCHOP));22 campfireMock.setInventorySlot(4, new ItemStack(Material.COOKED_CHICKEN));23 campfireMock.setInventorySlot(5, new ItemStack(Material.CHICKEN));24 campfireMock.setInventorySlot(6, new ItemStack(Material.COOKED_COD));25 campfireMock.setInventorySlot(7, new ItemStack(Material.COD));26 campfireMock.setInventorySlot(8, new ItemStack(Material.COOKED_MUTTON));27 campfireMock.setInventorySlot(9, new ItemStack(Material.MUTTON));28 campfireMock.setInventorySlot(10, new ItemStack(Material.COOKED_RABBIT));29 campfireMock.setInventorySlot(11, new ItemStack(Material.RABBIT));30 campfireMock.setInventorySlot(12, new ItemStack(Material.COOKED_SALMON));31 campfireMock.setInventorySlot(13, new ItemStack(Material.SALMON));32 campfireMock.setInventorySlot(14, new ItemStack(Material.COOKED_POTATO));33 campfireMock.setInventorySlot(15, new ItemStack(Material.POTATO));34 campfireMock.setInventorySlot(16, new ItemStack(Material.COOKED_RABBIT));35 campfireMock.setInventorySlot(17, new ItemStack(Material.RABBIT));36 campfireMock.setInventorySlot(18
CampfireMock
Using AI Code Generation
1import be.seeseemelk.mockbukkit.block.state.CampfireMock;2import be.seeseemelk.mockbukkit.MockBukkit;3import be.seeseemelk.mockbukkit.ServerMock;4import org.bukkit.Material;5import org.bukkit.block.Block;6import org.bukkit.block.BlockState;7import org.bukkit.block.data.BlockData;8import org.bukkit.block.data.type.Campfire;9import org.bukkit.event.block.BlockCookEvent;10import org.bukkit.inventory.ItemStack;11import org.bukkit.inventory.meta.ItemMeta;12import org.bukkit.plugin.PluginManager;13import org.junit.After;14import org.junit.Before;15import org.junit.Test;16import static org.junit.Assert.*;17import static org.mockito.Mockito.*;18import java.util.Arrays;19import java.util.List;20import java.util.stream.Collectors;21import java.util.stream.Stream;22import org.bukkit.Bukkit;23import org.bukkit.Location;24import org.bukkit.Material;25import org.bukkit.entity.Player;26import org.bukkit.inventory.ItemStack;27import org.bukkit.inventory.meta.ItemMeta;28import org.bukkit.plugin.PluginManager;29import org.junit.After;30import org.junit.Before;31import org.junit.Test;32import static org.junit.Assert.*;33import static org.mockito.Mockito.*;34{35 private ServerMock server;36 private CampfireMock campfire;37 private BlockCookEvent event;38 private PluginManager pluginManager;39 private ItemStack item;40 private ItemMeta meta;41 private Campfire campfireData;42 public void setUp()43 {44 server = MockBukkit.mock();45 campfire = new CampfireMock(Material.CAMPFIRE);46 pluginManager = server.getPluginManager();47 item = new ItemStack(Material.BEEF);48 meta = item.getItemMeta();49 meta.setDisplayName("Baked Beef");50 item.setItemMeta(meta);51 campfireData = (Campfire) campfire.getBlockData();52 }53 public void tearDown()54 {55 MockBukkit.unmock();56 }
CampfireMock
Using AI Code Generation
1package be.seeseemelk.mockbukkit.block.state;2import org.bukkit.Material;3import org.bukkit.block.data.type.Campfire;4import org.bukkit.inventory.ItemStack;5import org.jetbrains.annotations.NotNull;6import be.seeseemelk.mockbukkit.block.BlockMock;7import be.seeseemelk.mockbukkit.block.BlockStateMock;8{9 private boolean lit;10 private int signalFire;11 private int cookingTimeTotal;12 private int cookingTime;13 private ItemStack[] inventory;14 public CampfireMock()15 {16 super(new BlockMock(Material.CAMPFIRE));17 lit = false;18 signalFire = 0;19 cookingTimeTotal = 0;20 cookingTime = 0;21 inventory = new ItemStack[4];22 }23 public CampfireMock(@NotNull Material material)24 {25 super(new BlockMock(material));26 lit = false;27 signalFire = 0;28 cookingTimeTotal = 0;29 cookingTime = 0;30 inventory = new ItemStack[4];31 }32 public boolean isLit()33 {34 return lit;35 }36 public void setLit(boolean lit)37 {38 this.lit = lit;39 }40 public int getSignalFire()41 {42 return signalFire;43 }44 public void setSignalFire(int signalFire)45 {46 this.signalFire = signalFire;47 }48 public int getCookingTimeTotal()49 {50 return cookingTimeTotal;51 }52 public void setCookingTimeTotal(int cookingTimeTotal)53 {54 this.cookingTimeTotal = cookingTimeTotal;55 }56 public int getCookingTime()57 {58 return cookingTime;59 }60 public void setCookingTime(int cookingTime)61 {62 this.cookingTime = cookingTime;63 }64 public ItemStack getItem(int slot)65 {66 return inventory[slot];67 }68 public void setItem(int slot, ItemStack item)69 {70 inventory[slot] = item;71 }72 public ItemStack[] getContents()73 {74 return inventory;75 }
CampfireMock
Using AI Code Generation
1import org.bukkit.Material;2import org.bukkit.block.Block;3import org.bukkit.block.Campfire;4import org.bukkit.block.data.Ageable;5import org.bukkit.entity.Player;6import org.bukkit.inventory.ItemStack;7import org.bukkit.inventory.meta.ItemMeta;8import org.bukkit.inventory.meta.Repairable;9import org.bukkit.plugin.java.JavaPlugin;10import be.seeseemelk.mockbukkit.block.state.CampfireMock;11{12 private Campfire campfire;13 private ItemStack item;14 private Player player;15 public void onEnable()16 {17 Block block = getServer().getWorld("world").getBlockAt(0, 0, 0);18 block.setType(Material.CAMPFIRE);19 campfire = (Campfire) block.getState();20 ItemStack item = new ItemStack(Material.STONE_SWORD);21 ItemMeta meta = item.getItemMeta();22 ((Repairable) meta).setRepairCost(10);23 item.setItemMeta(meta);24 campfire.setCookTimeTotal(100);25 campfire.setCookTime(50);26 campfire.setSmelting(item);27 campfire.setFuel(item);28 campfire.setCookTimeTotal(100);29 campfire.setCookTime(50);30 campfire.setSmelting(item);31 campfire.setFuel(item);32 campfire.setCookTimeTotal(100);33 campfire.setCookTime(50);34 campfire.setSmelting(item);35 campfire.setFuel(item);36 campfire.setCookTimeTotal(100);37 campfire.setCookTime(50);38 campfire.setSmelting(item);39 campfire.setFuel(item);40 campfire.setCookTimeTotal(100);41 campfire.setCookTime(50);42 campfire.setSmelting(item);43 campfire.setFuel(item);44 campfire.setCookTimeTotal(100);45 campfire.setCookTime(50);46 campfire.setSmelting(item);47 campfire.setFuel(item);48 campfire.setCookTimeTotal(100);49 campfire.setCookTime(50);50 campfire.setSmelting(item);51 campfire.setFuel(item);52 campfire.setCookTimeTotal(100);
CampfireMock
Using AI Code Generation
1package be.seeseemelk.mockbukkit.block.state;2import org.bukkit.block.Block;3import org.bukkit.block.data.BlockData;4import org.bukkit.block.data.type.Campfire;5import org.junit.jupiter.api.Test;6import be.seeseemelk.mockbukkit.MockBukkit;7import be.seeseemelk.mockbukkit.ServerMock;8import be.seeseemelk.mockbukkit.block.BlockMock;9import be.seeseemelk.mockbukkit.block.BlockStateMock;10public class CampfireMockTest {11 private ServerMock server;12 public void test() {13 server = MockBukkit.mock();14 BlockMock block = new BlockMock(Material.CAMPFIRE);15 CampfireMock state = new CampfireMock(block);16 state.setCookingTime(100);17 state.setCookingTimeTotal(200);18 state.setLit(true);19 state.setSignalFire(true);20 state.setWaterlogged(true);21 state.setFacing(BlockFace.NORTH);22 state.setInWall(true);23 state.setPart(BlockData.class);24 state.setShape(BlockData.class);25 state.setLit(false);26 state.setSignalFire(false);27 state.setWaterlogged(false);28 state.setFacing(BlockFace.SOUTH);29 state.setInWall(false);30 state.setPart(BlockData.class);31 state.setShape(BlockData.class);32 state.setLit(true);33 state.setSignalFire(true);34 state.setWaterlogged(true);35 state.setFacing(BlockFace.EAST);36 state.setInWall(true);37 state.setPart(BlockData.class);38 state.setShape(BlockData.class);39 state.setLit(false);40 state.setSignalFire(false);41 state.setWaterlogged(false);42 state.setFacing(BlockFace.WEST);43 state.setInWall(false);44 state.setPart(BlockData.class);45 state.setShape(BlockData.class);46 state.setLit(true);47 state.setSignalFire(true);48 state.setWaterlogged(true);49 state.setFacing(BlockFace.NORTH);50 state.setInWall(true);51 state.setPart(BlockData.class);52 state.setShape(BlockData.class);53 state.setLit(false);54 state.setSignalFire(false);55 state.setWaterlogged(false);56 state.setFacing(BlockFace.SOUTH);57 state.setInWall(false);58 state.setPart(BlockData.class);59 state.setShape(BlockData.class);60 state.setLit(true
CampfireMock
Using AI Code Generation
1package be.seeseemelk.mockbukkit.block.state;2import org.bukkit.Material;3import org.bukkit.block.Campfire;4import org.bukkit.inventory.ItemStack;5import org.junit.jupiter.api.AfterEach;6import org.junit.jupiter.api.BeforeEach;7import org.junit.jupiter.api.Test;8import be.seeseemelk.mockbukkit.MockBukkit;9import be.seeseemelk.mockbukkit.ServerMock;10import be.seeseemelk.mockbukkit.block.BlockMock;11import static org.junit.jupiter.api.Assertions.*;12{13 private ServerMock server;14 private BlockMock block;15 private Campfire campfire;16 public void setUp()17 {18 server = MockBukkit.mock();19 block = new BlockMock(Material.CAMPFIRE);20 campfire = (Campfire) block.getState();21 }22 public void tearDown()23 {24 MockBukkit.unmock();25 }26 public void testInitialState()27 {28 assertEquals(0, campfire.getInventory().getSize());29 assertEquals(0, campfire.getInventory().getContents().length);30 assertEquals(0, campfire.getInventory().getStorageContents().length);31 assertEquals(0, campfire.getInventory().getExtraContents().length);32 assertEquals(0, campfire.getInventory().getMaxStackSize());33 assertEquals(0, campfire.getInventory().getMaxStorageSize());34 assertEquals(0, campfire.getInventory().getMaxExtraSize());35 assertEquals(0, campfire.getInventory().getHolder().getInventory().getSize());36 assertEquals(0, campfire.getInventory().getHolder().getInventory().getContents().length);37 assertEquals(0, campfire.getInventory().getHolder().getInventory().getStorageContents().length);38 assertEquals(0, campfire.getInventory().getHolder().getInventory().getExtraContents().length);39 assertEquals(0, campfire.getInventory().getHolder().getInventory().getMaxStackSize());40 assertEquals(0, campfire.getInventory().getHolder().getInventory().getMaxStorageSize());41 assertEquals(0, campfire.getInventory().getHolder().getInventory().getMaxExtraSize());42 assertEquals(0, campfire.getInventory().getHolder().getInventory().getHolder().getInventory().getSize());
CampfireMock
Using AI Code Generation
1package com.example;2import org.bukkit.Material;3import org.bukkit.block.Block;4import org.bukkit.block.data.type.Campfire;5import org.bukkit.block.data.type.Campfire.CookingResult;6import org.bukkit.inventory.ItemStack;7import org.bukkit.inventory.meta.ItemMeta;8import org.junit.jupiter.api.Test;9import be.seeseemelk.mockbukkit.block.state.CampfireMock;10{11 void test()12 {13 CampfireMock campfire = new CampfireMock(Material.CAMPFIRE);14 campfire.setCookingTime(100);15 campfire.setCookingTotalTime(500);16 campfire.setCookingResult(CookingResult.TOO_HIGH);17 campfire.setSignalFire(true);18 campfire.setLit(true);19 campfire.setWaterlogged(true);20 campfire.setPersistent(true);21 campfire.setInWall(true);22 campfire.setFacing(BlockFace.NORTH);23 ItemStack item = new ItemStack(Material.COOKED_BEEF);24 ItemMeta meta = item.getItemMeta();25 meta.setDisplayName("test");26 item.setItemMeta(meta);27 campfire.getInventory().addItem(item);28 }29}30package com.example;31import org.bukkit.Material;32import org.bukkit.block.Block;33import org.bukkit.block.data.type.Campfire;34import org.bukkit.block.data.type.Campfire.CookingResult;35import org.bukkit.inventory.ItemStack;36import org.bukkit.inventory.meta.ItemMeta;37import org.junit.jupiter.api.Test;38import be.seeseemelk.mockbukkit.block.state.CampfireMock;39{40 void test()41 {42 CampfireMock campfire = new CampfireMock(Material.CAMPFIRE);43 campfire.setCookingTime(100);44 campfire.setCookingTotalTime(500);45 campfire.setCookingResult(CookingResult.TOO_HIGH);46 campfire.setSignalFire(true);47 campfire.setLit(true);48 campfire.setWaterlogged(true);49 campfire.setPersistent(true);50 campfire.setInWall(true);51 campfire.setFacing(Block
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!