Search in sources :

Example 6 with MapResourcePack

use of com.bergerkiller.bukkit.common.map.MapResourcePack in project BKCommonLib by bergerhealer.

the class MapResourcePackTest method testItemSlotTexture.

@Ignore
@Test
public void testItemSlotTexture() {
    Random rand = new Random();
    MapTexture map = MapTexture.createEmpty(128, 128);
    map.fill(MapColorPalette.getColor(128, 128, 128));
    // new MapResourcePack("https://www.dropbox.com/s/s77nz3zaclrdqog/TestPack.zip?dl=1");
    MapResourcePack pack = MapResourcePack.SERVER;
    pack.load();
    ItemStack item = ItemUtil.createItem(Material.DIAMOND_SWORD, 2, 1);
    ItemUtil.getMetaTag(item, true).putValue("Unbreakable", true);
    for (int x = 0; x < 128 - 16; x += 18) {
        for (int y = 0; y < 128 - 16; y += 18) {
            testDrawModel(map, pack, x, y, rand.nextInt(70));
        }
    }
    /*
        for (int x = 0; x < 128-16; x += 18) {
            for (int y = 0; y < 128-16; y += 18) {
                testDraw(map, pack, x, y, Material.values()[rand.nextInt(Material.values().length)]);
            }
        }
        */
    MapDebugWindow.showMapForeverAutoScale(map);
}
Also used : MapTexture(com.bergerkiller.bukkit.common.map.MapTexture) Random(java.util.Random) MapResourcePack(com.bergerkiller.bukkit.common.map.MapResourcePack) ItemStack(org.bukkit.inventory.ItemStack) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

MapResourcePack (com.bergerkiller.bukkit.common.map.MapResourcePack)6 Ignore (org.junit.Ignore)5 Test (org.junit.Test)5 MapTexture (com.bergerkiller.bukkit.common.map.MapTexture)4 Model (com.bergerkiller.bukkit.common.map.util.Model)2 HashSet (java.util.HashSet)2 ItemStack (org.bukkit.inventory.ItemStack)2 BlockData (com.bergerkiller.bukkit.common.wrappers.BlockData)1 Random (java.util.Random)1 Material (org.bukkit.Material)1