diff --git a/src/main/java/de/ellpeck/naturesaura/NaturesAura.java b/src/main/java/de/ellpeck/naturesaura/NaturesAura.java index d63497e3..447d539f 100644 --- a/src/main/java/de/ellpeck/naturesaura/NaturesAura.java +++ b/src/main/java/de/ellpeck/naturesaura/NaturesAura.java @@ -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(); diff --git a/src/main/java/de/ellpeck/naturesaura/aura/Capabilities.java b/src/main/java/de/ellpeck/naturesaura/aura/Capabilities.java index c7c2ff42..928c2b49 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/Capabilities.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/Capabilities.java @@ -22,43 +22,16 @@ public final class Capabilities { @CapabilityInject(AuraChunk.class) public static Capability auraChunk; - public static class CapabilityAuraContainer implements IStorage { - - @Override - public NBTBase writeNBT(Capability capability, IAuraContainer instance, EnumFacing side) { - return null; - } - - @Override - public void readNBT(Capability capability, IAuraContainer instance, EnumFacing side, NBTBase nbt) { - - } - } - - public static class CapabilityAuraRecharge implements IStorage { + public static class StorageImpl implements IStorage { @Nullable @Override - public NBTBase writeNBT(Capability capability, IAuraRecharge instance, EnumFacing side) { + public NBTBase writeNBT(Capability capability, T instance, EnumFacing side) { return null; } @Override - public void readNBT(Capability capability, IAuraRecharge instance, EnumFacing side, NBTBase nbt) { - - } - } - - public static class CapabilityAuraChunk implements IStorage { - - @Nullable - @Override - public NBTBase writeNBT(Capability capability, AuraChunk instance, EnumFacing side) { - return null; - } - - @Override - public void readNBT(Capability capability, AuraChunk instance, EnumFacing side, NBTBase nbt) { + public void readNBT(Capability capability, T instance, EnumFacing side, NBTBase nbt) { } }