Search in sources :

Example 21 with LocalizationHelper

use of net.silentchaos512.lib.util.LocalizationHelper in project SilentGems by SilentChaos512.

the class BlockGemLamp method getWitLines.

@Override
public List<String> getWitLines(IBlockState state, BlockPos pos, EntityPlayer player, boolean advanced) {
    LocalizationHelper loc = SilentGems.instance.localizationHelper;
    String line = inverted ? loc.getBlockSubText(Names.GEM_LAMP, "inverted") : "";
    line += lit ? (line.isEmpty() ? "" : ", ") + loc.getBlockSubText(Names.GEM_LAMP, "lit") : "";
    return line.isEmpty() ? null : Lists.newArrayList(line);
}
Also used : LocalizationHelper(net.silentchaos512.lib.util.LocalizationHelper)

Example 22 with LocalizationHelper

use of net.silentchaos512.lib.util.LocalizationHelper in project SilentGems by SilentChaos512.

the class ItemBlockPlacer method clAddInformation.

@Override
public void clAddInformation(ItemStack stack, World world, List list, boolean advanced) {
    String blockPlacer = "BlockPlacer";
    LocalizationHelper loc = SilentGems.localizationHelper;
    boolean autoFillOn = getAutoFillMode(stack);
    int currentBlocks = getRemainingBlocks(stack);
    int maxBlocks = getMaxBlocksStored(stack);
    list.add(loc.getItemSubText(blockPlacer, "count", currentBlocks, maxBlocks));
    String onOrOff = loc.getMiscText("state." + (autoFillOn ? "on" : "off"));
    list.add(loc.getItemSubText(blockPlacer, "autoFill", onOrOff));
}
Also used : LocalizationHelper(net.silentchaos512.lib.util.LocalizationHelper)

Example 23 with LocalizationHelper

use of net.silentchaos512.lib.util.LocalizationHelper in project SilentGems by SilentChaos512.

the class ItemBlockPlacer method clOnItemRightClick.

@Override
protected ActionResult<ItemStack> clOnItemRightClick(World world, EntityPlayer player, EnumHand hand) {
    ItemStack stack = player.getHeldItem(hand);
    if (!player.world.isRemote && player.isSneaking()) {
        // Toggle auto-fill mode.
        boolean mode = !getAutoFillMode(stack);
        setAutoFillMode(stack, mode);
        LocalizationHelper loc = SilentGems.localizationHelper;
        String onOrOff = loc.getMiscText("state." + (mode ? "on" : "off"));
        onOrOff = (mode ? TextFormatting.GREEN : TextFormatting.RED) + onOrOff;
        String line = loc.getItemSubText("BlockPlacer", "autoFill", onOrOff);
        ChatHelper.sendStatusMessage(player, line, true);
    }
    return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
}
Also used : ActionResult(net.minecraft.util.ActionResult) EnumActionResult(net.minecraft.util.EnumActionResult) ItemStack(net.minecraft.item.ItemStack) LocalizationHelper(net.silentchaos512.lib.util.LocalizationHelper)

Example 24 with LocalizationHelper

use of net.silentchaos512.lib.util.LocalizationHelper in project SilentGems by SilentChaos512.

the class SilentGems method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    localizationHelper = new LocalizationHelper(MODID).setReplaceAmpersand(true);
    SilentLib.instance.registerLocalizationHelperForMod(MODID, localizationHelper);
    CommonItemStats.init();
    ToolHelper.init();
    GemsConfig.INSTANCE.init(event.getSuggestedConfigurationFile());
    registry.addRegistrationHandler(new ModEnchantments(), Enchantment.class);
    registry.addRegistrationHandler(new ModBlocks(), Block.class);
    registry.addRegistrationHandler(new ModItems(), Item.class);
    registry.addRegistrationHandler(new ModPotions(), Potion.class);
    registry.addRegistrationHandler(new ModRecipes(), IRecipe.class);
    ModParts.init();
    SoulSkill.init();
    GemsConfig.INSTANCE.loadModuleConfigs();
    // TODO: Achievements
    // World generation
    GameRegistry.registerWorldGenerator(new GemsWorldGenerator(), 0);
    GameRegistry.registerWorldGenerator(new GemsGeodeWorldGenerator(), -10);
    // Headcrumbs
    FMLInterModComms.sendMessage("headcrumbs", "add-username", Names.SILENT_CHAOS_512);
    // Load TCon compatibility stuff?
    if (Loader.isModLoaded("tconstruct")) {
        TConstructGemsCompat.preInit();
    }
    VeinMinerCompat.init();
    proxy.preInit(registry);
}
Also used : GemsGeodeWorldGenerator(net.silentchaos512.gems.world.GemsGeodeWorldGenerator) ModItems(net.silentchaos512.gems.init.ModItems) ModBlocks(net.silentchaos512.gems.init.ModBlocks) ModRecipes(net.silentchaos512.gems.init.ModRecipes) ModPotions(net.silentchaos512.gems.init.ModPotions) GemsWorldGenerator(net.silentchaos512.gems.world.GemsWorldGenerator) ModEnchantments(net.silentchaos512.gems.init.ModEnchantments) LocalizationHelper(net.silentchaos512.lib.util.LocalizationHelper) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Aggregations

LocalizationHelper (net.silentchaos512.lib.util.LocalizationHelper)24 ItemStack (net.minecraft.item.ItemStack)6 DimensionalPosition (net.silentchaos512.lib.util.DimensionalPosition)4 TextFormatting (net.minecraft.util.text.TextFormatting)3 ToolPart (net.silentchaos512.gems.api.tool.part.ToolPart)3 UUID (java.util.UUID)2 ActionResult (net.minecraft.util.ActionResult)2 EnumActionResult (net.minecraft.util.EnumActionResult)2 BlockPos (net.minecraft.util.math.BlockPos)2 TextComponentString (net.minecraft.util.text.TextComponentString)2 EnumMaterialGrade (net.silentchaos512.gems.api.lib.EnumMaterialGrade)2 ToolPartTip (net.silentchaos512.gems.api.tool.part.ToolPartTip)2 ChaosBuff (net.silentchaos512.gems.lib.ChaosBuff)2 ToolSoul (net.silentchaos512.gems.lib.soul.ToolSoul)2 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 Minecraft (net.minecraft.client.Minecraft)1 FontRenderer (net.minecraft.client.gui.FontRenderer)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1