Search in sources :

Example 1 with MockSign

use of au.com.mineauz.minigames.objects.MockSign in project Minigames by AddstarMC.

the class TestHelper method createSignBlock.

public static BlockMock createSignBlock(Map<Integer, String> lines, WorldMock world) {
    MaterialData data = new MaterialData(Material.OAK_SIGN, (byte) 0);
    MockSign sign = new MockSign(data, true);
    for (Map.Entry<Integer, String> e : lines.entrySet()) {
        sign.setLine(e.getKey(), e.getValue());
    }
    BlockData bData = new BlockData() {

        @Override
        public Material getMaterial() {
            return Material.OAK_SIGN;
        }

        @Override
        public String getAsString() {
            return null;
        }

        @Override
        public String getAsString(boolean b) {
            return "SIGN";
        }

        @Override
        public BlockData merge(BlockData blockData) {
            return this;
        }

        @Override
        public boolean matches(BlockData blockData) {
            return true;
        }

        @Override
        public BlockData clone() {
            return this;
        }
    };
    return new SignBlockMock(Material.OAK_SIGN, new Location(world, 10, 40, 10), sign, bData);
}
Also used : SignBlockMock(au.com.mineauz.minigames.objects.SignBlockMock) MaterialData(org.bukkit.material.MaterialData) BlockData(org.bukkit.block.data.BlockData) MockSign(au.com.mineauz.minigames.objects.MockSign) Location(org.bukkit.Location)

Aggregations

MockSign (au.com.mineauz.minigames.objects.MockSign)1 SignBlockMock (au.com.mineauz.minigames.objects.SignBlockMock)1 Location (org.bukkit.Location)1 BlockData (org.bukkit.block.data.BlockData)1 MaterialData (org.bukkit.material.MaterialData)1