use of com.almuradev.almura.shared.capability.impl.MultiSlotItemHandler in project Almura by AlmuraDev.
the class CommonModule method configure.
@Override
protected void configure() {
this.bind(Plugin.class).toInstance(this.plugin);
this.capability().register(ISingleSlotItemHandler.class, new SingleSlotItemHandler.Storage(), SingleSlotItemHandler::new).register(IMultiSlotItemHandler.class, new MultiSlotItemHandler.Storage(), MultiSlotItemHandler::new);
this.bind(Path.class).annotatedWith(Names.named("assets")).toInstance(Paths.get("assets"));
this.facet().add(RegistryInstaller.class).add(CommandInstaller.class).add(CapabilityInstaller.class);
this.registry().module(BossBarColorRegistryModule.class);
this.install(new NetworkModule());
this.install(new WitnessModule());
this.install(new ContentModule());
this.install(new FeatureModule());
this.facet().add(ContentLoader.class);
this.install(new ServerConfiguration.Module());
}
use of com.almuradev.almura.shared.capability.impl.MultiSlotItemHandler in project Almura by AlmuraDev.
the class StorageBlock method createNewTileEntity.
@Nullable
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
final MultiSlotTileEntity mte = new MultiSlotTileEntity();
final IMultiSlotItemHandler itemHandler = (MultiSlotItemHandler) mte.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (this.slotAmount > itemHandler.getSlots()) {
itemHandler.resize(this.slotAmount);
}
return mte;
}
Aggregations