use of org.spongepowered.common.interfaces.item.IMixinItem in project SpongeCommon by SpongePowered.
the class MixinItemStack method getContainers.
@Override
public Collection<DataManipulator<?, ?>> getContainers() {
final List<DataManipulator<?, ?>> manipulators = Lists.newArrayList();
final Item item = this.shadow$getItem();
// Null items should be impossible to create
if (item == null) {
final PrettyPrinter printer = new PrettyPrinter(60);
printer.add("Null Item found!").centre().hr();
printer.add("An ItemStack has a null ItemType! This is usually not supported as it will likely have issues elsewhere.");
printer.add("Please ask help for seeing if this is an issue with a mod and report it!");
printer.add("Printing a Stacktrace:");
printer.add(new Exception());
printer.log(SpongeImpl.getLogger(), Level.WARN);
return manipulators;
}
((IMixinItem) item).getManipulatorsFor((net.minecraft.item.ItemStack) (Object) this, manipulators);
if (hasManipulators()) {
final List<DataManipulator<?, ?>> customManipulators = this.getCustomManipulators();
manipulators.addAll(customManipulators);
}
return manipulators;
}
Aggregations