This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Something is being dumb, - 7.0.0 start of update
- Loading branch information
1 parent
3002348
commit 44ce5fe
Showing
3 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 40 additions & 1 deletion
41
src/main/java/com/denizenscript/denizen2sponge/utilities/flags/FlagHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
package com.denizenscript.denizen2sponge.utilities.flags;import com.google.common.reflect.TypeToken;import org.spongepowered.api.Sponge;import org.spongepowered.api.data.DataQuery;import org.spongepowered.api.data.key.Key;import org.spongepowered.api.data.key.KeyFactory;import org.spongepowered.api.data.value.mutable.Value;public class FlagHelper { public static final TypeToken<FlagMap> FLAGMAP_TOKEN = new TypeToken<FlagMap>() { }; public static final TypeToken<Value<FlagMap>> FLAGMAP_VALUE_TOKEN = new TypeToken<Value<FlagMap>>() { }; public static Key<Value<FlagMap>> FLAGMAP = KeyFactory.makeSingleKey( FLAGMAP_TOKEN, FLAGMAP_VALUE_TOKEN, DataQuery.of("denizen:flagmap"), "denizen:flagmap", "denizen:flagmap" ); public static FlagMapDataBuilder FMDB; public static void register() { FMDB = new FlagMapDataBuilder(FlagMapData.class, 1); Sponge.getDataManager().register(FlagMapDataImpl.class, ImmFlagMapDataImpl.class, FMDB); }} | ||
package com.denizenscript.denizen2sponge.utilities.flags; | ||
|
||
import com.denizenscript.denizen2sponge.Denizen2Sponge; | ||
import com.google.common.reflect.TypeToken; | ||
import org.spongepowered.api.Sponge; | ||
import org.spongepowered.api.data.DataQuery; | ||
import org.spongepowered.api.data.DataRegistration; | ||
import org.spongepowered.api.data.key.Key; | ||
import org.spongepowered.api.data.key.KeyFactory; | ||
import org.spongepowered.api.data.value.mutable.Value; | ||
|
||
public class FlagHelper { | ||
|
||
public static final TypeToken<FlagMap> FLAGMAP_TOKEN = new TypeToken<FlagMap>() { | ||
}; | ||
|
||
public static final TypeToken<Value<FlagMap>> FLAGMAP_VALUE_TOKEN = new TypeToken<Value<FlagMap>>() { | ||
}; | ||
|
||
public static Key<Value<FlagMap>> FLAGMAP = KeyFactory.makeSingleKey( | ||
FLAGMAP_TOKEN, | ||
FLAGMAP_VALUE_TOKEN, | ||
DataQuery.of("flagmap"), | ||
"denizen2sponge:flagmap", | ||
"DenizenFlagMap" | ||
); | ||
|
||
public static FlagMapDataBuilder FMDB; | ||
|
||
public static void register() { | ||
FMDB = new FlagMapDataBuilder(FlagMapData.class, 1); | ||
DataRegistration.<FlagMapData, ImmutableFlagMapData>builder() | ||
.dataClass(FlagMapData.class) | ||
.immutableClass(ImmutableFlagMapData.class) | ||
.builder(FMDB) | ||
.manipulatorId("flagmap") | ||
.dataName("flagmap") | ||
.buildAndRegister(Denizen2Sponge.plugin); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters