Search in sources :

Example 41 with TranslatableText

use of net.minecraft.text.TranslatableText in project KahzerxMod by otakucraft.

the class NetworkHandlerMixin method onDisconnect.

@Inject(method = "disconnect", at = @At("HEAD"), cancellable = true)
private void onDisconnect(Text reason, CallbackInfo ci) {
    if (player instanceof KlonePlayerEntity) {
        ((KlonePlayerEntity) player).kill(new TranslatableText(((TranslatableText) reason).getKey()));
        ci.cancel();
    }
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) KlonePlayerEntity(com.kahzerx.kahzerxmod.klone.KlonePlayerEntity) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 42 with TranslatableText

use of net.minecraft.text.TranslatableText in project SeedcrackerX by 19MisterX98.

the class ConfigScreen method getConfigScreenByCloth.

public Screen getConfigScreenByCloth(Screen parent) {
    ConfigBuilder builder = ConfigBuilder.create().setParentScreen(parent).setTitle(new TranslatableText("title")).setDefaultBackgroundTexture(new Identifier("minecraft:textures/block/blackstone.png")).setTransparentBackground(true);
    ConfigEntryBuilder eb = builder.entryBuilder();
    // =============================CONFIG========================
    ConfigCategory settings = builder.getOrCreateCategory(new TranslatableText("settings"));
    settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.active"), config.active).setSaveConsumer(val -> config.active = val).build());
    settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.database"), config.databaseSubmits).setTooltip(new TranslatableText("settings.database.tooltip")).setSaveConsumer(val -> config.databaseSubmits = val).build());
    settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.hideNameDatabase"), config.anonymusSubmits).setSaveConsumer(val -> config.anonymusSubmits = val).build());
    settings.addEntry(eb.startDropdownMenu(new TranslatableText("settings.version"), DropdownMenuBuilder.TopCellElementBuilder.of(config.getVersion(), MCVersion::fromString)).setSelections(getSupportedVersions()).setSuggestionMode(false).setDefaultValue(config.getVersion()).setSaveConsumer(config::setVersion).build());
    settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
    settings.addEntry(eb.startTextDescription(new TranslatableText("settings.visuals")).build());
    settings.addEntry(eb.startEnumSelector(new TranslatableText("settings.outline"), Config.RenderType.class, config.render).setSaveConsumer(val -> config.render = val).build());
    settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
    settings.addEntry(eb.startTextDescription((new TranslatableText("settings.finderToggles"))).build());
    for (Finder.Type finder : Finder.Type.values()) {
        settings.addEntry(eb.startBooleanToggle(new TranslatableText(finder.nameKey), finder.enabled.get()).setSaveConsumer(val -> finder.enabled.set(val)).build());
    }
    settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
    settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.antiXrayMode"), config.antiXrayBypass).setSaveConsumer(val -> config.antiXrayBypass = val).build());
    settings.addEntry(eb.startTextDescription(new TranslatableText("settings.antiAntiXrayExplained")).build());
    // =============================INFO========================
    ConfigCategory info = builder.getOrCreateCategory(new TranslatableText("info"));
    // Clear data
    info.addEntry(eb.startBooleanToggle(new TranslatableText("info.clearData"), false).setSaveConsumer(val -> {
        if (val) {
            SeedCracker.get().reset();
        }
    }).build());
    // List worldseeds
    Set<Long> worldSeeds = SeedCracker.get().getDataStorage().getTimeMachine().worldSeeds;
    if (!worldSeeds.isEmpty()) {
        SubCategoryBuilder world = eb.startSubCategory(new TranslatableText("info.worldSeeds"));
        for (long worldSeed : worldSeeds) {
            world.add(eb.startTextField(new LiteralText(""), String.valueOf(worldSeed)).build());
        }
        info.addEntry(world.setExpanded(true).build());
    } else {
        info.addEntry(eb.startTextDescription(new TranslatableText("info.noWorldSeeds")).build());
    }
    // List structureseeds
    Set<Long> structureSeeds = SeedCracker.get().getDataStorage().getTimeMachine().structureSeeds;
    if (!structureSeeds.isEmpty()) {
        SubCategoryBuilder struc = eb.startSubCategory(new TranslatableText("info.structureSeeds"));
        for (long structureSeed : structureSeeds) {
            struc.add(eb.startTextField(new LiteralText(""), String.valueOf(structureSeed)).build());
        }
        info.addEntry(struc.setExpanded(true).build());
    } else {
        info.addEntry(eb.startTextDescription(new TranslatableText("info.noStructureSeeds")).build());
    }
    if (config.debug) {
        // List pillarseeds
        List<Integer> pillarSeeds = SeedCracker.get().getDataStorage().getTimeMachine().pillarSeeds;
        if (pillarSeeds != null) {
            SubCategoryBuilder pillar = eb.startSubCategory(new TranslatableText("info.pillarSeeds"));
            for (long structureSeed : pillarSeeds) {
                pillar.add(eb.startTextField(new LiteralText(""), String.valueOf(structureSeed)).build());
            }
            info.addEntry(pillar.setExpanded(true).build());
        } else {
            info.addEntry(eb.startTextDescription(new TranslatableText("info.noPillarSeeds")).build());
        }
        // Hashed seed
        HashedSeedData hashedSeed = SeedCracker.get().getDataStorage().hashedSeedData;
        if (hashedSeed != null) {
            info.addEntry(eb.startTextField(new TranslatableText("info.hashedSeed"), String.valueOf(hashedSeed.getHashedSeed())).build());
        } else {
            info.addEntry(eb.startTextDescription(new TranslatableText("info.noHashedSeed")).build());
        }
    }
    builder.setSavingRunnable(Config::save);
    return builder.build();
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) Finder(kaptainwutax.seedcrackerX.finder.Finder) HashedSeedData(kaptainwutax.seedcrackerX.cracker.HashedSeedData) SubCategoryBuilder(me.shedaniel.clothconfig2.impl.builders.SubCategoryBuilder) Identifier(net.minecraft.util.Identifier) ConfigCategory(me.shedaniel.clothconfig2.api.ConfigCategory) ConfigBuilder(me.shedaniel.clothconfig2.api.ConfigBuilder) ConfigEntryBuilder(me.shedaniel.clothconfig2.api.ConfigEntryBuilder) LiteralText(net.minecraft.text.LiteralText)

