forked from TAIGA/TAIGA
general code cleanup
try and add changes generation back into gradle again
This commit is contained in:
10
build.gradle
10
build.gradle
@@ -47,10 +47,14 @@ task buildInfo {
|
|||||||
ext.buildNum = System.getenv().BUILD_NUMBER
|
ext.buildNum = System.getenv().BUILD_NUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.getenv().TAIGA_CHANGES != null) {
|
|
||||||
ext.changes = System.getenv().TAIGA_CHANGES
|
def cmd = "git log \$(git tag --sort=-refname | sed -n '2p')..\$(git tag --sort=-refname | sed -n '1p') --oneline"
|
||||||
|
def proc = cmd.execute()
|
||||||
|
proc.waitFor()
|
||||||
|
if (proc.exitValue() == 0) {
|
||||||
|
ext.changes = proc.text.trim()
|
||||||
} else {
|
} else {
|
||||||
ext.changes = ""
|
ext.changes = "N/A"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,5 +58,4 @@ public class BlockTiberium extends BasicBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -36,5 +36,4 @@ public class BasicBlock extends Block {
|
|||||||
public String getOreDictPrefix() {
|
public String getOreDictPrefix() {
|
||||||
return this.oreDictPrefix;
|
return this.oreDictPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,5 @@ public class Crafting {
|
|||||||
GameRegistry.addShapelessRecipe(new ItemStack(nitro_brick), fuel_brick, Items.GUNPOWDER, Items.BLAZE_POWDER);
|
GameRegistry.addShapelessRecipe(new ItemStack(nitro_brick), fuel_brick, Items.GUNPOWDER, Items.BLAZE_POWDER);
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(anthracite_dust), matNecroticBone, Items.COAL, Items.GUNPOWDER);
|
GameRegistry.addShapelessRecipe(new ItemStack(anthracite_dust), matNecroticBone, Items.COAL, Items.GUNPOWDER);
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(spectrum_dust), matNecroticBone, glimmerstone_dust);
|
GameRegistry.addShapelessRecipe(new ItemStack(spectrum_dust), matNecroticBone, glimmerstone_dust);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,5 @@ public class Smelting {
|
|||||||
GameRegistry.addSmelting(vibraniumOre, new ItemStack(vibraniumIngot), RandomUtils.nextFloat(0F, 2F));
|
GameRegistry.addSmelting(vibraniumOre, new ItemStack(vibraniumIngot), RandomUtils.nextFloat(0F, 2F));
|
||||||
GameRegistry.addSmelting(rubiumOre, new ItemStack(rubiumIngot), RandomUtils.nextFloat(0F, 2F));
|
GameRegistry.addSmelting(rubiumOre, new ItemStack(rubiumIngot), RandomUtils.nextFloat(0F, 2F));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ public class TraitAnalysing extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getUpdateXP(int xp) {
|
private int getUpdateXP(int xp) {
|
||||||
float exp = (float) random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + 18) * 50;
|
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + 18) * 50;
|
||||||
return Math.round(exp);
|
return Math.round(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,5 +62,4 @@ public class TraitAnalysing extends AbstractTrait {
|
|||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,8 @@ import net.minecraft.world.World;
|
|||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
public class TraitArcane extends AbstractTrait {
|
public class TraitArcane extends AbstractTrait {
|
||||||
|
|
||||||
public TraitArcane() {
|
public TraitArcane() {
|
||||||
@@ -30,13 +32,4 @@ public class TraitArcane extends AbstractTrait {
|
|||||||
ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
|
ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,8 @@ import net.minecraft.util.text.TextFormatting;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
public class TraitBlind extends AbstractTrait {
|
public class TraitBlind extends AbstractTrait {
|
||||||
|
|
||||||
public TraitBlind() {
|
public TraitBlind() {
|
||||||
@@ -37,12 +39,4 @@ public class TraitBlind extends AbstractTrait {
|
|||||||
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
|
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,8 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
|
|
||||||
public class TraitBright extends AbstractTrait {
|
public class TraitBright extends AbstractTrait {
|
||||||
|
|
||||||
@@ -22,7 +24,7 @@ public class TraitBright extends AbstractTrait {
|
|||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
int time = (int) target.getEntityWorld().getWorldTime();
|
int time = (int) target.getEntityWorld().getWorldTime();
|
||||||
if (isDay(time)) {
|
if (!isNight(time)) {
|
||||||
newDamage += damage / 2f;
|
newDamage += damage / 2f;
|
||||||
}
|
}
|
||||||
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||||
@@ -37,14 +39,5 @@ public class TraitBright extends AbstractTrait {
|
|||||||
e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100));
|
e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDay(int time) {
|
|
||||||
if (time < 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,10 +21,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
|
|
||||||
public class TraitCurvature extends AbstractTrait {
|
public class TraitCurvature extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
private static BlockPos pos = new BlockPos(0, 0, 0);
|
|
||||||
|
|
||||||
public TraitCurvature() {
|
public TraitCurvature() {
|
||||||
super("curvature", TextFormatting.BLACK);
|
super("curvature", TextFormatting.BLACK);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -36,7 +32,7 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (random.nextFloat() <= 0.01 && world.provider.getDimension() != -1) {
|
if (random.nextFloat() <= 0.01 && world.provider.getDimension() != -1) {
|
||||||
teleport(player, world, 5);
|
teleport(player, world);
|
||||||
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,10 +40,9 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
|
|
||||||
@Override
|
@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) {
|
||||||
World w = player.getEntityWorld();
|
|
||||||
if (random.nextFloat() <= 0.3) {
|
if (random.nextFloat() <= 0.3) {
|
||||||
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
changepos(player, target);
|
changePos(player, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +59,7 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teleport(EntityLivingBase e, World w, int max) {
|
private void teleport(EntityLivingBase e, World w) {
|
||||||
int x = e.getPosition().getX() + random.nextInt(250) - 125;
|
int x = e.getPosition().getX() + random.nextInt(250) - 125;
|
||||||
int y = e.getPosition().getY();
|
int y = e.getPosition().getY();
|
||||||
int z = e.getPosition().getZ() + random.nextInt(250) - 125;
|
int z = e.getPosition().getZ() + random.nextInt(250) - 125;
|
||||||
@@ -78,11 +73,10 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
e.setPosition(x, y, z);
|
e.setPosition(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changepos(EntityLivingBase player, EntityLivingBase target) {
|
private void changePos(EntityLivingBase player, EntityLivingBase target) {
|
||||||
BlockPos pp = new BlockPos(player.getPosition());
|
BlockPos pp = new BlockPos(player.getPosition());
|
||||||
BlockPos tp = new BlockPos(target.getPosition());
|
BlockPos tp = new BlockPos(target.getPosition());
|
||||||
player.setPosition(tp.getX(), tp.getY(), tp.getZ());
|
player.setPosition(tp.getX(), tp.getY(), tp.getZ());
|
||||||
target.setPosition(pp.getX(), pp.getY(), pp.getZ());
|
target.setPosition(pp.getX(), pp.getY(), pp.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
|
|
||||||
public class TraitDark extends AbstractTrait {
|
public class TraitDark extends AbstractTrait {
|
||||||
|
|
||||||
@@ -21,12 +23,4 @@ public class TraitDark extends AbstractTrait {
|
|||||||
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -33,10 +33,9 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||||
EntityPlayer player = event.getPlayer();
|
EntityPlayer player = event.getPlayer();
|
||||||
if (!player.getEntityWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
|
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
|
||||||
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
|
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -51,7 +50,7 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getUpdateXP(int xp) {
|
private int getUpdateXP(int xp) {
|
||||||
float exp = (float) random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(10));
|
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(10));
|
||||||
if (random.nextBoolean())
|
if (random.nextBoolean())
|
||||||
return Math.round(exp);
|
return Math.round(exp);
|
||||||
else return 0;
|
else return 0;
|
||||||
@@ -63,5 +62,4 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,6 @@ public class TraitFracture extends AbstractTrait {
|
|||||||
float b = 0.99F * calcBonus(tool);
|
float b = 0.99F * calcBonus(tool);
|
||||||
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
|
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
|
||||||
RayTraceResult mop = ((ToolCore) tool.getItem()).rayTrace(world, (EntityPlayer) player, false);
|
RayTraceResult mop = ((ToolCore) tool.getItem()).rayTrace(world, (EntityPlayer) player, false);
|
||||||
if (mop == null) return;
|
|
||||||
for (int i = random.nextInt(9) + 1; i >= 0; i--) {
|
for (int i = random.nextInt(9) + 1; i >= 0; i--) {
|
||||||
switch (mop.sideHit) {
|
switch (mop.sideHit) {
|
||||||
case UP:
|
case UP:
|
||||||
|
@@ -78,7 +78,6 @@ public class TraitFragile extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private float calcBonus(ItemStack tool) {
|
private float calcBonus(ItemStack tool) {
|
||||||
int durability = ToolHelper.getCurrentDurability(tool);
|
int durability = ToolHelper.getCurrentDurability(tool);
|
||||||
int maxDurability = ToolHelper.getMaxDurability(tool);
|
int maxDurability = ToolHelper.getMaxDurability(tool);
|
||||||
|
@@ -67,7 +67,7 @@ public class TraitGarishly extends AbstractTrait {
|
|||||||
float r = random.nextFloat();
|
float r = random.nextFloat();
|
||||||
if (r > 0.5f) event.getDrops().clear();
|
if (r > 0.5f) event.getDrops().clear();
|
||||||
else if (r < 0.1 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
|
else if (r < 0.1 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
|
||||||
ItemStack stack = new ItemStack(Item.getItemFromBlock(event.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3));
|
@SuppressWarnings("ConstantConditions") ItemStack stack = new ItemStack(Item.getItemFromBlock(event.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3));
|
||||||
event.getDrops().add(0, stack);
|
event.getDrops().add(0, stack);
|
||||||
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
|
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,8 @@ import net.minecraft.util.text.TextFormatting;
|
|||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
public class TraitHaunted extends AbstractTrait {
|
public class TraitHaunted extends AbstractTrait {
|
||||||
|
|
||||||
public TraitHaunted() {
|
public TraitHaunted() {
|
||||||
@@ -18,7 +20,6 @@ public class TraitHaunted extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Just several tested Vanilla-Mobs, e.g. no ghasts, bats or skeletons
|
// Just several tested Vanilla-Mobs, e.g. no ghasts, bats or skeletons
|
||||||
@Override
|
@Override
|
||||||
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean isCritical) {
|
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean isCritical) {
|
||||||
@@ -33,12 +34,4 @@ public class TraitHaunted extends AbstractTrait {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ public class TraitHeroic extends AbstractTrait {
|
|||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
int durability = ToolHelper.getCurrentDurability(tool);
|
int durability = ToolHelper.getCurrentDurability(tool);
|
||||||
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
||||||
float calc = (float) (newDamage + (newDamage / 2) / (durability * durabilitymax / (durabilitymax - durability - 1)));
|
float calc = newDamage + (newDamage / 2) / (durability * durabilitymax / (durabilitymax - durability - 1));
|
||||||
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
||||||
return super.damage(tool, player, target, damage, calc, isCritical);
|
return super.damage(tool, player, target, damage, calc, isCritical);
|
||||||
} else return super.damage(tool, player, target, damage, newDamage, isCritical);
|
} else return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||||
|
@@ -15,6 +15,8 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
public class TraitHollow extends AbstractTrait {
|
public class TraitHollow extends AbstractTrait {
|
||||||
|
|
||||||
public TraitHollow() {
|
public TraitHollow() {
|
||||||
@@ -45,12 +47,4 @@ public class TraitHollow extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -7,9 +7,7 @@ import net.minecraft.util.text.TextFormatting;
|
|||||||
import net.minecraftforge.event.world.BlockEvent;
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Robert on 03.06.2016.
|
|
||||||
*/
|
|
||||||
public class TraitMelting extends AbstractTrait {
|
public class TraitMelting extends AbstractTrait {
|
||||||
|
|
||||||
public TraitMelting() {
|
public TraitMelting() {
|
||||||
@@ -24,8 +22,6 @@ public class TraitMelting extends AbstractTrait {
|
|||||||
event.getWorld().setBlockState(event.getPos(), Blocks.LAVA.getDefaultState());
|
event.getWorld().setBlockState(event.getPos(), Blocks.LAVA.getDefaultState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
|
|||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
@@ -19,7 +18,6 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
|||||||
|
|
||||||
|
|
||||||
public class TraitNatureBound extends AbstractTrait {
|
public class TraitNatureBound extends AbstractTrait {
|
||||||
public static DamageSource splinter = new DamageSource("splinter").setDamageBypassesArmor();
|
|
||||||
private static int chance = 20;
|
private static int chance = 20;
|
||||||
|
|
||||||
public TraitNatureBound() {
|
public TraitNatureBound() {
|
||||||
@@ -50,9 +48,4 @@ public class TraitNatureBound extends AbstractTrait {
|
|||||||
e.getPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
e.getPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -28,12 +28,10 @@ public class TraitPulverizing extends AbstractTrait {
|
|||||||
return speed * (maxDurability - maxDurability / 10) / (durability);
|
return speed * (maxDurability - maxDurability / 10) / (durability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
||||||
if (random.nextFloat() < 0.9) {
|
if (random.nextFloat() < 0.9) {
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ public class TraitRandomize extends AbstractTrait {
|
|||||||
@Override
|
@Override
|
||||||
public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) {
|
public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) {
|
||||||
if (ToolHelper.isToolEffective2(tool, event.getState())) {
|
if (ToolHelper.isToolEffective2(tool, event.getState())) {
|
||||||
event.setNewSpeed((float) (event.getNewSpeed() + random.nextFloat() * 2));
|
event.setNewSpeed(event.getNewSpeed() + random.nextFloat() * 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,13 +113,15 @@ public class TraitRandomize extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
e.setPosition(target.getPosition().getX(), target.getPosition().getY() + 0.1f, target.getPosition().getZ());
|
e.setPosition(target.getPosition().getX(), target.getPosition().getY() + 0.1f, target.getPosition().getZ());
|
||||||
e.setCustomNameTag("Missingno");
|
e.setCustomNameTag("Missingno");
|
||||||
((EntityLiving) e).setHealth(((EntityLiving) e).getHealth() * (random.nextInt(5) + 1));
|
if (e instanceof EntityLiving)
|
||||||
|
((EntityLiving) e).setHealth(((EntityLiving) e).getHealth() * (random.nextInt(5) + 1));
|
||||||
w.spawnEntityInWorld(e);
|
w.spawnEntityInWorld(e);
|
||||||
target.setDead();
|
target.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
@Override
|
@Override
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
||||||
float r = random.nextFloat();
|
float r = random.nextFloat();
|
||||||
|
@@ -18,8 +18,6 @@ public class TraitResonance extends AbstractTrait {
|
|||||||
target.knockBack(target, random.nextFloat() * random.nextFloat() * 12, player.posX - target.posX, player.posZ - target.posZ);
|
target.knockBack(target, random.nextFloat() * random.nextFloat() * 12, player.posX - target.posX, player.posZ - target.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -18,10 +18,9 @@ import slimeknights.tconstruct.library.utils.TagUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.util.Utils.isNight;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Robert on 03.06.2016.
|
|
||||||
*/
|
|
||||||
public class TraitReviving extends AbstractTrait {
|
public class TraitReviving extends AbstractTrait {
|
||||||
|
|
||||||
public TraitReviving() {
|
public TraitReviving() {
|
||||||
@@ -38,6 +37,7 @@ public class TraitReviving extends AbstractTrait {
|
|||||||
if (isNight((int) w.getWorldTime()) && random.nextFloat() > 0.85 && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
|
if (isNight((int) w.getWorldTime()) && random.nextFloat() > 0.85 && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
|
||||||
String name = EntityList.getEntityString(e.getEntity());
|
String name = EntityList.getEntityString(e.getEntity());
|
||||||
Entity ent = EntityList.createEntityByName(name, w);
|
Entity ent = EntityList.createEntityByName(name, w);
|
||||||
|
assert ent != null;
|
||||||
ent.setPosition(pos.getX(), pos.getY(), pos.getZ());
|
ent.setPosition(pos.getX(), pos.getY(), pos.getZ());
|
||||||
w.spawnEntityInWorld(ent);
|
w.spawnEntityInWorld(ent);
|
||||||
}
|
}
|
||||||
@@ -60,13 +60,4 @@ public class TraitReviving extends AbstractTrait {
|
|||||||
ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
|
ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isNight(int time) {
|
|
||||||
if (time > 12500) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -29,11 +29,8 @@ public class TraitSlaughtering extends AbstractTrait {
|
|||||||
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
Item i = event.getDrops().get(random.nextInt(event.getDrops().size())).getEntityItem().getItem();
|
Item i = event.getDrops().get(random.nextInt(event.getDrops().size())).getEntityItem().getItem();
|
||||||
if (i != null) {
|
event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i, random.nextInt(4) + 1)));
|
||||||
event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i, random.nextInt(4) + 1)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,4 @@ public class TraitTraditional extends AbstractTrait {
|
|||||||
super("traditional", TextFormatting.GREEN);
|
super("traditional", TextFormatting.GREEN);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class EntityAIPermanentPanic extends EntityAIBase {
|
public class EntityAIPermanentPanic extends EntityAIBase {
|
||||||
private EntityCreature theEntityCreature;
|
private EntityCreature theEntityCreature;
|
||||||
protected double speed;
|
private double speed;
|
||||||
private double randPosX;
|
private double randPosX;
|
||||||
private double randPosY;
|
private double randPosY;
|
||||||
private double randPosZ;
|
private double randPosZ;
|
||||||
@@ -45,10 +45,10 @@ public class EntityAIPermanentPanic extends EntityAIBase {
|
|||||||
this.randPosY = (double) blockpos.getY();
|
this.randPosY = (double) blockpos.getY();
|
||||||
this.randPosZ = (double) blockpos.getZ();
|
this.randPosZ = (double) blockpos.getZ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,5 +21,4 @@ public class FuelHandler implements IFuelHandler {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ public class StateMatcher implements Predicate<IBlockState> {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StateMatcher forState(IBlockState state, IProperty property, Comparable value) {
|
static StateMatcher forState(IBlockState state, IProperty property, Comparable value) {
|
||||||
return new StateMatcher(state, property, value);
|
return new StateMatcher(state, property, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,4 +78,8 @@ public class Utils {
|
|||||||
message.setTag("alloy", tagList);
|
message.setTag("alloy", tagList);
|
||||||
FMLInterModComms.sendMessage("tconstruct", "alloy", message);
|
FMLInterModComms.sendMessage("tconstruct", "alloy", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isNight(int time) {
|
||||||
|
return time > 12500;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,10 +47,8 @@ public class ZWorldGen implements IWorldGenerator {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
IChunkProvider chunkProvider) {
|
|
||||||
int x = chunkX * 16;
|
int x = chunkX * 16;
|
||||||
int z = chunkZ * 16;
|
int z = chunkZ * 16;
|
||||||
switch (world.provider.getDimension()) {
|
switch (world.provider.getDimension()) {
|
||||||
|
@@ -10,6 +10,7 @@ import net.minecraft.util.math.MathHelper;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
|
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class ZWorldGenMinable extends WorldGenMinable {
|
public class ZWorldGenMinable extends WorldGenMinable {
|
||||||
@@ -32,6 +33,7 @@ public class ZWorldGenMinable extends WorldGenMinable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
public boolean generate(World worldIn, Random rand, BlockPos position) {
|
public boolean generate(World worldIn, Random rand, BlockPos position) {
|
||||||
float f = rand.nextFloat() * (float) Math.PI;
|
float f = rand.nextFloat() * (float) Math.PI;
|
||||||
double d0 = (double) ((float) (position.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
|
double d0 = (double) ((float) (position.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
|
||||||
|
Reference in New Issue
Block a user