this is entirely unnecessary, forge

This commit is contained in:
Ellpeck 2018-11-03 23:08:02 +01:00
parent 5642585b84
commit 713d8c45f0
2 changed files with 7 additions and 36 deletions

View file

@ -1,8 +1,6 @@
package de.ellpeck.naturesaura;
import de.ellpeck.naturesaura.aura.Capabilities.CapabilityAuraChunk;
import de.ellpeck.naturesaura.aura.Capabilities.CapabilityAuraContainer;
import de.ellpeck.naturesaura.aura.Capabilities.CapabilityAuraRecharge;
import de.ellpeck.naturesaura.aura.Capabilities.StorageImpl;
import de.ellpeck.naturesaura.aura.chunk.AuraChunk;
import de.ellpeck.naturesaura.aura.container.IAuraContainer;
import de.ellpeck.naturesaura.aura.item.IAuraRecharge;
@ -55,9 +53,9 @@ public final class NaturesAura {
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
CapabilityManager.INSTANCE.register(IAuraContainer.class, new CapabilityAuraContainer(), () -> null);
CapabilityManager.INSTANCE.register(IAuraRecharge.class, new CapabilityAuraRecharge(), () -> null);
CapabilityManager.INSTANCE.register(AuraChunk.class, new CapabilityAuraChunk(), () -> null);
CapabilityManager.INSTANCE.register(IAuraContainer.class, new StorageImpl<>(), () -> null);
CapabilityManager.INSTANCE.register(IAuraRecharge.class, new StorageImpl<>(), () -> null);
CapabilityManager.INSTANCE.register(AuraChunk.class, new StorageImpl<>(), () -> null);
new ModBlocks();
new ModItems();

View file

@ -22,43 +22,16 @@ public final class Capabilities {
@CapabilityInject(AuraChunk.class)
public static Capability<AuraChunk> auraChunk;
public static class CapabilityAuraContainer implements IStorage<IAuraContainer> {
@Override
public NBTBase writeNBT(Capability<IAuraContainer> capability, IAuraContainer instance, EnumFacing side) {
return null;
}
@Override
public void readNBT(Capability<IAuraContainer> capability, IAuraContainer instance, EnumFacing side, NBTBase nbt) {
}
}
public static class CapabilityAuraRecharge implements IStorage<IAuraRecharge> {
public static class StorageImpl<T> implements IStorage<T> {
@Nullable
@Override
public NBTBase writeNBT(Capability<IAuraRecharge> capability, IAuraRecharge instance, EnumFacing side) {
public NBTBase writeNBT(Capability<T> capability, T instance, EnumFacing side) {
return null;
}
@Override
public void readNBT(Capability<IAuraRecharge> capability, IAuraRecharge instance, EnumFacing side, NBTBase nbt) {
}
}
public static class CapabilityAuraChunk implements IStorage<AuraChunk> {
@Nullable
@Override
public NBTBase writeNBT(Capability<AuraChunk> capability, AuraChunk instance, EnumFacing side) {
return null;
}
@Override
public void readNBT(Capability<AuraChunk> capability, AuraChunk instance, EnumFacing side, NBTBase nbt) {
public void readNBT(Capability<T> capability, T instance, EnumFacing side, NBTBase nbt) {
}
}