Example 43 with TranslatableText

use of net.minecraft.text.TranslatableText in project mineclub-expanded by Blobanium.

the class ClothConfigScreen method createConfig.

public static Screen createConfig(Screen parent) {
    final ConfigBuilder builder = ConfigBuilder.create().setParentScreen(parent).setTitle(new TranslatableText("mineclub-expanded.config"));
    // Serialise the config into the config file. This will be called last after all variables are updated.
    builder.setSavingRunnable(ConfigReader::onConfigSave);
    ConfigEntryBuilder entryBuilder = builder.entryBuilder();
    ConfigCategory general = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.main"));
    ConfigCategory presence = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.presence"));
    ConfigCategory outbid = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.outbid"));
    ConfigCategory autoreconnect = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.autoreconnect"));
    ConfigCategory serial = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.serial"));
    general.addEntry(entryBuilder.startBooleanToggle(DynamicModMenuTranslatable.getDiscordRPTranslatable(), ConfigReader.richPresence).setDefaultValue(false).setTooltip(DynamicModMenuTranslatable.getDiscordRPDescriptionTranslatable()).requireRestart().setSaveConsumer(newValue -> ConfigReader.richPresence = newValue).build());
    presence.addEntry(entryBuilder.startStringDropdownMenu(new TranslatableText("mineclub-expanded.config.presencedetail"), ConfigReader.rpCustomDetails).setDefaultValue("Compact").setSuggestionMode(false).setSelections(Lists.newArrayList("Compact", "ServerIP", "Username", "Mod Version")).setTooltip(new TranslatableText("mineclub-expanded.config.presencedetail.description")).setSaveConsumer(newValue -> ConfigReader.rpCustomDetails = newValue).build());
    presence.addEntry(entryBuilder.startTextDescription(new TranslatableText("mineclub-expanded.configtext.presence")).build());
    general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.outbidsound"), ConfigReader.outbidNotification).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.outbidsound.description")).setSaveConsumer(newValue -> ConfigReader.outbidNotification = newValue).build());
    outbid.addEntry(entryBuilder.startIntSlider(new TranslatableText("mineclub-expanded.config.outbidvolume"), ConfigReader.outbidVolume, 0, 200).setDefaultValue(100).setTooltip(new TranslatableText("mineclub-expanded.config.outbidvolume.description")).setSaveConsumer(newValue -> ConfigReader.outbidVolume = newValue).build());
    outbid.addEntry(entryBuilder.startTextDescription(new TranslatableText("mineclub-expanded.configtext.outbid")).build());
    general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.autogg"), ConfigReader.autogg).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.autogg.description")).setSaveConsumer(newValue -> ConfigReader.autogg = newValue).build());
    general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.autoreconnect"), ConfigReader.autoReconnect).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.autoreconnect.description")).setSaveConsumer(newValue -> ConfigReader.autoReconnect = newValue).build());
    autoreconnect.addEntry(entryBuilder.startIntSlider(new TranslatableText("mineclub-expanded.config.autoreconnectattempts"), ConfigReader.autoReconnectAttempts, 1, 20).setDefaultValue(3).setTooltip(new TranslatableText("mineclub-expanded.config.autoreconnectattempts.description")).setSaveConsumer(newValue -> ConfigReader.autoReconnectAttempts = newValue).build());
    autoreconnect.addEntry(entryBuilder.startIntSlider(new TranslatableText("mineclub-expanded.config.autoreconnectseconds"), ConfigReader.autoReconnectSeconds, 1, 60).setDefaultValue(5).setTooltip(new TranslatableText("mineclub-expanded.config.autoreconnectseconds.description")).setSaveConsumer(newValue -> ConfigReader.autoReconnectSeconds = newValue).build());
    autoreconnect.addEntry(entryBuilder.startTextDescription(new TranslatableText("mineclub-expanded.configtext.autoreconnect")).build());
    general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.expressconnect"), ConfigReader.expressConnect).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.expressconnect.description")).setSaveConsumer(newValue -> ConfigReader.expressConnect = newValue).build());
    general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.hideserialid"), ConfigReader.hideSerialID).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.hideserialid.description")).setSaveConsumer(newValue -> ConfigReader.hideSerialID = newValue).build());
    serial.addEntry(entryBuilder.startStringDropdownMenu(new TranslatableText("mineclub-expanded.config.serialcolor"), ConfigReader.serialColor).setDefaultValue("White").setSuggestionMode(false).setSelections(Lists.newArrayList("White", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow")).setTooltip(new TranslatableText("mineclub-expanded.config.serialcolor.description")).setSaveConsumer(newValue -> ConfigReader.serialColor = newValue).build());
    serial.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.showdigits"), ConfigReader.showDigits).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.showdigits.description")).setSaveConsumer(newValue -> ConfigReader.showDigits = newValue).build());
    if (MineclubExpanded.debugmode) {
        ConfigCategory debug = builder.getOrCreateCategory(new TranslatableText("mineclub-expanded.category.debug"));
        debug.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("mineclub-expanded.config.debug.asyncticks"), ConfigReader.debugAsyncTicks).setDefaultValue(false).setTooltip(new TranslatableText("mineclub-expanded.config.debug.asyncticks.description")).setSaveConsumer(newValue -> ConfigReader.debugAsyncTicks = newValue).build());
        debug.addEntry(entryBuilder.startIntSlider(new TranslatableText("mineclub-expanded.config.debug.asynctickthreads"), ConfigReader.debugAsyncTickThreads, 1, Runtime.getRuntime().availableProcessors()).setDefaultValue(2).setTooltip(new TranslatableText("mineclub-expanded.config.debug.asynctickthreads.description")).setSaveConsumer(newValue -> ConfigReader.debugAsyncTickThreads = newValue).build());
    }
    return builder.build();
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) ConfigCategory(me.shedaniel.clothconfig2.api.ConfigCategory) ConfigBuilder(me.shedaniel.clothconfig2.api.ConfigBuilder) ConfigEntryBuilder(me.shedaniel.clothconfig2.api.ConfigEntryBuilder)

