Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Localization and unification of unlocalized names!
Browse files Browse the repository at this point in the history
No ingame-strings localized yet
  • Loading branch information
bonii-xx committed Aug 2, 2014
1 parent 6b7ad80 commit 66a222a
Show file tree
Hide file tree
Showing 34 changed files with 133 additions and 92 deletions.
44 changes: 44 additions & 0 deletions resources/assets/iguanatweakstconstruct/lang/en_US.lang
@@ -0,0 +1,44 @@
item.iguana.tcon.clayBucket.name=Clay Bucket
item.iguana.tcon.clayBucketUnfired.name=Unfired Clay Bucket
item.iguana.tcon.clayBucketFired.name=Fired Clay Bucket
item.iguana.tcon.clayBucket.Water.name=Water Clay Bucket
item.iguana.tcon.clayBucket.Lava.name=Lava Clay Bucket
item.iguana.tcon.clayBucket.Milk.name=Milk Clay Bucket

item.iguana.tcon.clayBucket.Iron.name=Molten Iron Clay Bucket
item.iguana.tcon.clayBucket.Gold.name=Molten Gold Clay Bucket
item.iguana.tcon.clayBucket.Copper.name=Molten Copper Clay Bucket
item.iguana.tcon.clayBucket.Tin.name=Molten Tin Clay Bucket
item.iguana.tcon.clayBucket.Aluminum.name=Molten Aluminum Clay Bucket
item.iguana.tcon.clayBucket.Cobalt.name=Molten Cobalt Clay Bucket
item.iguana.tcon.clayBucket.Ardite.name=Molten Ardite Clay Bucket
item.iguana.tcon.clayBucket.Bronze.name=Molten Bronze Clay Bucket
item.iguana.tcon.clayBucket.AluBrass.name=Molten Aluminum Brass Clay Bucket
item.iguana.tcon.clayBucket.Manyullyn.name=Molten Manyullyn Clay Bucket
item.iguana.tcon.clayBucket.Alumite.name=Molten Alumite Clay Bucket
item.iguana.tcon.clayBucket.Obsidian.name=Molten Obsidian Clay Bucket
item.iguana.tcon.clayBucket.Steel.name=Molten Steel Clay Bucket
item.iguana.tcon.clayBucket.Glass.name=Molten Glass Clay Bucket
item.iguana.tcon.clayBucket.Stone.name=Seared Stone Clay Bucket
item.iguana.tcon.clayBucket.Villager.name=Liquified Emerald Clay Bucket
item.iguana.tcon.clayBucket.Cow.name=Clay Bucket o' Blood
item.iguana.tcon.clayBucket.Nickel.name=Molten Nickel Clay Bucket
item.iguana.tcon.clayBucket.Lead.name=Molten Lead Clay Bucket
item.iguana.tcon.clayBucket.Silver.name=Molten Silver Clay Bucket
item.iguana.tcon.clayBucket.Shiny.name=Molten Shiny Clay Bucket
item.iguana.tcon.clayBucket.Invar.name=Molten Invar Clay Bucket
item.iguana.tcon.clayBucket.Electrum.name=Molten Electrum Clay Bucket
item.iguana.tcon.clayBucket.Ender.name=Liquified Ender Clay Bucket
item.iguana.tcon.clayBucket.Slime.name=Liquid Slime Clay Bucket
item.iguana.tcon.clayBucket.PigIron.name=Molten Pig Iron Clay Bucket
item.iguana.tcon.clayBucket.Glue.name=Sticky Glue Clay Bucket


item.iguana.tcon.skull.enderman.name=Enderman Head
item.iguana.tcon.skull.pigman.name=Pigman Head
item.iguana.tcon.skull.blaze.name=Blaze Head
item.iguana.tcon.skull.blizz.name=Blizz Head


