Search in sources :

Example 1 with DefaultBundledEmitterStorage

use of pl.asie.charset.lib.capability.DefaultBundledEmitterStorage in project Charset by CharsetMC.

the class Capabilities method init.

public static void init() {
    CapabilityManager.INSTANCE.register(IBundledEmitter.class, new DefaultBundledEmitterStorage(), DefaultBundledEmitter.class);
    CapabilityManager.INSTANCE.register(IRedstoneEmitter.class, new DefaultRedstoneEmitterStorage(), DefaultRedstoneEmitter.class);
    CapabilityManager.INSTANCE.register(IBundledReceiver.class, new Capability.IStorage<IBundledReceiver>() {

        @Override
        public NBTBase writeNBT(Capability<IBundledReceiver> capability, IBundledReceiver instance, EnumFacing side) {
            return null;
        }

        @Override
        public void readNBT(Capability<IBundledReceiver> capability, IBundledReceiver instance, EnumFacing side, NBTBase nbt) {
        }
    }, DummyRedstoneReceiver.class);
    CapabilityManager.INSTANCE.register(IRedstoneReceiver.class, new Capability.IStorage<IRedstoneReceiver>() {

        @Override
        public NBTBase writeNBT(Capability<IRedstoneReceiver> capability, IRedstoneReceiver instance, EnumFacing side) {
            return null;
        }

        @Override
        public void readNBT(Capability<IRedstoneReceiver> capability, IRedstoneReceiver instance, EnumFacing side, NBTBase nbt) {
        }
    }, DummyRedstoneReceiver.class);
    if (Loader.isModLoaded("mcmultipart")) {
        initMultiplePants();
    }
}
Also used : DefaultBundledEmitterStorage(pl.asie.charset.lib.capability.DefaultBundledEmitterStorage) Capability(net.minecraftforge.common.capabilities.Capability) NBTBase(net.minecraft.nbt.NBTBase) IBundledReceiver(pl.asie.charset.api.wires.IBundledReceiver) EnumFacing(net.minecraft.util.EnumFacing) IRedstoneReceiver(pl.asie.charset.api.wires.IRedstoneReceiver) DefaultRedstoneEmitterStorage(pl.asie.charset.lib.capability.DefaultRedstoneEmitterStorage)

Aggregations

NBTBase (net.minecraft.nbt.NBTBase)1 EnumFacing (net.minecraft.util.EnumFacing)1 Capability (net.minecraftforge.common.capabilities.Capability)1 IBundledReceiver (pl.asie.charset.api.wires.IBundledReceiver)1 IRedstoneReceiver (pl.asie.charset.api.wires.IRedstoneReceiver)1 DefaultBundledEmitterStorage (pl.asie.charset.lib.capability.DefaultBundledEmitterStorage)1 DefaultRedstoneEmitterStorage (pl.asie.charset.lib.capability.DefaultRedstoneEmitterStorage)1