Example 44 with TranslatableText

use of net.minecraft.text.TranslatableText in project MCDungeonsWeapons by chronosacaria.

the class McdwCrossbow method appendTooltip.

@Override
public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
    if (stack.getItem() == ItemRegistry.getItem("crossbow_auto_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.auto_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.auto_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.auto_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_azure_seeker")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.azure_seeker_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.azure_seeker_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.azure_seeker_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_baby_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.baby_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.baby_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.baby_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_burst_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.burst_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.burst_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.burst_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_butterfly_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.butterfly_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.butterfly_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.butterfly_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_corrupted_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.corrupted_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.corrupted_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.corrupted_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_cog_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.cog_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.cog_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.cog_crossbow_3").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.cog_crossbow_4").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_doom_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.doom_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.doom_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.doom_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_dual_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.dual_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.dual_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.dual_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_exploding_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.exploding_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.exploding_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.exploding_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_feral_soul_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.feral_soul_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.feral_soul_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.feral_soul_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_firebolt_thrower")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.firebolt_thrower_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.firebolt_thrower_2").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_harp_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harp_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harp_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harp_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_harpoon_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harpoon_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harpoon_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.harpoon_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_heavy_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.heavy_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.heavy_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.heavy_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_imploding_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.imploding_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.imploding_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.imploding_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_lightning_harp_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.lightning_harp_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.lightning_harp_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.lightning_harp_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_nautical_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.nautical_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.nautical_crossbow_2").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_pride_of_the_piglins")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.pride_of_the_piglins_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.pride_of_the_piglins_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.pride_of_the_piglins_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_rapid_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.rapid_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.rapid_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.rapid_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_scatter_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.scatter_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.scatter_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.scatter_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_slayer_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.slayer_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.slayer_crossbow_2").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_the_slicer")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.the_slicer_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.the_slicer_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.the_slicer_3").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.the_slicer_4").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.the_slicer_5").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_soul_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_soul_hunter_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_hunter_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_hunter_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.soul_hunter_crossbow_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_spellbound_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.spellbound_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.spellbound_crossbow_2").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("crossbow_voidcaller_crossbow")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.void_caller_crossbow_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.void_caller_crossbow_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.void_caller_crossbow_3").formatted(Formatting.ITALIC));
    }
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 45 with TranslatableText

