forked from TAIGA/TAIGA
Created Trait SuperHeavy, rebalanced material stats for lore.
This commit is contained in:
@@ -51,7 +51,9 @@ public class MaterialTraits {
|
||||
public static final AbstractTrait ported = new TraitPorted();
|
||||
public static final AbstractTrait decay = new TraitDecay();
|
||||
public static final AbstractTrait whirl = new TraitWhirl();
|
||||
public static final AbstractTrait dev = new TraitDevelopement();
|
||||
public static final AbstractTrait superheavy = new TraitSuperHeavy();
|
||||
//public static final AbstractTrait dev = new TraitDevelopement();
|
||||
|
||||
|
||||
/**
|
||||
* Assign traits to related materials. <br>
|
||||
@@ -71,7 +73,7 @@ public class MaterialTraits {
|
||||
public static Material palladium = new Material("palladium", TextFormatting.GOLD).addTrait(dark).addTrait(cursed);
|
||||
public static Material uru = new Material("uru", TextFormatting.DARK_RED).addTrait(diffuse);
|
||||
public static Material basalt = new Material("basalt", TextFormatting.WHITE).addTrait(softy);
|
||||
public static Material eezo = new Material("eezo", TextFormatting.GOLD).addTrait(dissolving);
|
||||
public static Material eezo = new Material("eezo", TextFormatting.GOLD).addTrait(dissolving).addTrait(superheavy);
|
||||
public static Material triberium = new Material("triberium", TextFormatting.GREEN).addTrait(fragile);
|
||||
public static Material fractum = new Material("fractum", TextFormatting.DARK_RED).addTrait(fracture);
|
||||
public static Material violium = new Material("violium", TextFormatting.DARK_PURPLE).addTrait(arcane);
|
||||
@@ -79,12 +81,12 @@ public class MaterialTraits {
|
||||
public static Material tritonite = new Material("tritonite", TextFormatting.GOLD).addTrait(whirl);
|
||||
public static Material ignitz = new Material("ignitz", TextFormatting.RED).addTrait(melting).addTrait(garishly, MaterialTypes.HANDLE);
|
||||
public static Material imperomite = new Material("imperomite", TextFormatting.DARK_RED).addTrait(hollow);
|
||||
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(pulverizing);
|
||||
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(pulverizing).addTrait(superheavy);
|
||||
public static Material nihilite = new Material("nihilite", TextFormatting.BLACK).addTrait(souleater);
|
||||
/**
|
||||
* With Dev
|
||||
**/
|
||||
public static Material adamant = new Material("adamant", TextFormatting.GOLD).addTrait(dev);
|
||||
public static Material adamant = new Material("adamant", TextFormatting.GOLD); //.addTrait(dev);
|
||||
public static Material dyonite = new Material("dyonite", TextFormatting.GREEN).addTrait(tantrum);
|
||||
public static Material nucleum = new Material("nucleum", TextFormatting.YELLOW).addTrait(decay);
|
||||
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
|
||||
|
@@ -92,8 +92,8 @@ public class TAIGA {
|
||||
integrateMaterial("Vibranium", vibranium, vibraniumFluid, 1235, 7.62f, 8.1f, 1.3f, 100, 100, VIBRANIUM, 1.1f, 1.8f, 4);
|
||||
integrateMaterial("Karmesine", karmesine, terraxFluid, 444, 4.77f, 2.9f, 0.8f, 100, 50, COBALT, shitty, true, true);
|
||||
integrateMaterial("Palladium", palladium, palladiumFluid, 797, 4.35f, 6.8f, 1.3f, 130, -50, DURANITE, .5f, .2f, 3);
|
||||
integrateMaterial("Uru", uru, uruFluid, 877, 2f, 8.2f, 1.5f, -50, 175, VALYRIUM, 1.3f, 0.8f, 6);
|
||||
integrateMaterial("Eezo", eezo, eezoFluid, 50, 14f, 3.5f, .1f, 10, 10, COBALT, shitty, true, false);
|
||||
integrateMaterial("Uru", uru, uruFluid, 877, 2f, 7.2f, 1.5f, -50, 175, VALYRIUM, 1.3f, 0.8f, 6);
|
||||
integrateMaterial("Eezo", eezo, eezoFluid, 50, 23f, 3.5f, .1f, 10, 10, COBALT, shitty, true, false);
|
||||
integrateMaterial("Basalt", basalt, basaltFluid, 200, 3, 2.5f, 0.5f, -25, 25, STONE, shitty, true, false);
|
||||
integrateMaterial("Triberium", triberium, triberiumFluid, 223, 6.2f, 8.35f, 0.63f, 50, 50, DIAMOND, shitty, true, true);
|
||||
integrateMaterial("Fractum", fractum, fractumFluid, 538, 5.71f, 6.93f, 0.88f, 58, 117, DIAMOND, shitty);
|
||||
@@ -102,11 +102,11 @@ public class TAIGA {
|
||||
integrateMaterial("Tritonite", tritonite, tritoniteFluid, 780, 8f, 3.3f, 1.45f, -25, 150, COBALT, shitty);
|
||||
integrateMaterial("Ignitz", ignitz, ignitzFluid, 350, 2f, 6.66f, .85f, 150, 250, COBALT, .8f, .8f, 3);
|
||||
integrateMaterial("Imperomite", imperomite, imperomiteFluid, 1350, 4.65f, 5.9f, 1.15f, -100, 150, DURANITE, 1.2f, 1.8f, 2);
|
||||
integrateMaterial("Solarium", solarium, solariumFluid, 1100, 13.78f, 7f, 1.25f, 150, 150, VIBRANIUM, .8f, 1.5f, 5);
|
||||
integrateMaterial("Solarium", solarium, solariumFluid, 1100, 24f, 7f, 1.25f, 150, 150, VIBRANIUM, .8f, 1.5f, 5);
|
||||
integrateMaterial("Nihilite", nihilite, nihiliteFluid, 400, 2.8f, 4.50f, .77f, 350, 155, VALYRIUM, 1.5f, .8f, 3);
|
||||
integrateMaterial("Adamant", adamant, adamantFluid, 1750, 6f, 6f, 2f, 0, 0, VIBRANIUM, .35f, 1.85f, 8);
|
||||
integrateMaterial("Dyonite", dyonite, dyoniteFluid, 900, 6.45f, 5f, 0.66f, -50, 250, DURANITE, 2, .9f, -1);
|
||||
integrateMaterial("Nucleum", nucleum, nucleumFluid, 505, 15.5f, 9.5f, 1.05f, 100, 125, VALYRIUM, shitty);
|
||||
integrateMaterial("Nucleum", nucleum, nucleumFluid, 505, 17.5f, 9.5f, 1.05f, 100, 125, VALYRIUM, shitty);
|
||||
integrateMaterial("Lumix", lumix, lumixFluid, 666, 3.84f, 3.92f, 0.85f, 250, 200, COBALT, .8f, 1.3f, 1);
|
||||
integrateMaterial("Seismum", seismum, seismumFluid, 780, 3.66f, 6.05f, .95f, 250, 50, COBALT, shitty);
|
||||
integrateMaterial("Astrium", astrium, astriumFluid, 750, 8.35f, 5.4f, 0.95f, -100, 200, COBALT, .7f, .8f, 2);
|
||||
|
@@ -0,0 +1,80 @@
|
||||
package com.sosnitzka.taiga.traits;
|
||||
|
||||
import com.sosnitzka.taiga.util.Utils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
|
||||
public class TraitSuperHeavy extends TraitProgressiveStats {
|
||||
|
||||
protected static int TICK_PER_STAT = 50;
|
||||
protected static float blockcount = 250f;
|
||||
|
||||
public TraitSuperHeavy() {
|
||||
super(TraitSuperHeavy.class.getSimpleName().toLowerCase().substring(5), TextFormatting.DARK_GRAY);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void miningSpeed(ItemStack tool, PlayerInteractEvent.BreakSpeed event) {
|
||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||
if (data.brokenblocks == 0) return;
|
||||
event.setNewSpeed(Math.max(event.getNewSpeed() - data.brokenblocks * event.getOriginalSpeed() / blockcount, 0.25f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||
data.brokenblocks += 1;
|
||||
data.write(tag);
|
||||
TagUtil.setExtraTag(tool, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
// every 3.6 seconds we distribute one stat. This means 1h = 1000 applications
|
||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// we don't update if the player is currently breaking a block because that'd reset it
|
||||
if (playerIsBreakingBlock(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||
if (data.brokenblocks > 0)
|
||||
data.brokenblocks -= 1;
|
||||
data.write(tag);
|
||||
TagUtil.setExtraTag(tool, tag);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemTooltip(ItemTooltipEvent e) {
|
||||
ItemStack tool = e.getItemStack();
|
||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||
e.getToolTip().add(TextFormatting.RED + "Broken Blocks: " + TextFormatting.WHITE + data.brokenblocks);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -123,6 +123,8 @@ public class Utils {
|
||||
public int curse;
|
||||
public String name;
|
||||
public float radius;
|
||||
public float dfloat;
|
||||
public int dint;
|
||||
|
||||
public static GeneralNBTData read(NBTTagCompound tag) {
|
||||
GeneralNBTData data = new GeneralNBTData();
|
||||
@@ -133,6 +135,8 @@ public class Utils {
|
||||
data.curse = tag.getInteger("curse");
|
||||
data.name = tag.getString("name");
|
||||
data.radius = tag.getFloat("radius");
|
||||
data.dfloat = tag.getFloat("dfloat");
|
||||
data.dint = tag.getInteger("dint");
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -144,6 +148,8 @@ public class Utils {
|
||||
tag.setInteger("curse", curse);
|
||||
tag.setString("name", name);
|
||||
tag.setFloat("radius", radius);
|
||||
tag.setInteger("dint", dint);
|
||||
tag.setFloat("dfloat", dfloat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user