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);
}
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));
}
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);
}
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);
}
Aggregations