use of net.minecraft.text.TranslatableText in project MCDungeonsWeapons by chronosacaria.

the class McdwSpear method appendTooltip.

@Override
public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
    if (stack.getItem() == ItemRegistry.getItem("spear_spear")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.spear_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.spear_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.spear_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("spear_fortune")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.fortune_spear_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.fortune_spear_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.fortune_spear_3").formatted(Formatting.ITALIC));
    } else if (stack.getItem() == ItemRegistry.getItem("spear_whispering_spear")) {
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.whispering_spear_1").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.whispering_spear_2").formatted(Formatting.ITALIC));
        tooltip.add(new TranslatableText("tooltip_info_item.mcdw.whispering_spear_3").formatted(Formatting.ITALIC));
    }
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Aggregations

TranslatableText (net.minecraft.text.TranslatableText)161 LiteralText (net.minecraft.text.LiteralText)30 Text (net.minecraft.text.Text)19 ItemStack (net.minecraft.item.ItemStack)16 ArrayList (java.util.ArrayList)15 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)14 List (java.util.List)12 MinecraftClient (net.minecraft.client.MinecraftClient)12 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)12 SPEInterface (eu.pb4.armorstandeditor.helpers.SPEInterface)9 LivingEntity (net.minecraft.entity.LivingEntity)9 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 ListTag (net.minecraft.nbt.ListTag)8 Formatting (net.minecraft.util.Formatting)8 BlockPos (net.minecraft.util.math.BlockPos)8 Environment (net.fabricmc.api.Environment)7 AbstractButtonWidget (net.minecraft.client.gui.widget.AbstractButtonWidget)7 Entity (net.minecraft.entity.Entity)7 Collection (java.util.Collection)6 ArmorStandPreset (eu.pb4.armorstandeditor.config.ArmorStandPreset)5