aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java228
1 files changed, 115 insertions, 113 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
index de7ffe5e..8e712012 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
@@ -6,7 +6,6 @@ import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSound;
-import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundCategory;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.GlStateManager;
@@ -54,6 +53,7 @@ public class FishingHelper {
FISH_INCOMING,
FISH_HOOKED
}
+
public PlayerWarningState warningState = PlayerWarningState.NOTHING;
private int hookedWarningStateTicks = 0;
@@ -66,11 +66,14 @@ public class FishingHelper {
private int buildupSoundDelay = 0;
private static final ResourceLocation FISHING_WARNING_EXCLAM = new ResourceLocation("notenoughupdates:fishing_warning_exclam.png");
+
public void onRenderBobber(EntityFishHook hook) {
- if(Minecraft.getMinecraft().thePlayer.fishEntity == hook && warningState != PlayerWarningState.NOTHING) {
+ if (Minecraft.getMinecraft().thePlayer.fishEntity == hook && warningState != PlayerWarningState.NOTHING) {
- if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning && warningState == PlayerWarningState.FISH_INCOMING) return;
- if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR && warningState == PlayerWarningState.FISH_HOOKED) return;
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning && warningState == PlayerWarningState.FISH_INCOMING)
+ return;
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR && warningState == PlayerWarningState.FISH_HOOKED)
+ return;
GlStateManager.disableCull();
GlStateManager.disableLighting();
@@ -79,9 +82,9 @@ public class FishingHelper {
float offset = warningState == PlayerWarningState.FISH_HOOKED ? 0.5f : 0f;
- float centerOffset = 0.5f/8f;
+ float centerOffset = 0.5f / 8f;
Minecraft.getMinecraft().getTextureManager().bindTexture(FISHING_WARNING_EXCLAM);
- Utils.drawTexturedRect(centerOffset - 4f/8f, -20/8f, 1f, 2f, 0+offset, 0.5f+offset, 0, 1, GL11.GL_NEAREST);
+ Utils.drawTexturedRect(centerOffset - 4f / 8f, -20 / 8f, 1f, 2f, 0 + offset, 0.5f + offset, 0, 1, GL11.GL_NEAREST);
GlStateManager.scale(1, -1, 1);
GL11.glDepthFunc(GL11.GL_LEQUAL);
@@ -91,15 +94,15 @@ public class FishingHelper {
}
public void addEntity(int entityId, Entity entity) {
- if(entity instanceof EntityFishHook) {
+ if (entity instanceof EntityFishHook) {
hookEntities.put(entityId, (EntityFishHook) entity);
- if(((EntityFishHook) entity).angler == Minecraft.getMinecraft().thePlayer) {
+ if (((EntityFishHook) entity).angler == Minecraft.getMinecraft().thePlayer) {
long currentTime = System.currentTimeMillis();
long delay = currentTime - lastCastRodMillis;
- if(delay > 0 && delay < 500) {
- if(delay > 300) delay = 300;
- pingDelayList.add(0, (int)delay);
+ if (delay > 0 && delay < 500) {
+ if (delay > 300) delay = 300;
+ pingDelayList.add(0, (int) delay);
}
}
}
@@ -117,14 +120,14 @@ public class FishingHelper {
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event) {
- if(event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR &&
- event.entityPlayer == Minecraft.getMinecraft().thePlayer) {
+ if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR &&
+ event.entityPlayer == Minecraft.getMinecraft().thePlayer) {
ItemStack heldItem = event.entityPlayer.getHeldItem();
- if(heldItem != null && heldItem.getItem() == Items.fishing_rod) {
+ if (heldItem != null && heldItem.getItem() == Items.fishing_rod) {
long currentTime = System.currentTimeMillis();
- if(currentTime - lastCastRodMillis > 500) {
+ if (currentTime - lastCastRodMillis > 500) {
lastCastRodMillis = currentTime;
}
}
@@ -133,35 +136,36 @@ public class FishingHelper {
}
private int tickCounter = 0;
+
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
- if(Minecraft.getMinecraft().thePlayer != null && event.phase == TickEvent.Phase.END) {
- if(buildupSoundDelay > 0) buildupSoundDelay--;
+ if (Minecraft.getMinecraft().thePlayer != null && event.phase == TickEvent.Phase.END) {
+ if (buildupSoundDelay > 0) buildupSoundDelay--;
- if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
- if(Minecraft.getMinecraft().thePlayer.fishEntity != null) {
- if(!pingDelayList.isEmpty()) {
- while(pingDelayList.size() > 5) pingDelayList.remove(pingDelayList.size()-1);
+ if (NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
+ if (Minecraft.getMinecraft().thePlayer.fishEntity != null) {
+ if (!pingDelayList.isEmpty()) {
+ while (pingDelayList.size() > 5) pingDelayList.remove(pingDelayList.size() - 1);
int totalMS = 0;
- for(int delay : pingDelayList) {
+ for (int delay : pingDelayList) {
totalMS += delay;
}
int averageMS = totalMS / pingDelayList.size();
- pingDelayTicks = (int)Math.floor(averageMS/50f);
+ pingDelayTicks = (int) Math.floor(averageMS / 50f);
}
}
- if(hookedWarningStateTicks > 0) {
+ if (hookedWarningStateTicks > 0) {
hookedWarningStateTicks--;
warningState = PlayerWarningState.FISH_HOOKED;
} else {
warningState = PlayerWarningState.NOTHING;
- if(Minecraft.getMinecraft().thePlayer.fishEntity != null) {
+ if (Minecraft.getMinecraft().thePlayer.fishEntity != null) {
int fishEntityId = Minecraft.getMinecraft().thePlayer.fishEntity.getEntityId();
- for(Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
- if(entry.getKey().particleNum >= 3 && entry.getValue().contains(fishEntityId)) {
+ for (Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
+ if (entry.getKey().particleNum >= 3 && entry.getValue().contains(fishEntityId)) {
warningState = PlayerWarningState.FISH_INCOMING;
break;
}
@@ -170,21 +174,21 @@ public class FishingHelper {
}
}
- if(tickCounter++ >= 20) {
+ if (tickCounter++ >= 20) {
long currentTime = System.currentTimeMillis();
tickCounter = 0;
Set<Integer> toRemoveEnt = new HashSet<>();
- for(Map.Entry<Integer, EntityFishHook> entry : hookEntities.entrySet()) {
- if(entry.getValue().isDead) {
+ for (Map.Entry<Integer, EntityFishHook> entry : hookEntities.entrySet()) {
+ if (entry.getValue().isDead) {
toRemoveEnt.add(entry.getKey());
}
}
hookEntities.keySet().removeAll(toRemoveEnt);
Set<WakeChain> toRemoveChain = new HashSet<>();
- for(Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
- if(currentTime - entry.getKey().lastUpdate > 200 ||
+ for (Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
+ if (currentTime - entry.getKey().lastUpdate > 200 ||
entry.getValue().isEmpty() ||
Collections.disjoint(entry.getValue(), hookEntities.keySet())) {
toRemoveChain.add(entry.getKey());
@@ -199,28 +203,28 @@ public class FishingHelper {
double angleX = Math.toDegrees(Math.acos(xOffset / 0.04f));
double angleZ = Math.toDegrees(Math.asin(zOffset / 0.04f));
- if(xOffset < 0) {
+ if (xOffset < 0) {
angleZ = 180 - angleZ;
}
- if(zOffset < 0) {
+ if (zOffset < 0) {
angleX = 360 - angleX;
}
angleX %= 360;
angleZ %= 360;
- if(angleX < 0) angleX += 360;
- if(angleZ < 0) angleZ += 360;
+ if (angleX < 0) angleX += 360;
+ if (angleZ < 0) angleZ += 360;
double dist = angleX - angleZ;
- if(dist < -180) dist += 360;
- if(dist > 180) dist -= 360;
+ if (dist < -180) dist += 360;
+ if (dist > 180) dist -= 360;
- return angleZ + dist/2;
+ return angleZ + dist / 2;
}
private boolean checkAngleWithinRange(double angle1, double angle2, double range) {
double dist = Math.abs(angle1 - angle2);
- if(dist > 180) dist = 360 - dist;
+ if (dist > 180) dist = 360 - dist;
return dist <= range;
}
@@ -234,25 +238,25 @@ public class FishingHelper {
private HookPossibleRet isHookPossible(EntityFishHook hook, double particleX, double particleY, double particleZ, double angle1, double angle2) {
double dY = particleY - hook.posY;
- if(Math.abs(dY) > 0.5f) {
+ if (Math.abs(dY) > 0.5f) {
return HookPossibleRet.NOT_POSSIBLE;
}
double dX = particleX - hook.posX;
double dZ = particleZ - hook.posZ;
- double dist = Math.sqrt(dX*dX + dZ*dZ);
+ double dist = Math.sqrt(dX * dX + dZ * dZ);
- if(dist < 0.2) {
+ if (dist < 0.2) {
return HookPossibleRet.EITHER;
} else {
- float angleAllowance = (float)Math.toDegrees(Math.atan2(0.03125f, dist))*1.5f;
+ float angleAllowance = (float) Math.toDegrees(Math.atan2(0.03125f, dist)) * 1.5f;
float angleHook = (float) Math.toDegrees(Math.atan2(dX, dZ));
angleHook %= 360;
- if(angleHook < 0) angleHook += 360;
+ if (angleHook < 0) angleHook += 360;
- if(checkAngleWithinRange(angle1, angleHook, angleAllowance)) {
+ if (checkAngleWithinRange(angle1, angleHook, angleAllowance)) {
return HookPossibleRet.ANGLE1;
- } else if(checkAngleWithinRange(angle2, angleHook, angleAllowance)) {
+ } else if (checkAngleWithinRange(angle2, angleHook, angleAllowance)) {
return HookPossibleRet.ANGLE2;
}
}
@@ -264,101 +268,100 @@ public class FishingHelper {
private static final float ZERO_PITCH = 1.0f;
private static final float MAX_PITCH = 0.1f;
private static final float MAX_DISTANCE = 5f;
+
private float calculatePitchFromDistance(float d) {
- if(d < 0.1f) d = 0.1f;
- if(d > MAX_DISTANCE) d = MAX_DISTANCE;
+ if (d < 0.1f) d = 0.1f;
+ if (d > MAX_DISTANCE) d = MAX_DISTANCE;
- return 1/(d + (1/(ZERO_PITCH-MAX_PITCH))) * (1 - d/MAX_DISTANCE) + MAX_PITCH;
+ return 1 / (d + (1 / (ZERO_PITCH - MAX_PITCH))) * (1 - d / MAX_DISTANCE) + MAX_PITCH;
}
public boolean onSpawnParticle(EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset) {
- if(!NotEnoughUpdates.INSTANCE.config.fishing.hideOtherPlayerAll &&
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.hideOtherPlayerAll &&
!NotEnoughUpdates.INSTANCE.config.fishing.enableCustomParticles &&
!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning &&
!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
return false;
}
- if(hookEntities.isEmpty()) {
+ if (hookEntities.isEmpty()) {
return false;
}
-
- if((particleType == EnumParticleTypes.WATER_WAKE|| particleType == EnumParticleTypes.SMOKE_NORMAL) && Math.abs(yOffset - 0.01f) < 0.001f) {
+ if ((particleType == EnumParticleTypes.WATER_WAKE || particleType == EnumParticleTypes.SMOKE_NORMAL) && Math.abs(yOffset - 0.01f) < 0.001f) {
double angle1 = calculateAngleFromOffsets(xOffset, -zOffset);
double angle2 = calculateAngleFromOffsets(-xOffset, zOffset);
-
final List<Integer> possibleHooks1 = new ArrayList<>();
final List<Integer> possibleHooks2 = new ArrayList<>();
- for(EntityFishHook hook : hookEntities.values()) {
- if(hook.isDead) continue;
- if(possibleHooks1.contains(hook.getEntityId())) continue;
- if(possibleHooks2.contains(hook.getEntityId())) continue;
+ for (EntityFishHook hook : hookEntities.values()) {
+ if (hook.isDead) continue;
+ if (possibleHooks1.contains(hook.getEntityId())) continue;
+ if (possibleHooks2.contains(hook.getEntityId())) continue;
HookPossibleRet ret = isHookPossible(hook, x, y, z, angle1, angle2);
- if(ret == HookPossibleRet.ANGLE1) {
+ if (ret == HookPossibleRet.ANGLE1) {
possibleHooks1.add(hook.getEntityId());
- } else if(ret == HookPossibleRet.ANGLE2) {
+ } else if (ret == HookPossibleRet.ANGLE2) {
possibleHooks2.add(hook.getEntityId());
- } else if(ret == HookPossibleRet.EITHER) {
+ } else if (ret == HookPossibleRet.EITHER) {
possibleHooks1.add(hook.getEntityId());
possibleHooks2.add(hook.getEntityId());
}
}
- if(!possibleHooks1.isEmpty() || !possibleHooks2.isEmpty()) {
+ if (!possibleHooks1.isEmpty() || !possibleHooks2.isEmpty()) {
long currentTime = System.currentTimeMillis();
boolean isMainPlayer = false;
boolean foundChain = false;
- for(Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
+ for (Map.Entry<WakeChain, List<Integer>> entry : chains.entrySet()) {
WakeChain chain = entry.getKey();
- if(currentTime - chain.lastUpdate > 200) continue;
+ if (currentTime - chain.lastUpdate > 200) continue;
double updateAngle;
List<Integer> possibleHooks;
- if(checkAngleWithinRange(chain.currentAngle, angle1, 16)) {
+ if (checkAngleWithinRange(chain.currentAngle, angle1, 16)) {
possibleHooks = possibleHooks1;
updateAngle = angle1;
- } else if(checkAngleWithinRange(chain.currentAngle, angle2, 16)) {
+ } else if (checkAngleWithinRange(chain.currentAngle, angle2, 16)) {
possibleHooks = possibleHooks2;
updateAngle = angle2;
} else {
continue;
}
- if(!Collections.disjoint(entry.getValue(), possibleHooks)) {
+ if (!Collections.disjoint(entry.getValue(), possibleHooks)) {
HashSet<Integer> newHooks = new HashSet<>();
- for(int hookEntityId : possibleHooks) {
- if(entry.getValue().contains(hookEntityId) && chain.distances.containsKey(hookEntityId)) {
+ for (int hookEntityId : possibleHooks) {
+ if (entry.getValue().contains(hookEntityId) && chain.distances.containsKey(hookEntityId)) {
EntityFishHook entity = hookEntities.get(hookEntityId);
- if(entity != null && !entity.isDead) {
+ if (entity != null && !entity.isDead) {
double oldDistance = chain.distances.get(hookEntityId);
double dX = entity.posX - x;
double dZ = entity.posZ - z;
- double newDistance = Math.sqrt(dX*dX + dZ*dZ);
+ double newDistance = Math.sqrt(dX * dX + dZ * dZ);
double delta = oldDistance - newDistance;
- if(newDistance < 0.2 || (delta > -0.1 && delta < 0.3)) {
- if((NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) &&
+ if (newDistance < 0.2 || (delta > -0.1 && delta < 0.3)) {
+ if ((NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) &&
Minecraft.getMinecraft().thePlayer.fishEntity != null &&
Minecraft.getMinecraft().thePlayer.fishEntity.getEntityId() == hookEntityId &&
chain.particleNum > 3) {
- if(newDistance <= 0.2f + 0.1f*pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
- if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSounds &&
+ if (newDistance <= 0.2f + 0.1f * pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
+ if (NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSounds &&
hookedWarningStateTicks <= 0) {
- float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSoundsVol/100f;
- if(vol > 0) {
- if(vol > 1) vol = 1;
+ float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSoundsVol / 100f;
+ if (vol > 0) {
+ if (vol > 1) vol = 1;
final float volF = vol;
ISound sound = new PositionedSound(new ResourceLocation("note.pling")) {{
@@ -377,17 +380,17 @@ public class FishingHelper {
}
hookedWarningStateTicks = 12;
- } else if(newDistance >= 0.4f + 0.1f*pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) {
- if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSounds &&
+ } else if (newDistance >= 0.4f + 0.1f * pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) {
+ if (NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSounds &&
buildupSoundDelay <= 0) {
- float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSoundsVol/100f;
- if(vol > 0) {
- if(vol > 1) vol = 1;
+ float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSoundsVol / 100f;
+ if (vol > 0) {
+ if (vol > 1) vol = 1;
final float volF = vol;
ISound sound = new PositionedSound(new ResourceLocation("note.pling")) {{
volume = volF;
- pitch = calculatePitchFromDistance((float)newDistance - (0.3f+0.1f*pingDelayTicks));
+ pitch = calculatePitchFromDistance((float) newDistance - (0.3f + 0.1f * pingDelayTicks));
repeat = false;
repeatDelay = 0;
attenuationType = ISound.AttenuationType.NONE;
@@ -410,16 +413,16 @@ public class FishingHelper {
}
}
- if(newHooks.isEmpty()) {
+ if (newHooks.isEmpty()) {
continue;
}
entry.getValue().retainAll(newHooks);
chain.distances.keySet().retainAll(newHooks);
- for(int i : entry.getValue()) {
+ for (int i : entry.getValue()) {
EntityFishHook hook = hookEntities.get(i);
- if(hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
+ if (hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
isMainPlayer = true;
break;
}
@@ -433,47 +436,46 @@ public class FishingHelper {
}
}
-
- if(!foundChain) {
+ if (!foundChain) {
possibleHooks1.removeAll(possibleHooks2);
- if(!possibleHooks1.isEmpty()) {
- for(int i : possibleHooks1) {
+ if (!possibleHooks1.isEmpty()) {
+ for (int i : possibleHooks1) {
EntityFishHook hook = hookEntities.get(i);
- if(hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
+ if (hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
isMainPlayer = true;
break;
}
}
WakeChain chain = new WakeChain(currentTime, angle1, x, z);
- for(int hookEntityId : possibleHooks1) {
+ for (int hookEntityId : possibleHooks1) {
EntityFishHook entity = hookEntities.get(hookEntityId);
- if(entity != null && !entity.isDead) {
+ if (entity != null && !entity.isDead) {
double dX = entity.posX - x;
double dZ = entity.posZ - z;
- double newDistance = Math.sqrt(dX*dX + dZ*dZ);
+ double newDistance = Math.sqrt(dX * dX + dZ * dZ);
chain.distances.put(hookEntityId, newDistance);
}
}
chains.put(chain, possibleHooks1);
- } else if(!possibleHooks2.isEmpty()) {
- for(int i : possibleHooks2) {
+ } else if (!possibleHooks2.isEmpty()) {
+ for (int i : possibleHooks2) {
EntityFishHook hook = hookEntities.get(i);
- if(hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
+ if (hook != null && hook.angler == Minecraft.getMinecraft().thePlayer) {
isMainPlayer = true;
break;
}
}
WakeChain chain = new WakeChain(currentTime, angle2, x, z);
- for(int hookEntityId : possibleHooks2) {
+ for (int hookEntityId : possibleHooks2) {
EntityFishHook entity = hookEntities.get(hookEntityId);
- if(entity != null && !entity.isDead) {
+ if (entity != null && !entity.isDead) {
double dX = entity.posX - x;
double dZ = entity.posZ - z;
- double newDistance = Math.sqrt(dX*dX + dZ*dZ);
+ double newDistance = Math.sqrt(dX * dX + dZ * dZ);
chain.distances.put(hookEntityId, newDistance);
}
}
@@ -483,25 +485,25 @@ public class FishingHelper {
int particleTypeI;
String particleCustomColour;
- if(isMainPlayer) {
+ if (isMainPlayer) {
particleTypeI = NotEnoughUpdates.INSTANCE.config.fishing.yourParticleType;
particleCustomColour = NotEnoughUpdates.INSTANCE.config.fishing.yourParticleColour;
- } else if(NotEnoughUpdates.INSTANCE.config.fishing.hideOtherPlayerAll) {
+ } else if (NotEnoughUpdates.INSTANCE.config.fishing.hideOtherPlayerAll) {
return true;
} else {
particleTypeI = NotEnoughUpdates.INSTANCE.config.fishing.otherParticleType;
particleCustomColour = NotEnoughUpdates.INSTANCE.config.fishing.otherParticleColour;
}
- if(!NotEnoughUpdates.INSTANCE.config.fishing.enableCustomParticles) {
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.enableCustomParticles) {
return false;
}
int argb = SpecialColour.specialToChromaRGB(particleCustomColour);
- if(particleTypeI == 0) {
+ if (particleTypeI == 0) {
return false;
- } else if(particleTypeI == 1) {
+ } else if (particleTypeI == 1) {
return true;
}
@@ -512,20 +514,20 @@ public class FishingHelper {
return true;
}
- if(i >= 2) {
+ if (i >= 2) {
return true;
}
double xDist = Minecraft.getMinecraft().getRenderViewEntity().posX - x;
double yDist = Minecraft.getMinecraft().getRenderViewEntity().posY - y;
double zDist = Minecraft.getMinecraft().getRenderViewEntity().posZ - z;
- double distSq = xDist*xDist + yDist*yDist + zDist*zDist;
+ double distSq = xDist * xDist + yDist * yDist + zDist * zDist;
- if(distSq < 32*32) {
+ if (distSq < 32 * 32) {
boolean customColour = false;
double yVel = 0;
- switch(particleTypeI) {
+ switch (particleTypeI) {
case 2:
particleType = EnumParticleTypes.FIREWORKS_SPARK;
customColour = true;
@@ -553,7 +555,7 @@ public class FishingHelper {
break;
}
- if(customColour && (((argb >> 24) & 0xFF) < 10)) {
+ if (customColour && (((argb >> 24) & 0xFF) < 10)) {
return true;
}
@@ -563,7 +565,7 @@ public class FishingHelper {
fx.motionY = yVel;
fx.motionZ = Math.random() * 0.02 - 0.01;
- if(customColour) {
+ if (customColour) {
float red = ((argb >> 16) & 0xFF) / 255f;
float green = ((argb >> 8) & 0xFF) / 255f;
float blue = (argb & 0xFF) / 255f;