Skip to content

Commit

Permalink
Merge pull request #11 from connorhartley/api6
Browse files Browse the repository at this point in the history
Register data with newer methods
  • Loading branch information
gravityfox authored Jun 4, 2017
2 parents 3ca9523 + 5332ec2 commit 66e00d5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.config.ConfigDir;
import org.spongepowered.api.data.DataRegistration;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.EventManager;
import org.spongepowered.api.event.Listener;
Expand Down Expand Up @@ -153,7 +154,13 @@ public void registerListeners(GameInitializationEvent event) {
@Listener
public void registerData(GameInitializationEvent event) {
logger.info("Registering custom data manipulators");
game.getDataManager().register(WandData.class, ImmutableWandData.class, new WandDataBuilder());
DataRegistration.<WandData, ImmutableWandData>builder()
.dataClass(WandData.class)
.immutableClass(ImmutableWandData.class)
.builder(new WandDataBuilder())
.manipulatorId("wanddata")
.dataName("FoxCoreWandData")
.buildAndRegister(this.container);
}

@Listener
Expand Down

0 comments on commit 66e00d5

Please sign in to comment.