general code cleanup

try and add changes generation back into gradle again
This commit is contained in:
2016-07-27 11:29:58 +02:00
parent e8976365a2
commit faa70ed224
32 changed files with 49 additions and 124 deletions

View File

@@ -33,10 +33,9 @@ public class TraitDiffuse extends AbstractTrait {
@SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) {
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()));
}
}
@SubscribeEvent
@@ -51,7 +50,7 @@ public class TraitDiffuse extends AbstractTrait {
}
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())
return Math.round(exp);
else return 0;
@@ -63,5 +62,4 @@ public class TraitDiffuse extends AbstractTrait {
event.getDrops().clear();
}
}
}