use of fr.neatmonster.nocheatplus.worlds.WorldFactoryArgument in project NoCheatPlus by NoCheatPlus.
the class NetStatic method registerTypes.
@SuppressWarnings("unchecked")
public static void registerTypes() {
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
api.register(api.newRegistrationContext().registerConfigWorld(NetConfig.class).factory(new IFactoryOne<WorldFactoryArgument, NetConfig>() {
@Override
public NetConfig getNewInstance(WorldFactoryArgument arg) {
return new NetConfig(arg.worldData);
}
}).registerConfigTypesPlayer().context().registerDataPlayer(NetData.class).factory(new IFactoryOne<PlayerFactoryArgument, NetData>() {
@Override
public NetData getNewInstance(PlayerFactoryArgument arg) {
return new NetData(arg.playerData.getGenericInstance(NetConfig.class));
}
}).addToGroups(CheckType.NET, true, IData.class, ICheckData.class).context());
}
Aggregations