Search in sources :

Example 1 with MultiSlotItemHandler

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());
}
Also used : WitnessModule(com.almuradev.core.event.WitnessModule) ContentModule(com.almuradev.content.ContentModule) ISingleSlotItemHandler(com.almuradev.almura.shared.capability.ISingleSlotItemHandler) CommandInstaller(com.almuradev.almura.shared.command.binder.CommandInstaller) ServerConfiguration(com.almuradev.almura.core.server.ServerConfiguration) MultiSlotItemHandler(com.almuradev.almura.shared.capability.impl.MultiSlotItemHandler) IMultiSlotItemHandler(com.almuradev.almura.shared.capability.IMultiSlotItemHandler) FeatureModule(com.almuradev.almura.feature.FeatureModule) NetworkModule(com.almuradev.almura.shared.network.NetworkModule) Plugin(com.almuradev.almura.shared.plugin.Plugin)

Example 2 with MultiSlotItemHandler

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;
}
Also used : MultiSlotItemHandler(com.almuradev.almura.shared.capability.impl.MultiSlotItemHandler) IMultiSlotItemHandler(com.almuradev.almura.shared.capability.IMultiSlotItemHandler) MultiSlotTileEntity(com.almuradev.almura.shared.tileentity.MultiSlotTileEntity) IMultiSlotItemHandler(com.almuradev.almura.shared.capability.IMultiSlotItemHandler) Nullable(javax.annotation.Nullable)

Aggregations

IMultiSlotItemHandler (com.almuradev.almura.shared.capability.IMultiSlotItemHandler)2 MultiSlotItemHandler (com.almuradev.almura.shared.capability.impl.MultiSlotItemHandler)2 ServerConfiguration (com.almuradev.almura.core.server.ServerConfiguration)1 FeatureModule (com.almuradev.almura.feature.FeatureModule)1 ISingleSlotItemHandler (com.almuradev.almura.shared.capability.ISingleSlotItemHandler)1 CommandInstaller (com.almuradev.almura.shared.command.binder.CommandInstaller)1 NetworkModule (com.almuradev.almura.shared.network.NetworkModule)1 Plugin (com.almuradev.almura.shared.plugin.Plugin)1 MultiSlotTileEntity (com.almuradev.almura.shared.tileentity.MultiSlotTileEntity)1 ContentModule (com.almuradev.content.ContentModule)1 WitnessModule (com.almuradev.core.event.WitnessModule)1 Nullable (javax.annotation.Nullable)1