Implemented transfering between two Solarpanels

This commit is contained in:
2026-02-07 01:58:54 +01:00
parent 486254b6dd
commit 75900d50f9
7 changed files with 58 additions and 30 deletions

View File

@@ -6,9 +6,9 @@ import com.hypixel.hytale.server.core.plugin.JavaPlugin;
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
import org.KaiFlo.SolarCell.Commands.ExampleCommand;
import org.KaiFlo.SolarCell.Components.EnergySource.Implementations.SolarCellComponent;
import org.KaiFlo.SolarCell.Systems.EnergySource.SolarCellInitializer;
import org.KaiFlo.SolarCell.Systems.EnergySource.SolarCellTickingSystem;
import org.KaiFlo.SolarCell.Components.EnergySource.Implementations.EnergySourceComponent;
import org.KaiFlo.SolarCell.Systems.EnergySource.EnergySourceInitializerSystem;
import org.KaiFlo.SolarCell.Systems.EnergySource.EnergyProducerTickingSystem;
import javax.annotation.Nonnull;
@@ -22,7 +22,7 @@ public class SolarCellPlugin extends JavaPlugin {
private static final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
private ComponentType<ChunkStore, SolarCellComponent> solarCellComponentType;
private ComponentType<ChunkStore, EnergySourceComponent> solarCellComponentType;
public SolarCellPlugin(@Nonnull JavaPluginInit init) {
super(init);
@@ -34,16 +34,16 @@ public class SolarCellPlugin extends JavaPlugin {
instance = this;
LOGGER.atInfo().log("Setting up plugin " + this.getName());
solarCellComponentType = this.getChunkStoreRegistry().registerComponent(SolarCellComponent.class, "SolarCell", SolarCellComponent.CODEC);
solarCellComponentType = this.getChunkStoreRegistry().registerComponent(EnergySourceComponent.class, "SolarCell", EnergySourceComponent.CODEC);
this.getCommandRegistry().registerCommand(new ExampleCommand(this.getName(), this.getManifest().getVersion().toString()));
this.getChunkStoreRegistry().registerSystem(new SolarCellInitializer());
this.getChunkStoreRegistry().registerSystem(new SolarCellTickingSystem());
this.getChunkStoreRegistry().registerSystem(new EnergySourceInitializerSystem());
this.getChunkStoreRegistry().registerSystem(new EnergyProducerTickingSystem());
}
public ComponentType<ChunkStore, SolarCellComponent> getSolarCellComponentType() {
public ComponentType<ChunkStore, EnergySourceComponent> getSolarCellComponentType() {
return solarCellComponentType;
}
}