Search in sources :

Example 1 with HomeBuilder

use of org.spongepowered.test.myhomes.data.home.impl.HomeBuilder in project SpongeCommon by SpongePowered.

the class MyHomes method onDataRegistration.

@Listener
public void onDataRegistration(GameRegistryEvent.Register<DataRegistration<?, ?>> event) {
    this.logger.info("onDataRegistration");
    final DataManager dataManager = Sponge.getDataManager();
    // Home stuff
    dataManager.registerBuilder(Home.class, new HomeBuilder());
    dataManager.registerContentUpdater(Home.class, new HomeBuilder.NameUpdater());
    dataManager.registerContentUpdater(HomeData.class, new HomeDataBuilder.HomesUpdater());
    this.homeDataRegistration = DataRegistration.builder().dataClass(HomeData.class).immutableClass(ImmutableHomeData.class).dataImplementation(HomeDataImpl.class).immutableImplementation(ImmutableHomeDataImpl.class).builder(new HomeDataBuilder()).dataName("Home Data").manipulatorId("home").buildAndRegister(this.container);
    // Friends stuff
    this.friendsDataRegistration = DataRegistration.builder().dataClass(FriendsData.class).immutableClass(ImmutableFriendsData.class).dataImplementation(FriendsDataImpl.class).immutableImplementation(ImmutableFriendsDataImpl.class).builder(new FriendsDataBuilder()).dataName("Friends Data").manipulatorId("friends").buildAndRegister(this.container);
}
Also used : ImmutableFriendsData(org.spongepowered.test.myhomes.data.friends.ImmutableFriendsData) ImmutableFriendsDataImpl(org.spongepowered.test.myhomes.data.friends.impl.ImmutableFriendsDataImpl) ImmutableHomeDataImpl(org.spongepowered.test.myhomes.data.home.impl.ImmutableHomeDataImpl) HomeDataBuilder(org.spongepowered.test.myhomes.data.home.impl.HomeDataBuilder) FriendsDataBuilder(org.spongepowered.test.myhomes.data.friends.impl.FriendsDataBuilder) ImmutableHomeData(org.spongepowered.test.myhomes.data.home.ImmutableHomeData) DataManager(org.spongepowered.api.data.DataManager) HomeBuilder(org.spongepowered.test.myhomes.data.home.impl.HomeBuilder) Listener(org.spongepowered.api.event.Listener)

Aggregations

DataManager (org.spongepowered.api.data.DataManager)1 Listener (org.spongepowered.api.event.Listener)1 ImmutableFriendsData (org.spongepowered.test.myhomes.data.friends.ImmutableFriendsData)1 FriendsDataBuilder (org.spongepowered.test.myhomes.data.friends.impl.FriendsDataBuilder)1 ImmutableFriendsDataImpl (org.spongepowered.test.myhomes.data.friends.impl.ImmutableFriendsDataImpl)1 ImmutableHomeData (org.spongepowered.test.myhomes.data.home.ImmutableHomeData)1 HomeBuilder (org.spongepowered.test.myhomes.data.home.impl.HomeBuilder)1 HomeDataBuilder (org.spongepowered.test.myhomes.data.home.impl.HomeDataBuilder)1 ImmutableHomeDataImpl (org.spongepowered.test.myhomes.data.home.impl.ImmutableHomeDataImpl)1