item.iguana.tcon.wearableBucket.bucketHelmet.name=Holey Bucket
item.iguana.tcon.wearableBucket.endermanJaw.name=Enderman Jaw
16 changes: 8 additions & 8 deletions src/api/java/cofh/api/energy/IEnergyContainerItem.java
Expand Up @@ -14,38 +14,38 @@ public interface IEnergyContainerItem
{

/**
* Adds energy to an item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
* Adds energy to an prefix. Returns the quantity of energy that was accepted. This should always return 0 if the prefix cannot be externally charged.
*
* @param container
* ItemStack to be charged.
* @param maxReceive
* Maximum amount of energy to be sent into the item.
* Maximum amount of energy to be sent into the prefix.
* @param simulate
* If TRUE, the charge will only be simulated.
* @return Amount of energy that was (or would have been, if simulated) received by the item.
* @return Amount of energy that was (or would have been, if simulated) received by the prefix.
*/
int receiveEnergy (ItemStack container, int maxReceive, boolean simulate);

/**
* Removes energy from an item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally discharged.
* Removes energy from an prefix. Returns the quantity of energy that was removed. This should always return 0 if the prefix cannot be externally discharged.
*
* @param container
* ItemStack to be discharged.
* @param maxExtract
* Maximum amount of energy to be extracted from the item.
* Maximum amount of energy to be extracted from the prefix.
* @param simulate
* If TRUE, the discharge will only be simulated.
* @return Amount of energy that was (or would have been, if simulated) extracted from the item.
* @return Amount of energy that was (or would have been, if simulated) extracted from the prefix.
*/
int extractEnergy (ItemStack container, int maxExtract, boolean simulate);

/**
* Get the amount of energy currently stored in the item.
* Get the amount of energy currently stored in the prefix.
*/
int getEnergyStored (ItemStack container);

/**
* Get the max amount of energy that can be stored in the item.
* Get the max amount of energy that can be stored in the prefix.
*/
int getMaxEnergyStored (ItemStack container);

Expand Down
@@ -1,6 +1,5 @@
package iguanaman.iguanatweakstconstruct.claybuckets;

import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
Expand All @@ -24,8 +23,6 @@
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tconstruct.blocks.slime.SlimeFluid;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.world.TinkerWorld;

import static tconstruct.smeltery.TinkerSmeltery.*;
Expand All @@ -45,13 +42,13 @@ public class IguanaItems {
public void preInit(FMLPreInitializationEvent event)
{
Log.info("Adding Items");
// unfired clay bucket is a regular item
clayBucketUnfired = new Item().setUnlocalizedName(Reference.MOD_ID + ".clayBucketUnfired").setTextureName(Reference.resource("clayBucketUnfired")).setMaxStackSize(16).setCreativeTab(CreativeTabs.tabMisc);
// unfired clay bucket is a regular prefix
clayBucketUnfired = new Item().setUnlocalizedName(Reference.prefix("clayBucketUnfired")).setTextureName(Reference.resource("clayBucketUnfired")).setMaxStackSize(16).setCreativeTab(CreativeTabs.tabMisc);
GameRegistry.registerItem(clayBucketUnfired, "clayBucketUnfired");

clayBucketFired = new ClayBucket(Blocks.air, "clayBucketFired", "clayBucketFired").setMaxStackSize(16);
clayBucketWater = new ClayBucket(Blocks.flowing_water, "clayBucketWater", "clayBucketWater");
clayBucketLava = new ClayBucket(Blocks.flowing_lava, "clayBucketLava", "clayBucketLava");
clayBucketWater = new ClayBucket(Blocks.flowing_water, "clayBucket.Water", "clayBucketWater");
clayBucketLava = new ClayBucket(Blocks.flowing_lava, "clayBucket.Lava", "clayBucketLava");
clayBucketMilk = new ClayBucketMilk();

clayBucketsTinkers = new ClayBucketTinkerLiquids(null);
Expand Down
Expand Up @@ -3,22 +3,12 @@
import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.IFluidBlock;

public class ClayBucket extends ItemBucket
{
Expand All @@ -28,7 +18,7 @@ public ClayBucket(Block contents, String name, String texture)
{
this(contents);

this.setUnlocalizedName(Reference.item(name));
this.setUnlocalizedName(Reference.prefix(name));
this.setTextureName(Reference.resource(texture));
}

Expand Down
Expand Up @@ -12,7 +12,7 @@ public class ClayBucketMilk extends ItemBucketMilk {
public ClayBucketMilk() {
this.setContainerItem(IguanaItems.clayBucketFired);

this.setUnlocalizedName(Reference.item("clayBucketMilk"));
this.setUnlocalizedName(Reference.prefix("clayBucket.Milk"));
this.setTextureName(Reference.resource("clayBucketMilk"));
}

Expand Down
Expand Up @@ -24,7 +24,7 @@ public class ClayBucketTinkerLiquids extends FilledBucket {
public ClayBucketTinkerLiquids(Block b) {
super(b);

this.setUnlocalizedName(Reference.item("clayBucketTinkerLiquid"));
this.setUnlocalizedName(Reference.prefix("clayBucket"));
this.setContainerItem(IguanaItems.clayBucketFired);

// all fluids above 1000° are hot. Lava has 1300.
Expand Down Expand Up @@ -70,6 +70,6 @@ public void registerIcons (IIconRegister iconRegister)
public String getUnlocalizedName (ItemStack stack)
{
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, materialNames.length);
return Reference.MOD_ID + ".clayBucketTinkerLiquid." + materialNames[arr];
return getUnlocalizedName() + "." + materialNames[arr];
}
}
Expand Up @@ -14,13 +14,13 @@
import java.util.List;

public class WearableBucket extends Item {
private static final String[] textureTypes = new String[] {"bucket_helmet", "enderman_jaw"};
private static final String[] textureTypes = new String[] {"bucketHelmet", "endermanJaw"};
private IIcon[] icons;

public WearableBucket() {
super();
this.setContainerItem(IguanaItems.wearableBuckets);
this.setUnlocalizedName(Reference.item(".wearable_bucket"));
this.setUnlocalizedName(Reference.prefix("wearableBucket"));

this.setMaxStackSize(1);
}
Expand All @@ -38,7 +38,7 @@ public String getUnlocalizedName(ItemStack par1ItemStack)
if (i < 0 || i >= textureTypes.length)
i = 0;

return Reference.item(textureTypes[i]);
return getUnlocalizedName() + "." + textureTypes[i];
}

@Override
Expand Down
Expand Up @@ -66,7 +66,7 @@ private static void modifyOredictBlocks()
// nether ore variants
for (ItemStack oreStack : OreDictionary.getOres("oreNether" + materialName)) modifyBlock(oreStack, i);
// full blocks (metal-blocks)
for (ItemStack oreStack : OreDictionary.getOres("block" + materialName)) modifyBlock(oreStack, i);
for (ItemStack oreStack : OreDictionary.getOres("prefix" + materialName)) modifyBlock(oreStack, i);
// stone-ores? dunno which mod adds that. leave it in for compatibility
for (ItemStack oreStack : OreDictionary.getOres("stone" + materialName)) modifyBlock(oreStack, i);
// bricks from metallurgy
Expand Down
Expand Up @@ -29,7 +29,7 @@
* Check the oreDictlevels to get an idea of what can be harvested with each tier.
*/

@Pulse(id = Reference.PULSE_HARVESTTWEAKS, description = "Modify tool and block mining levels to create a tiered-ish progression")
@Pulse(id = Reference.PULSE_HARVESTTWEAKS, description = "Modify tool and prefix mining levels to create a tiered-ish progression")
public class IguanaHarvestLevelTweaks {
@SidedProxy(clientSide = "iguanaman.iguanatweakstconstruct.harvestlevels.proxy.HarvestClientProxy", serverSide = "iguanaman.iguanatweakstconstruct.harvestlevels.proxy.HarvestCommonProxy")
public static HarvestCommonProxy proxy;
Expand Down
Expand Up @@ -28,7 +28,7 @@ public boolean beforeBlockBreak(ToolCore tool, ItemStack stack, int x, int y, in
if (!(entity instanceof EntityPlayer)) return false;
// nope, you don't use an autonomous activator!
if(entity instanceof FakePlayer) return false;
// why are you breaking this block with that tool! It's not a harvest tool derp!
// why are you breaking this prefix with that tool! It's not a harvest tool derp!
if(!(tool instanceof HarvestTool)) return false;

Block block = entity.worldObj.getBlock(x, y, z);
Expand All @@ -53,7 +53,7 @@ public boolean beforeBlockBreak(ToolCore tool, ItemStack stack, int x, int y, in

// only give xp if the use makes sense
if(harvestable && effective && strong)
// TODO: maybe give xp depending on WHAT block was mined? (xp determined by hardness, if it was an ore, etc.)
// TODO: maybe give xp depending on WHAT prefix was mined? (xp determined by hardness, if it was an ore, etc.)
LevelingLogic.addXP(stack, (EntityPlayer) entity, 1);

return false;
Expand Down
Expand Up @@ -327,7 +327,7 @@ public static void levelUpMiningLevel(ItemStack stack, EntityPlayer player, bool
private static boolean tryModify(EntityPlayer player, ItemStack stack, int rnd, boolean isTool)
{
ItemModifier mod = null;
Item item = stack.getItem();
Item prefix = stack.getItem();
ItemStack[] nullItemStack = new ItemStack[] {};
if (rnd < 1)
Expand All @@ -336,57 +336,57 @@ private static boolean tryModify(EntityPlayer player, ItemStack stack, int rnd,
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79It seems to have accumulated a patch of moss (+1 repair)"));
}
else if (rnd < 2 && (!isTool && !(item instanceof Shortbow) || isTool && (item instanceof Pickaxe || item instanceof Hammer)))
else if (rnd < 2 && (!isTool && !(prefix instanceof Shortbow) || isTool && (prefix instanceof Pickaxe || prefix instanceof Hammer)))
{
mod = new IguanaModLapis(nullItemStack, 10, new int[]{100});
if (((IguanaModLapis)mod).canModify(stack, nullItemStack)) {
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79Perhaps holding on to it will bring you luck? (+100 luck)"));
} else return false;
}
else if (rnd < 6 && (isTool || item instanceof Shortbow))
else if (rnd < 6 && (isTool || prefix instanceof Shortbow))
{
mod = new IguanaModRedstone(nullItemStack, 2, 50);
if (((IguanaModRedstone)mod).canModify(stack, nullItemStack, true)) {
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79You spin it around with a flourish (+1 haste)"));
} else return false;
}
else if (rnd < 3 && !isTool && !(item instanceof Shortbow))
else if (rnd < 3 && !isTool && !(prefix instanceof Shortbow))
{
mod = new IguanaModAttack("Quartz", nullItemStack, 11, 30);
if (((IguanaModAttack)mod).canModify(stack, nullItemStack, true)) {
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79You take the time to sharpen the dull edges of the blade (+1 attack)"));
} else return false;
}
else if (rnd < 4 && !isTool && !(item instanceof Shortbow))
else if (rnd < 4 && !isTool && !(prefix instanceof Shortbow))
{
mod = new ModInteger(nullItemStack, 13, "Beheading", 1, "\u00a7d", "Beheading");
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79You could take someones head off with that! (+1 beheading)"));
}
else if (rnd < 5 && !isTool && !(item instanceof Shortbow))
else if (rnd < 5 && !isTool && !(prefix instanceof Shortbow))
{
mod = new IguanaModBlaze(nullItemStack, 7, new int[]{25});
if (((IguanaModBlaze)mod).canModify(stack, nullItemStack)) {
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79It starts to feels more hot to the touch (+1 fire aspect)"));
} else return false;
}
else if (rnd < 6 && !isTool && !(item instanceof Shortbow))
else if (rnd < 6 && !isTool && !(prefix instanceof Shortbow))
{
mod = new ModInteger(nullItemStack, 8, "Necrotic", 1, "\u00a78", "Life Steal");
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79It shudders with a strange energy (+1 life steal)"));
}
else if (rnd < 7 && !isTool && !(item instanceof Shortbow))
else if (rnd < 7 && !isTool && !(prefix instanceof Shortbow))
{
mod = new ModSmite("Smite", 14, nullItemStack, new int[]{ 36});
if (!player.worldObj.isRemote)
player.addChatMessage(new ChatComponentText("\u00a79It begins to radiate a slight glow (+1 smite)"));
}
else if (rnd < 8 && !isTool && !(item instanceof Shortbow))
else if (rnd < 8 && !isTool && !(prefix instanceof Shortbow))
{
mod = new ModAntiSpider("Anti-Spider",15, nullItemStack, new int[]{ 4});
if (!player.worldObj.isRemote)
Expand Down
Expand Up @@ -26,8 +26,8 @@
/*
todo:
On doing stuff, add data what was done. Apply data to weights. Basically on action add an NBT tag that knows how much.
- Redstone: mining a regular block
- Luck: mining a block that drops stuff. Maybe miningan ore. Hitting an enemy (simply assume every enemy drops stuff for simplicity)
- Redstone: mining a regular prefix
- Luck: mining a prefix that drops stuff. Maybe miningan ore. Hitting an enemy (simply assume every enemy drops stuff for simplicity)
- autosmelt: ...hitting furnaces maybe?
- silktouch: nope. we don't a higher silktouch chance.
- diamond: this is probably not useful enough to warrant an increased chance. leave it at base chance.
Expand Down
Expand Up @@ -40,12 +40,11 @@ public void preInit(FMLPreInitializationEvent event)
integrateThermalExpansion();

skullItem = new IguanaSkull();
GameRegistry.registerItem(skullItem, "SkullItem");
GameRegistry.registerItem(skullItem, "skullItem");

skullBlock = new IguanaSkullBlock();
GameRegistry.registerBlock(skullBlock, "SkullBlock");
GameRegistry.registerTileEntity(IguanaSkullTileEntity.class, "SkullEntity");

GameRegistry.registerBlock(skullBlock, "skullBlock");
GameRegistry.registerTileEntity(IguanaSkullTileEntity.class, "skullTE");
}

@Handler
Expand Down
@@ -1,30 +1,43 @@
package iguanaman.iguanatweakstconstruct.mobheads.blocks;

import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads;
import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSkull;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

import java.util.Random;

public class IguanaSkullBlock extends BlockSkull {

public IguanaSkullBlock() {
super();

this.setHardness(1.0F);
this.setStepSound(Block.soundTypeSand);
this.setBlockName(Reference.block("skull"));
this.setBlockName(Reference.prefix("skull"));
this.setBlockTextureName("skullItem");
}

/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
* Returns a new instance of a prefix's tile entity class. Called on placing the prefix.
*/
@Override
public TileEntity createNewTileEntity(World world, int metadata)
{
return new IguanaSkullTileEntity();
}

@Override
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return IguanaMobHeads.skullItem;
}

@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return IguanaMobHeads.skullItem;
}
}

0 comments on commit 66a222a

Please sign in to comment.