Skip to content

Commit

Permalink
Merge branch 'master' into drops
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Aug 21, 2024
2 parents 756b5c0 + 149c3fc commit ec8f4ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void onLivingUpdate() {
/// Called each tick this entity's attack target can be seen.
@Override
protected void attackEntity(Entity target, float distance) {
// TODO: Remove code duplication between EntityFishingZombie, EntityFishingPigZombie, EntityFishingSilverfish
super.attackEntity(target, distance);
if (!this.worldObj.isRemote && this.rodTime <= 0 && this.getFishingRod()) {
if (distance > 3.0F && distance < 10.0F) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void onLivingUpdate() {
/// Called each tick this entity's attack target can be seen.
@Override
protected void attackEntity(Entity target, float distance) {
// TODO: Remove code duplication between EntityFishingZombie, EntityFishingPigZombie, EntityFishingSilverfish
super.attackEntity(target, distance);
if (!this.worldObj.isRemote && this.rodTime <= 0) {
if (distance > 3.0F && distance < 10.0F) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ public ItemStack getHeldItem() {
/// Called every tick while this entity is alive.
@Override
public void onLivingUpdate() {
// TODO: Remove code duplication between EntityFishingZombie, EntityFishingPigZombie, EntityFishingSilverfish
// EntityFishingZombie is implemented via onLivingUpdate instead of attackEntity because Zombies use the new
// Mob AI. Could the fishing behavior be migrated to a Task in the new Mob AI system?
if (this.rodTime > 0) {
this.rodTime--;
}
if (!this.worldObj.isRemote && this.rodTime <= 0 && this.getFishingRod()) {
if (!this.worldObj.isRemote && this.rodTime <= 0 && this.getFishingRod() && !this.isMovementBlocked()) {
Entity target = this.getAttackTarget();
if (target != null) {
float distanceSq = (float) this.getDistanceSqToEntity(target);
Expand Down

0 comments on commit ec8f4ac

Please sign in to comment.