Skip to content

Commit

Permalink
Merge pull request #42 from Runsafe/topic/typos
Browse files Browse the repository at this point in the history
Resolve some typo and grammar warnings
  • Loading branch information
mortenn authored Feb 22, 2024
2 parents 992a39d + 0c16ba9 commit 1630b8d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
44 changes: 22 additions & 22 deletions src/no/runsafe/dergons/Dergon.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ private void attemptPlayerPickup()
return;

// Always pick up a player if they're wearing an elytra.
RunsafeMeta chestplate = unluckyChum.getChestplate();
if (chestplate != null && chestplate.is(Item.Transportation.Elytra))
RunsafeMeta chestPlate = unluckyChum.getChestplate();
if (chestPlate != null && chestPlate.is(Item.Transportation.Elytra))
{
// Crumple their elytra
chestplate.setDurability((short) (chestplate.getDurability() + 100));
unluckyChum.setChestplate(chestplate);
chestPlate.setDurability((short) (chestPlate.getDurability() + 100));
unluckyChum.setChestplate(chestPlate);
// Do additional damage
unluckyChum.damage(Config.getPickupDamage());
unluckyChum.addBuff(Buff.Combat.Blindness.duration(10));
Expand Down Expand Up @@ -372,21 +372,21 @@ else if (targetEntity == null)
float sinYaw = (float) sin(yawRad);
float cosYaw = (float) cos(yawRad);

incrementHitboxLocation(
incrementHitBoxLocation(
dergonBody,
(sinYaw / 2),
0,
-(cosYaw / 2)
);

incrementHitboxLocation(
incrementHitBoxLocation(
dergonWingRight,
(cosYaw * 4.5),
1,
(sinYaw * 4.5)
);

incrementHitboxLocation(
incrementHitBoxLocation(
dergonWingLeft,
-(cosYaw * 4.5),
1,
Expand All @@ -406,7 +406,7 @@ else if (targetEntity == null)
float xHeadDirectionIncremented = (float) sin(toRadians(yaw) - bi * 0.01F);
float zHeadDirectionIncremented = (float) cos(toRadians(yaw) - bi * 0.01F);

incrementHitboxLocation(
incrementHitBoxLocation(
dergonHead,
(xHeadDirectionIncremented * 5.5 * cosF1),
(currentAltitude - olderPosition[1]) + (sinF1 * 5.5),
Expand All @@ -430,7 +430,7 @@ else if (targetEntity == null)
final float ONE_POINT_FIVE = 1.5F;
float movementMultiplier = (tailNumber + 1) * 2.0F; // 2, 4, 6

incrementHitboxLocation(
incrementHitBoxLocation(
tailSection,
-(sinYaw * ONE_POINT_FIVE + sin(tailDirection) * movementMultiplier) * cosF1,
(oldPosition[1] - olderPosition[1]) - ((movementMultiplier + ONE_POINT_FIVE) * sinF1) + 1.5D,
Expand All @@ -445,14 +445,14 @@ else if (targetEntity == null)
* Names of this function in various spigot versions:
* v1_8_R3 - v1_12_R1: a
* @param bodyPart Part of the dergon hit.
* @param damager Source of the damage.
* @param damageSource Source of the damage.
* @param damageValue Amount of damage.
* @return True if damage is dealt.
*/
@Override
public boolean a(EntityComplexPart bodyPart, DamageSource damager, float damageValue)
public boolean a(EntityComplexPart bodyPart, DamageSource damageSource, float damageValue)
{
Entity bukkitAttacker = damager.getEntity();
Entity bukkitAttacker = damageSource.getEntity();
IPlayer attacker = null;
if (bukkitAttacker instanceof EntityHuman)
attacker = ObjectWrapper.convert(((EntityHuman) bukkitAttacker).getBukkitEntity());
Expand All @@ -476,12 +476,12 @@ public boolean a(EntityComplexPart bodyPart, DamageSource damager, float damageV
targetEntity = null;

// Only apply damage if the source is a player or an explosion.
if (attacker != null || damager.isExplosion())
if (attacker != null || damageSource.isExplosion())
{
// Do more damage for head shots
// Do more damage for headshots
if(bodyPart != dergonHead)
damageValue = (damageValue / 4) + 1;
damageEntity(damager, damageValue);
damageEntity(damageSource, damageValue);
}

// Spawn in some creatures to help defend the dergon
Expand Down Expand Up @@ -595,7 +595,7 @@ private double[] getMovementOffset(int bufferIndexOffset)

/**
* Damage the dergon.
* Overrides method in EntityLiving.class
* Overrides method in {@link EntityLiving}
* Names of this function in various spigot versions:
* v1_12_R1: damageEntity0
* @param source damage source
Expand Down Expand Up @@ -676,11 +676,11 @@ protected void bO()
}

/**
* Gets all hitboxes.
* Gets all hit-boxes.
* Overrides method in Entity.class.
* Names of this method in various spigot versions:
* v_12_R1: bb
* @return All hitboxes.
* @return All hit-boxes.
*/
@Override
public Entity[] bb()
Expand Down Expand Up @@ -751,13 +751,13 @@ public ILocation getLocation()
}

/**
* Increments the hitbox location of a dergon's body part.
* Increments the hit-box location of a dergon's body part.
* @param bodyPart Part to change the location of.
* @param xIncrement How far to move in the X direction.
* @param yIncrement How far to move in the Y direction.
* @param zIncrement How far to move in the Z direction.
*/
private void incrementHitboxLocation(EntityComplexPart bodyPart, double xIncrement, double yIncrement, double zIncrement)
private void incrementHitBoxLocation(EntityComplexPart bodyPart, double xIncrement, double yIncrement, double zIncrement)
{
bodyPart.B_(); //t_() means on update. Behavior changes slightly in 1.12 (B_())
bodyPart.setPositionRotation(
Expand All @@ -769,7 +769,7 @@ private void incrementHitboxLocation(EntityComplexPart bodyPart, double xIncreme
* Checks if player should be targeted.
* Will not return true if player is vanished, dead, in creative, or in spectator mode.
* @param player Person to consider targeting.
* @return True if targetable.
* @return True if they can be targeted.
*/
private boolean isInvalidTarget(IPlayer player)
{
Expand All @@ -795,7 +795,7 @@ public ILocation getSpawnLocation()

/*
* Dergon bodily appendages.
* Only their hitboxes.
* Only their hit-boxes.
*/
private final EntityComplexPart[] children;
private final EntityComplexPart dergonHead;
Expand Down
2 changes: 1 addition & 1 deletion src/no/runsafe/dergons/DergonHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public int healIfFightingDergon(IPlayer player)
dergonID = entry.getKey();
Dergons.Debugger.debugInfo("Healing dergon with ID: " + dergonID);
activeDergons.get(dergonID).heal(Config.getHealAmount());
// Continue to the next dergon incase the player is fighting multiple dergons
// Continue to the next dergon in case the player is fighting multiple dergons
}
return dergonID;
}
Expand Down
2 changes: 1 addition & 1 deletion src/no/runsafe/dergons/EventMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void OnPlayerDeathEvent(RunsafePlayerDeathEvent event)
@Override
public void OnChunkUnload(IChunk chunk)
{
// Check if player unloaded a chunk with a dergon in it so we can register it.
// Check if player unloaded a chunk with a dergon in it, so we can register it.
if (handler.getActiveDergons().isEmpty())
return;

Expand Down
4 changes: 2 additions & 2 deletions src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Dergons
main: no.runsafe.dergons.Dergons
version: 1.0.@BUILD@
author: Kruithne
author: Kruithne, DevelopDeborah
depend: [RunsafeWorldGuardBridge]
description:
description: They aren't dragons
commands:
dergons:
description: Dergon related commands

0 comments on commit 1630b8d

Please sign in to comment.