[1.7.10] Some refactoring (#102)

* Some refactoring

* Some refactoring
Added some localization

* Added some localization
Fix wrong branch localization in page branch overview
Simplify some localization

* Simplify some localization

* Removed unused localize method

* Simplify some localization

* Removed proxy.localise method

* Simplify localization
This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-06-06 21:43:47 -07:00
1 parent 81301c3bd2
commit 1ffaad9fcd
232 files changed
+1947 -2054

No files matched your search

@@ -271,6 +271,8 @@ public enum ExtraBeeBranchDefinition implements IBranchDefinition {
}
};
private static IAllele[] defaultTemplate;
private final IClassification branch;
ExtraBeeBranchDefinition(String scientific) {
@@ -297,8 +299,6 @@ public enum ExtraBeeBranchDefinition implements IBranchDefinition {
return branch;
}
private static IAllele[] defaultTemplate;
private static IAllele[] getDefaultTemplate() {
if (defaultTemplate == null) {
defaultTemplate = new IAllele[EnumBeeChromosome.values().length];
@@ -1,7 +1,7 @@
package binnie.extrabees.genetics;
import binnie.core.Mods;
import binnie.extrabees.ExtraBees;
import binnie.core.util.I18N;
import forestry.api.apiculture.FlowerManager;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
@@ -71,7 +71,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
@Override
public String getDescription() {
return ExtraBees.proxy.localise("flowers." + name().toString().toLowerCase() + ".name");
return I18N.localise("extrabees.flowers." + name().toString().toLowerCase() + ".name");
}
public void register() {
@@ -124,7 +124,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
}
public boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z) {
public boolean isAcceptedFlower(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
if (block == null) {
return false;
@@ -13,8 +13,8 @@ public class EntityBeeLightning extends EntityLightningBolt {
int lightningState;
int boltLivingTime;
public EntityBeeLightning(World par1World, double par2, double par4, double par6) {
super(par1World, par2, par4, par6);
public EntityBeeLightning(World world, double x, double y, double z) {
super(world, x, y, z);
lightningState = 2;
boltLivingTime = rand.nextInt(3) + 1;
}
@@ -1,6 +1,7 @@
package binnie.extrabees.genetics.effect;
import binnie.Binnie;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.genetics.ExtraBeesFlowers;
import cofh.api.energy.IEnergyReceiver;
@@ -67,7 +68,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
protected static List<Birthday> birthdays;
static {
(ExtraBeesEffect.birthdays = new ArrayList<>()).add(new Birthday(3, 10, "Binnie"));
birthdays = new ArrayList<>();
birthdays.add(new Birthday(3, 10, "Binnie"));
}
public boolean combinable;
@@ -152,7 +154,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
@Override
public String getName() {
return ExtraBees.proxy.localise("effect." + name().toString().toLowerCase() + ".name");
return I18N.localise("extrabees.effect." + name().toLowerCase() + ".name");
}
@Override
@@ -161,33 +163,35 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
public void spawnMob(World world, int x, int y, int z, String name) {
if (anyPlayerInRange(world, x, y, z, 16)) {
double xOffset = x + world.rand.nextFloat();
double yOffset = y + world.rand.nextFloat();
double zOffset = z + world.rand.nextFloat();
world.spawnParticle("smoke", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
world.spawnParticle("flame", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
EntityLiving entity = (EntityLiving) EntityList.createEntityByName(name, world);
if (!anyPlayerInRange(world, x, y, z, 16)) {
return;
}
if (entity == null) {
return;
}
double xOffset = x + world.rand.nextFloat();
double yOffset = y + world.rand.nextFloat();
double zOffset = z + world.rand.nextFloat();
world.spawnParticle("smoke", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
world.spawnParticle("flame", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
EntityLiving entity = (EntityLiving) EntityList.createEntityByName(name, world);
int entityCount = world.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
if (entityCount >= 6) {
return;
}
if (entity == null) {
return;
}
xOffset = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
yOffset = y + world.rand.nextInt(3) - 1;
zOffset = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
entity.setLocationAndAngles(xOffset, yOffset, zOffset, world.rand.nextFloat() * 360.0f, 0.0f);
int entityCount = world.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
if (entityCount >= 6) {
return;
}
if (entity.getCanSpawnHere()) {
world.spawnEntityInWorld(entity);
world.playAuxSFX(2004, x, y, z, 0);
entity.spawnExplosionParticle();
}
xOffset = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
yOffset = y + world.rand.nextInt(3) - 1;
zOffset = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
entity.setLocationAndAngles(xOffset, yOffset, zOffset, world.rand.nextFloat() * 360.0f, 0.0f);
if (entity.getCanSpawnHere()) {
world.spawnEntityInWorld(entity);
world.playAuxSFX(2004, x, y, z, 0);
entity.spawnExplosionParticle();
}
}
@@ -521,7 +525,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
return;
}
if (ExtraBeesFlowers.SAPLING.isAcceptedFlower(world, null, x, y, z)) {
if (ExtraBeesFlowers.SAPLING.isAcceptedFlower(world, x, y, z)) {
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x, y, z, null);
}
}
@@ -531,7 +535,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
return;
}
if (ExtraBeesFlowers.FRUIT.isAcceptedFlower(world, null, x, y, z)) {
if (ExtraBeesFlowers.FRUIT.isAcceptedFlower(world, x, y, z)) {
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x, y, z, null);
}
}
@@ -29,10 +29,6 @@ public class FireworkCreator {
shape = 0;
}
public void setFlicker() {
flicker = true;
}
public void setTrail() {
trail = true;
}
@@ -45,7 +41,7 @@ public class FireworkCreator {
colors.add(color);
}
NBTTagCompound getNBT() {
public NBTTagCompound getNBT() {
NBTTagCompound nbt = new NBTTagCompound();
if (flicker) {
nbt.setBoolean("Flicker", true);
@@ -1,5 +1,6 @@
package binnie.extrabees.genetics.items;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.core.ExtraBeeGUID;
import cpw.mods.fml.relauncher.Side;
@@ -42,7 +43,7 @@ public class ItemDictionary extends Item {
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);
if (stack.getItemDamage() > 0) {
tooltip.add("Flora-in-a-box");
tooltip.add(I18N.localise("extrabees.item.database.tooltip"));
}
}
@@ -65,8 +66,8 @@ public class ItemDictionary extends Item {
@Override
public String getItemStackDisplayName(ItemStack stack) {
return (stack.getItemDamage() == 0) ?
"Apiarist Database" :
"Master Apiarist Database";
return (stack.getItemDamage() == 0)
? I18N.localise("extrabees.item.database")
: I18N.localise("extrabees.item.masterDatabase");
}
}
@@ -1,6 +1,5 @@
package binnie.extrabees.genetics.requirements;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome;
import forestry.api.genetics.IMutationCondition;
@@ -14,7 +13,7 @@ public class DummyMutationCondition implements IMutationCondition {
}
@Override
public float getChance(World world, int i, int i1, int i2, IAllele iAllele, IAllele iAllele1, IGenome iGenome, IGenome iGenome1) {
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
return 1.0F;
}
@@ -1,5 +1,6 @@
package binnie.extrabees.genetics.requirements;
import binnie.core.util.I18N;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome;
@@ -13,7 +14,7 @@ public class RequirementPerson implements IMutationRequirement {
@Override
public String getDescription() {
return "Can only be bred by " + name;
return I18N.localise("extrabees.genetics.requirements.user", name);
}
@Override