Search in sources :

Example 56 with Container

use of com.google.api.services.container.v1beta1.Container in project TheAPI by TheDevTec.

the class v1_16_R1 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : Container(net.minecraft.server.v1_16_R1.Container) CraftContainer(org.bukkit.craftbukkit.v1_16_R1.inventory.CraftContainer) EntityPlayer(net.minecraft.server.v1_16_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_16_R1.PacketPlayOutCloseWindow)

Example 57 with Container

use of com.google.api.services.container.v1beta1.Container in project TheAPI by TheDevTec.

the class v1_8_R2 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : IContainer(net.minecraft.server.v1_8_R2.IContainer) CraftContainer(org.bukkit.craftbukkit.v1_8_R2.inventory.CraftContainer) Container(net.minecraft.server.v1_8_R2.Container) EntityPlayer(net.minecraft.server.v1_8_R2.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_8_R2.PacketPlayOutCloseWindow)

Example 58 with Container

use of com.google.api.services.container.v1beta1.Container in project TheAPI by TheDevTec.

the class v1_8_R2 method openGUI.

@Override
public void openGUI(Player player, Object container, String legacy, int size, String title, ItemStack[] items) {
    EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
    int id = ((Container) container).windowId;
    net.minecraft.server.v1_8_R2.ItemStack[] nmsItems = new net.minecraft.server.v1_8_R2.ItemStack[items.length];
    for (int i = 0; i < items.length; ++i) {
        ItemStack is = items[i];
        if (is == null || is.getType() == Material.AIR)
            continue;
        net.minecraft.server.v1_8_R2.ItemStack item = null;
        ((Container) container).setItem(i, item = (net.minecraft.server.v1_8_R2.ItemStack) asNMSItem(is));
        nmsItems[i] = item;
    }
    BukkitLoader.getPacketHandler().send(player, packetOpenWindow(id, legacy, size, title));
    int i = 0;
    for (net.minecraft.server.v1_8_R2.ItemStack o : nmsItems) BukkitLoader.getPacketHandler().send(player, packetSetSlot(id, i++, o));
    nmsPlayer.activeContainer.transferTo((Container) container, (CraftPlayer) player);
    nmsPlayer.activeContainer = (Container) container;
    ((Container) container).addSlotListener(nmsPlayer);
    ((Container) container).checkReachable = false;
}
Also used : IContainer(net.minecraft.server.v1_8_R2.IContainer) CraftContainer(org.bukkit.craftbukkit.v1_8_R2.inventory.CraftContainer) Container(net.minecraft.server.v1_8_R2.Container) EntityPlayer(net.minecraft.server.v1_8_R2.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer) ItemStack(org.bukkit.inventory.ItemStack) CraftItemStack(org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack)

Example 59 with Container

use of com.google.api.services.container.v1beta1.Container in project seldon-core by SeldonIO.

the class PredictorBean method predictorStateFromPredictorSpec.

// TODO
public PredictorState predictorStateFromPredictorSpec(PredictorSpec predictorSpec) {
    // Boolean enabled = PredictorSpec.getEnabled();
    Boolean enabled = true;
    PredictiveUnit rootUnit = predictorSpec.getGraph();
    Map<String, Container> containersMap = new HashMap<String, Container>();
    for (Container container : predictorSpec.getComponentSpec().getSpec().getContainersList()) {
        containersMap.put(container.getName(), container);
    }
    PredictiveUnitState rootState = new PredictiveUnitState(rootUnit, containersMap);
    return new PredictorState(rootUnit.getName(), rootState, enabled);
}
Also used : Container(io.kubernetes.client.proto.V1.Container) HashMap(java.util.HashMap) PredictiveUnit(io.seldon.protos.DeploymentProtos.PredictiveUnit)

Example 60 with Container

use of com.google.api.services.container.v1beta1.Container in project pravega by pravega.

the class BookkeeperService method createBookieApp.

private App createBookieApp() {
    App app = new App();
    app.setId(this.id);
    app.setCpus(cpu);
    app.setMem(mem);
    app.setInstances(instances);
    app.setConstraints(setConstraint("hostname", "UNIQUE"));
    app.setContainer(new Container());
    app.getContainer().setType(CONTAINER_TYPE);
    app.getContainer().setDocker(new Docker());
    app.getContainer().getDocker().setImage(IMAGE_PATH + "/nautilus/bookkeeper:" + PRAVEGA_VERSION);
    Collection<Volume> volumeCollection = new ArrayList<>();
    volumeCollection.add(createVolume("/bk", "mnt", "RW"));
    // TODO: add persistent volume  (see issue https://github.com/pravega/pravega/issues/639)
    app.getContainer().setVolumes(volumeCollection);
    app.setPorts(Arrays.asList(BK_PORT));
    app.setRequirePorts(true);
    // set env
    String zk = zkUri.getHost() + ":" + ZKSERVICE_ZKPORT;
    Map<String, Object> map = new HashMap<>();
    map.put("ZK_URL", zk);
    map.put("ZK", zk);
    map.put("bookiePort", String.valueOf(BK_PORT));
    map.put("DLOG_EXTRA_OPTS", "-Xms512m");
    app.setEnv(map);
    // healthchecks
    List<HealthCheck> healthCheckList = new ArrayList<>();
    healthCheckList.add(setHealthCheck(300, "TCP", false, 60, 20, 0, BK_PORT));
    app.setHealthChecks(healthCheckList);
    return app;
}
Also used : App(mesosphere.marathon.client.model.v2.App) Container(mesosphere.marathon.client.model.v2.Container) Docker(mesosphere.marathon.client.model.v2.Docker) Volume(mesosphere.marathon.client.model.v2.Volume) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) HealthCheck(mesosphere.marathon.client.model.v2.HealthCheck)

Aggregations

ItemStack (org.bukkit.inventory.ItemStack)45 Container (net.minecraft.server.v1_12_R1.Container)9 Container (net.minecraft.server.v1_16_R3.Container)9 Container (org.flyte.api.v1.Container)9 FailedNbt (com.ruinscraft.panilla.api.exception.FailedNbt)8 INbtTagCompound (com.ruinscraft.panilla.api.nbt.INbtTagCompound)8 Container (net.minecraft.server.v1_11_R1.Container)8 Container (net.minecraft.server.v1_14_R1.Container)8 Container (net.minecraft.server.v1_15_R1.Container)8 Container (net.minecraft.server.v1_16_R1.Container)8 Container (net.minecraft.server.v1_16_R2.Container)8 Container (net.minecraft.server.v1_8_R3.Container)8 Container (net.minecraft.server.v1_13_R1.Container)7 Container (net.minecraft.server.v1_13_R2.Container)6 Container (net.minecraft.server.v1_10_R1.Container)5 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)5 SelfContainer (io.github.bananapuncher714.crafters.implementation.v1_11_R1.ContainerManager_v1_11_R1.SelfContainer)4 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)4 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)4 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)4