use of de.budschie.bmorph.capabilities.blacklist.BlacklistData in project BudschieMorphMod by Budschie.
the class BlacklistCommand method listBlacklist.
private static int listBlacklist(CommandContext<CommandSource> ctx) {
BlacklistData blacklist = ConfigManager.INSTANCE.get(BlacklistData.class);
String conc = String.join(", ", blacklist.getBlacklist().stream().map(rs -> rs.toString()).toArray(size -> new String[size]));
StringBuilder builder = new StringBuilder();
builder.append(TextFormatting.GREEN);
boolean isSingular = blacklist.getBlacklist().size() == 1;
builder.append("There ").append(isSingular ? "is" : "are").append(" currently ").append(blacklist.getBlacklist().size()).append(isSingular ? " entry" : " entries").append(" in the blacklist: ").append(conc);
ctx.getSource().sendFeedback(new StringTextComponent(builder.toString()), false);
return 0;
}
use of de.budschie.bmorph.capabilities.blacklist.BlacklistData in project BudschieMorphMod by Budschie.
the class BMorphMod method onCommonSetup.
@SubscribeEvent
public static void onCommonSetup(final FMLCommonSetupEvent event) {
ShrinkAPIInteractor.init();
MorphCapabilityAttacher.register();
PufferfishCapabilityAttacher.register();
GuardianBeamCapabilityAttacher.register();
ConfigManager.INSTANCE.register(BlacklistData.class, BlacklistData::new);
System.out.println("Registered capabilities.");
KEEP_MORPH_INVENTORY = GameRules.register("keepMorphInventory", Category.PLAYER, BooleanValue.create(true));
PREVENT_LOOKAT = GameRules.register("preventLookat", Category.PLAYER, BooleanValue.create(false));
DO_MORPH_DROPS = GameRules.register("doMorphDrops", Category.DROPS, BooleanValue.create(true));
MORPH_AGGRO_DURATION = GameRules.register("morphAggroDuration", Category.PLAYER, IntegerValue.create(200));
MainNetworkChannel.registerMainNetworkChannels();
MorphHandler.addMorphItem("player_morph_item", () -> new PlayerMorphItem());
MorphHandler.addMorphItem("fallback_morph_item", () -> new FallbackMorphItem());
MorphManagerHandlers.registerDefaultManagers();
// VanillaFallbackMorphData.intialiseFallbackData();
// APIInteractor.executeLoadClassIf(() -> ModList.get().isLoaded("betteranimalsplus"), "de.budschie.bmorph.morph.BetterAnimalsPlusFallbackMorphData");
EntitySynchronizerRegistry.addEntitySynchronizer(new LivingEntitySynchronzier());
EntitySynchronizerRegistry.addEntitySynchronizer(new ParrotSynchronizer());
EntitySynchronizerRegistry.addEntitySynchronizer(new SquidSynchronizer());
EntitySynchronizerRegistry.addEntitySynchronizer(new AbstractPlayerSynchronizer());
EntitySynchronizerRegistry.addEntitySynchronizer(new PufferfishSynchronizer());
DYNAMIC_ABILITY_REGISTRY = new DynamicAbilityRegistry();
}
use of de.budschie.bmorph.capabilities.blacklist.BlacklistData in project BudschieMorphMod by Budschie.
the class BlacklistCommand method removeBlacklist.
private static int removeBlacklist(CommandContext<CommandSource> ctx) {
ResourceLocation arg = ctx.getArgument("entity", ResourceLocation.class);
BlacklistData blacklist = ConfigManager.INSTANCE.get(BlacklistData.class);
if (blacklist.isInBlacklist(arg)) {
blacklist.removeBlacklist(arg);
ctx.getSource().sendFeedback(new StringTextComponent(TextFormatting.GREEN + "Successfully removed " + arg.toString() + " from the entity blacklist."), false);
blacklist.writeToFile();
} else {
ctx.getSource().sendErrorMessage(new StringTextComponent("Failed to remove entry " + arg.toString() + " from the entity blacklist because that entry doesn't exist yet."));
}
return 0;
}
use of de.budschie.bmorph.capabilities.blacklist.BlacklistData in project BudschieMorphMod by Budschie.
the class BlacklistCommand method addBlacklist.
private static int addBlacklist(CommandContext<CommandSource> ctx) {
BlacklistData blacklist = ConfigManager.INSTANCE.get(BlacklistData.class);
ResourceLocation arg = ctx.getArgument("entity", ResourceLocation.class);
if (blacklist.isInBlacklist(arg)) {
ctx.getSource().sendErrorMessage(new StringTextComponent("Failed to add entry " + arg.toString() + " to the entity blacklist because that entry already exists."));
} else {
blacklist.addBlacklist(arg);
ctx.getSource().sendFeedback(new StringTextComponent(TextFormatting.GREEN + "Successfully added " + arg.toString() + " to the blacklist!"), true);
blacklist.writeToFile();
}
return 0;
}
Aggregations