Search in sources :

Example 6 with Container

use of net.minecraft.server.v1_10_R1.Container in project mdsal by opendaylight.

the class TestListSquashing method testUserOrderedList.

@Test
public void testUserOrderedList() {
    final Keyed keyed = new KeyedBuilder().withKey(new KeyedKey("a")).build();
    final Unkeyed unkeyed = new UnkeyedBuilder().build();
    final Container cont = new ContainerBuilder().setKeyed(List.of(keyed)).setUnkeyed(List.of(unkeyed)).build();
    // Non-empty Lists should be retained
    assertEquals(List.of(keyed), cont.getKeyed());
    assertEquals(List.of(unkeyed), cont.getUnkeyed());
}
Also used : Container(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container) KeyedBuilder(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.container.KeyedBuilder) ContainerBuilder(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.ContainerBuilder) KeyedKey(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.container.KeyedKey) UnkeyedBuilder(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.container.UnkeyedBuilder) Keyed(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.container.Keyed) Unkeyed(org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.container.Unkeyed) Test(org.junit.Test)

Example 7 with Container

use of net.minecraft.server.v1_10_R1.Container in project WildChests by BG-Software-LLC.

the class NMSInventory_v1_16_R3 method openPage.

@Override
public void openPage(Player player, com.bgsoftware.wildchests.objects.inventory.CraftWildInventory inventory) {
    EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    String title = inventory.getTitle();
    Container container = createContainer(entityPlayer.nextContainerCounter(), entityPlayer.inventory, inventory);
    container.setTitle(new ChatComponentText(title));
    entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), container.getTitle()));
    entityPlayer.activeContainer = container;
    entityPlayer.activeContainer.addSlotListener(entityPlayer);
}
Also used : Container(net.minecraft.server.v1_16_R3.Container) TileEntityContainer(com.bgsoftware.wildchests.objects.containers.TileEntityContainer) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) PacketPlayOutOpenWindow(net.minecraft.server.v1_16_R3.PacketPlayOutOpenWindow) ChatComponentText(net.minecraft.server.v1_16_R3.ChatComponentText)

Example 8 with Container

use of net.minecraft.server.v1_10_R1.Container in project PublicCrafters by BananaPuncher714.

the class CustomInventoryCrafting method setItem.

@Override
public void setItem(int index, ItemStack item) {
    // Instead of updating one container, update all the containers
    // That are looking at the table, basically the viewers
    items.set(index, item == null ? ItemStack.a : item);
    for (Container container : containers) {
        container.a(this);
    }
    // Update the armorstand grid
    display.update();
}
Also used : SelfContainer(io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer) Container(net.minecraft.server.v1_11_R1.Container)

Example 9 with Container

use of net.minecraft.server.v1_10_R1.Container in project PublicCrafters by BananaPuncher714.

the class CustomInventoryCrafting method splitStack.

@Override
public ItemStack splitStack(int i, int j) {
    ItemStack itemstack = ContainerUtil.a(items, i, j);
    if (!itemstack.isEmpty()) {
        for (Container container : containers) {
            container.a(this);
        }
    }
    // Update the armorstand grid
    display.update();
    return itemstack;
}
Also used : SelfContainer(io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer) Container(net.minecraft.server.v1_11_R1.Container) CraftItemStack(org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack) ItemStack(net.minecraft.server.v1_11_R1.ItemStack)

Example 10 with Container

use of net.minecraft.server.v1_10_R1.Container in project PublicCrafters by BananaPuncher714.

the class CustomTileEntityContainerSelector method getWorkbenchContainer.

protected Container getWorkbenchContainer(EntityHuman ent) {
    CustomInventoryCrafting crafting = manager.benches.get(bloc);
    if (crafting == null) {
        crafting = new CustomInventoryCrafting(bloc, manager, new SelfContainer(), 3, 3);
        manager.put(bloc, crafting);
    }
    IInventory result = crafting.resultInventory;
    if (result == null) {
        result = new InventoryCraftResult();
        crafting.resultInventory = result;
    }
    Container container = new CustomContainerWorkbench(ent.getBukkitEntity(), bloc, crafting, result);
    crafting.addContainer(container);
    return container;
}
Also used : IInventory(net.minecraft.server.v1_11_R1.IInventory) ITileEntityContainer(net.minecraft.server.v1_11_R1.ITileEntityContainer) Container(net.minecraft.server.v1_11_R1.Container) SelfContainer(io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer) SelfContainer(io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer) InventoryCraftResult(net.minecraft.server.v1_11_R1.InventoryCraftResult)

Aggregations

Container (org.flyte.api.v1.Container)9 HashMap (java.util.HashMap)5 Test (org.junit.Test)5 Tasks (flyteidl.core.Tasks)4 SelfContainer (io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer)4 ArrayList (java.util.ArrayList)4 App (mesosphere.marathon.client.model.v2.App)4 Container (mesosphere.marathon.client.model.v2.Container)4 Docker (mesosphere.marathon.client.model.v2.Docker)4 HealthCheck (mesosphere.marathon.client.model.v2.HealthCheck)4 Container (net.minecraft.server.v1_11_R1.Container)4 Container (net.minecraft.server.v1_12_R1.Container)4 Container (net.minecraft.server.v1_16_R3.Container)4 Container (net.minecraft.server.v1_8_R3.Container)4 TaskTemplate (org.flyte.api.v1.TaskTemplate)4 Test (org.junit.jupiter.api.Test)4 Container (org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.Container)4 ContainerBuilder (org.opendaylight.yang.gen.v1.urn.test.opendaylight.mdsal298.rev180129.ContainerBuilder)4 TileEntityContainer (com.bgsoftware.wildchests.objects.containers.TileEntityContainer)3 SelfContainer (io.github.bananapuncher714.crafters.implementation.v1_10_R1.ContainerManager_v1_10_R1.SelfContainer)3