made naming of Unstable/Instable trait consistent

added translating options for harvest levels

Signed-off-by: Giovanni Harting <539@idlegandalf.com>
This commit is contained in:
2018-06-28 17:01:42 +02:00
parent 05ebd28180
commit 2227b0017e
10 changed files with 29 additions and 28 deletions

View File

@@ -19,7 +19,7 @@ public class MaterialTraits {
public static final int VIBRANIUM = 7;
// Init of new traits
public static final AbstractTrait instable = new TraitInstable();
public static final AbstractTrait instable = new TraitUnstable();
public static final AbstractTrait naturebound = new TraitNatureBound();
public static final AbstractTrait softy = new TraitSofty();
public static final AbstractTrait curvature = new TraitCurvature();

View File

@@ -5,6 +5,7 @@ import com.sosnitzka.taiga.proxy.CommonProxy;
import com.sosnitzka.taiga.recipes.CraftingRegistry;
import com.sosnitzka.taiga.recipes.SmeltingRegistry;
import com.sosnitzka.taiga.world.WorldGen;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
@@ -65,9 +66,9 @@ public class TAIGA {
// GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times
// Adds new harvest levels' names
harvestLevelNames.put(DURANITE, TextFormatting.DARK_GREEN + "Duranite");
harvestLevelNames.put(VALYRIUM, TextFormatting.GOLD + "Valyrium");
harvestLevelNames.put(VIBRANIUM, TextFormatting.DARK_PURPLE + "Vibranium");
harvestLevelNames.put(DURANITE, I18n.format("harvestlevel.duranite", TextFormatting.GREEN, TextFormatting.RESET));
harvestLevelNames.put(VALYRIUM, I18n.format("harvestlevel.valyrium", TextFormatting.GOLD, TextFormatting.RESET));
harvestLevelNames.put(VIBRANIUM, I18n.format("harvestlevel.vibranium", TextFormatting.DARK_PURPLE, TextFormatting.RESET));
Blocks.register(true);

View File

@@ -24,8 +24,8 @@ public class TraitDiffuse extends AbstractTrait {
@SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) {
EntityPlayer player = event.getPlayer();
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand())
, this.identifier)) {
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()),
this.identifier)) {
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
}
}

View File

@@ -20,16 +20,15 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
import slimeknights.tconstruct.library.utils.ToolHelper;
public class TraitInstable extends AbstractTrait {
public class TraitUnstable extends AbstractTrait {
public TraitInstable() {
super("instable", TextFormatting.DARK_RED);
public TraitUnstable() {
super("unstable", TextFormatting.DARK_RED);
MinecraftForge.EVENT_BUS.register(this);
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
if (random.nextFloat() <= 0.03) {
if (!world.isRemote) {
if (random.nextBoolean()) {
@@ -41,8 +40,7 @@ public class TraitInstable extends AbstractTrait {
}
@Override
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
wasCritical, boolean wasHit) {
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
BlockPos pos = target.getPosition();
if (random.nextFloat() <= 0.04) {
if (!player.getEntityWorld().isRemote) {
@@ -59,8 +57,7 @@ public class TraitInstable extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
.getHeldItemMainhand()), identifier)) {
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
.getEntity().posZ, i));

View File

@@ -12,9 +12,8 @@ import java.util.function.Predicate;
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
private final IBlockState oreBlock;
/**
* The number of com.sosnitzka.taiga.blocks to generate.
*/
// The number of com.sosnitzka.taiga.blocks to generate.
private final int numberOfBlocks;
private final Predicate<IBlockState> predicate;