use of com.marcnuri.yakc.model.io.k8s.api.core.v1.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 com.marcnuri.yakc.model.io.k8s.api.core.v1.Container in project eclipselink by eclipse-ee4j.
the class PackageLevelTestCases method getControlObject.
@Override
public Object getControlObject() {
Container container = new Container();
container.setContainerProperty(Unmappable.getInstance("aaa"));
return container;
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Container in project eclipselink by eclipse-ee4j.
the class PropertyLevelTestCases method getControlObject.
@Override
public Object getControlObject() {
Container container = new Container();
container.setContainerProperty(Unmappable.getInstance("aaa"));
return container;
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Container in project Panilla by ds58.
the class InventoryCleaner method clean.
@Override
public void clean(IPanillaPlayer player) {
CraftPlayer craftPlayer = (CraftPlayer) player.getHandle();
Container container = craftPlayer.getHandle().activeContainer;
for (int slot = 0; slot < container.slots.size(); slot++) {
ItemStack itemStack = container.getSlot(slot).getItem();
if (itemStack == null || !itemStack.hasTag()) {
continue;
}
NBTTagCompound nmsTag = itemStack.getTag();
INbtTagCompound tag = new NbtTagCompound(nmsTag);
String itemName = itemStack.getItem().getName();
if (nmsTag == null || itemName == null) {
continue;
}
FailedNbt failedNbt = NbtChecks.checkAll(tag, itemName, panilla);
if (FailedNbt.failsThreshold(failedNbt)) {
container.getSlot(slot).getItem().setTag(null);
} else if (FailedNbt.fails(failedNbt)) {
nmsTag.remove(failedNbt.key);
container.getSlot(slot).getItem().setTag(nmsTag);
}
}
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Container in project Panilla by ds58.
the class InventoryCleaner method clean.
@Override
public void clean(IPanillaPlayer player) {
CraftPlayer craftPlayer = (CraftPlayer) player.getHandle();
Container container = craftPlayer.getHandle().activeContainer;
int containerSlotsSize = 0;
if (is_1_12_2) {
containerSlotsSize = container.slots.size();
} else {
try {
Field slotsField = Container.class.getField("c");
List<Slot> slots = (List<Slot>) slotsField.get(container);
containerSlotsSize = slots.size();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
for (int slot = 0; slot < containerSlotsSize; slot++) {
ItemStack itemStack = container.getSlot(slot).getItem();
if (itemStack == null || !itemStack.hasTag()) {
continue;
}
NBTTagCompound nmsTag = itemStack.getTag();
INbtTagCompound tag = new NbtTagCompound(nmsTag);
String itemName = itemStack.getItem().getName();
if (nmsTag == null || itemName == null) {
continue;
}
FailedNbt failedNbt = NbtChecks.checkAll(tag, itemName, panilla);
if (FailedNbt.failsThreshold(failedNbt)) {
container.getSlot(slot).getItem().setTag(null);
} else if (FailedNbt.fails(failedNbt)) {
nmsTag.remove(failedNbt.key);
container.getSlot(slot).getItem().setTag(nmsTag);
}
}
}
Aggregations