use of net.minecraft.server.v1_8_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);
for (Container container : containers) {
container.a(this);
}
// Update the armorstand grid
display.update();
}
use of net.minecraft.server.v1_8_R1.Container in project PublicCrafters by BananaPuncher714.
the class CustomTileEntityContainerWorkbench method createMenu.
/**
* This is an ITileEntityContainer method that returns a new container for whatever tile entity
*/
@Override
public Container createMenu(int id, PlayerInventory inv, EntityHuman ent) {
CustomInventoryCrafting crafting = manager.benches.get(bloc);
if (crafting == null) {
crafting = new CustomInventoryCrafting(bloc, manager, new SelfContainer(id), 3, 3);
manager.put(bloc, crafting);
}
IInventory inventory = crafting.resultInventory;
InventoryCraftResult result;
if (inventory instanceof InventoryCraftResult || inventory == null) {
result = new InventoryCraftResult();
crafting.resultInventory = result;
} else {
result = (InventoryCraftResult) inventory;
}
Container container = new CustomContainerWorkbench(id, ent.getBukkitEntity(), bloc, crafting, result);
crafting.addContainer(container);
return container;
}
use of net.minecraft.server.v1_8_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);
for (Container container : containers) {
container.a(this);
}
// Update the armorstand grid
display.update();
}
use of net.minecraft.server.v1_8_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[index] = item;
for (Container container : containers) {
container.a(this);
}
// Update the armorstand grid
display.update();
}
use of net.minecraft.server.v1_8_R1.Container in project tests by datanucleus.
the class BasicTest method testInh2.
public void testInh2() {
try {
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try {
tx.begin();
Base base1 = new Base(1, "b1");
Base base2 = new Base(2, "b2");
Base base3 = new Base(3, "b3");
SubBase group1 = new SubBase(4, "b4", "SB1");
SubBase group2 = new SubBase(5, "b5", "SB2");
Container c = new Container(new Base[] { base1, base2, base3, group1, group2 });
pm.makePersistent(c);
tx.commit();
tx.begin();
Collection col = (Collection) pm.newQuery(SubBase.class).execute();
assertTrue(col.size() == 2);
assertTrue(col.contains(group1));
assertTrue(col.contains(group2));
tx.commit();
} finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
} finally {
clean(Container.class);
clean(SubBase.class);
clean(Base.class);
}
}
Aggregations