forked from TAIGA/TAIGA
general code cleanup
try and add changes generation back into gradle again
This commit is contained in:
@@ -21,10 +21,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
|
||||
public class TraitCurvature extends AbstractTrait {
|
||||
|
||||
|
||||
private static BlockPos pos = new BlockPos(0, 0, 0);
|
||||
|
||||
public TraitCurvature() {
|
||||
super("curvature", TextFormatting.BLACK);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -36,7 +32,7 @@ public class TraitCurvature extends AbstractTrait {
|
||||
return;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -44,10 +40,9 @@ public class TraitCurvature extends AbstractTrait {
|
||||
|
||||
@Override
|
||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||
World w = player.getEntityWorld();
|
||||
if (random.nextFloat() <= 0.3) {
|
||||
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 y = e.getPosition().getY();
|
||||
int z = e.getPosition().getZ() + random.nextInt(250) - 125;
|
||||
@@ -78,11 +73,10 @@ public class TraitCurvature extends AbstractTrait {
|
||||
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 tp = new BlockPos(target.getPosition());
|
||||
player.setPosition(tp.getX(), tp.getY(), tp.getZ());
|
||||
target.setPosition(pp.getX(), pp.getY(), pp.getZ());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user