diff --git a/modules/API/src/main/java/de/Keyle/MyPet/api/entity/MyPetMinecraftEntity.java b/modules/API/src/main/java/de/Keyle/MyPet/api/entity/MyPetMinecraftEntity.java
index 436ce4957e..fe00d3e7e8 100644
--- a/modules/API/src/main/java/de/Keyle/MyPet/api/entity/MyPetMinecraftEntity.java
+++ b/modules/API/src/main/java/de/Keyle/MyPet/api/entity/MyPetMinecraftEntity.java
@@ -20,15 +20,16 @@
package de.Keyle.MyPet.api.entity;
-import de.Keyle.MyPet.api.entity.ai.AIGoalSelector;
-import de.Keyle.MyPet.api.entity.ai.navigation.AbstractNavigation;
-import de.Keyle.MyPet.api.entity.ai.target.TargetPriority;
-import de.Keyle.MyPet.api.player.MyPetPlayer;
+import java.util.UUID;
+
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
-import java.util.UUID;
+import de.Keyle.MyPet.api.entity.ai.AIGoalSelector;
+import de.Keyle.MyPet.api.entity.ai.navigation.AbstractNavigation;
+import de.Keyle.MyPet.api.entity.ai.target.TargetPriority;
+import de.Keyle.MyPet.api.player.MyPetPlayer;
public interface MyPetMinecraftEntity {
boolean isMyPet();
@@ -57,12 +58,8 @@ public interface MyPetMinecraftEntity {
void updateVisuals();
- LivingEntity getTarget();
-
TargetPriority getTargetPriority();
- void setTarget(LivingEntity entity, TargetPriority priority);
-
void forgetTarget();
boolean hasTarget();
@@ -78,4 +75,8 @@ public interface MyPetMinecraftEntity {
boolean isSitting();
UUID getUniqueID();
+
+ LivingEntity getMyPetTarget();
+
+ void setMyPetTarget(LivingEntity entity, TargetPriority priority);
}
\ No newline at end of file
diff --git a/modules/API/src/main/java/de/Keyle/MyPet/api/util/inventory/CustomInventory.java b/modules/API/src/main/java/de/Keyle/MyPet/api/util/inventory/CustomInventory.java
index ae4a5800ef..8367448e49 100644
--- a/modules/API/src/main/java/de/Keyle/MyPet/api/util/inventory/CustomInventory.java
+++ b/modules/API/src/main/java/de/Keyle/MyPet/api/util/inventory/CustomInventory.java
@@ -27,8 +27,6 @@
import org.bukkit.inventory.ItemStack;
public interface CustomInventory {
- int getSize();
-
void setSize(int size);
String getName();
diff --git a/modules/MyPet/pom.xml b/modules/MyPet/pom.xml
index aea224a91f..74cba96a27 100644
--- a/modules/MyPet/pom.xml
+++ b/modules/MyPet/pom.xml
@@ -24,7 +24,7 @@
de.keyle
mypet
- 3.12-dev4
+ 3.12-dev5
jar
MyPet
https://www.spigotmc.org/resources/mypet.12725/
diff --git a/modules/Plugin/src/main/java/de/Keyle/MyPet/listeners/MyPetEntityListener.java b/modules/Plugin/src/main/java/de/Keyle/MyPet/listeners/MyPetEntityListener.java
index 8c56c83156..e836ab1876 100644
--- a/modules/Plugin/src/main/java/de/Keyle/MyPet/listeners/MyPetEntityListener.java
+++ b/modules/Plugin/src/main/java/de/Keyle/MyPet/listeners/MyPetEntityListener.java
@@ -507,7 +507,7 @@ public void onMyPet(final EntityDeathEvent event) {
if (deadBehaviorSkill.getBehavior() == BehaviorMode.Duel && killerBehaviorSkill.getBehavior() == BehaviorMode.Duel) {
MyPetMinecraftEntity myPetEntity = ((MyPetBukkitEntity) deadEntity).getHandle();
- if (e.getDamager().equals(myPetEntity.getTarget())) {
+ if (e.getDamager().equals(myPetEntity.getMyPetTarget())) {
myPet.setRespawnTime(10);
killerMyPet.setHealth(Double.MAX_VALUE);
}
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/CraftMyPet.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/CraftMyPet.java
index dd5679f3ee..b85b1c49c3 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/CraftMyPet.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/CraftMyPet.java
@@ -123,7 +123,7 @@ public void forgetTarget() {
}
public void setTarget(LivingEntity target, TargetPriority priority) {
- getHandle().setTarget(target, priority);
+ getHandle().setMyPetTarget(target, priority);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
index 6a497931d2..6def656fa4 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
@@ -198,8 +198,9 @@ public boolean hasTarget() {
public TargetPriority getTargetPriority() {
return targetPriority;
}
-
- public LivingEntity getTarget() {
+
+ @Override
+ public LivingEntity getMyPetTarget() {
if (target != null) {
if (target.isAlive()) {
return (LivingEntity) target.getBukkitEntity();
@@ -208,8 +209,9 @@ public LivingEntity getTarget() {
}
return null;
}
-
- public void setTarget(LivingEntity entity, TargetPriority priority) {
+
+ @Override
+ public void setMyPetTarget(LivingEntity entity, TargetPriority priority) {
if (entity == null || entity.isDead() || entity instanceof ArmorStand || !(entity instanceof CraftLivingEntity)) {
forgetTarget();
return;
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/MeleeAttack.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/MeleeAttack.java
index a1ea362eeb..5fa9792086 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/MeleeAttack.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/MeleeAttack.java
@@ -58,7 +58,7 @@ public boolean shouldStart() {
if (!this.petEntity.hasTarget()) {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (targetEntity instanceof EntityArmorStand) {
return false;
@@ -92,7 +92,7 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!this.petEntity.hasTarget() || !this.petEntity.canMove()) {
return true;
- } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getTarget()) {
+ } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getMyPetTarget()) {
return true;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.e(targetEntity.locX, targetEntity.getBoundingBox().b, targetEntity.locZ) >= 20) {
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/RangedAttack.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/RangedAttack.java
index c441b894e5..35b2eb4d03 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/RangedAttack.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/attack/RangedAttack.java
@@ -63,7 +63,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getMyPetTarget()).getHandle();
if (target instanceof EntityArmorStand) {
return false;
@@ -102,7 +102,7 @@ public boolean shouldFinish() {
if (!entityMyPet.hasTarget() || myPet.getRangedDamage() <= 0 || !entityMyPet.canMove()) {
return true;
}
- if (this.target.getBukkitEntity() != entityMyPet.getTarget()) {
+ if (this.target.getBukkitEntity() != entityMyPet.getMyPetTarget()) {
return true;
}
double meleeDamage = myPet.getDamage();
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/EatGrass.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/EatGrass.java
index 89cbae525e..ef2a849399 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/EatGrass.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/EatGrass.java
@@ -51,7 +51,7 @@ public boolean shouldStart() {
return false;
} else if (entityMySheep.getRandom().nextInt(1000) != 0) {
return false;
- } else if (this.entityMySheep.getTarget() != null && !this.entityMySheep.getTarget().isDead()) {
+ } else if (this.entityMySheep.getMyPetTarget() != null && !this.entityMySheep.getMyPetTarget().isDead()) {
return false;
}
int blockLocX = MathHelper.floor(this.entityMySheep.locX);
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/FollowOwner.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/FollowOwner.java
index d664e8ef6b..9c47474fae 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/FollowOwner.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/FollowOwner.java
@@ -59,7 +59,7 @@ public boolean shouldStart() {
}
if (!this.petEntity.canMove()) {
return false;
- } else if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ } else if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
} else if (this.petEntity.getOwner() == null) {
return false;
@@ -81,7 +81,7 @@ public boolean shouldFinish() {
return true;
} else if (!this.petEntity.canMove()) {
return true;
- } else if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ } else if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return true;
}
return false;
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/LookAtPlayer.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/LookAtPlayer.java
index ea7e436310..87e01b4848 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/LookAtPlayer.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/LookAtPlayer.java
@@ -50,7 +50,7 @@ public boolean shouldStart() {
if (this.petEntity.getRandom().nextFloat() >= this.lookAtPlayerChance) {
return false;
}
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/RandomLookaround.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/RandomLookaround.java
index 7a6da393f6..1250160de9 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/RandomLookaround.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/RandomLookaround.java
@@ -37,7 +37,7 @@ public RandomLookaround(EntityMyPet petEntity) {
@Override
public boolean shouldStart() {
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/Sprint.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/Sprint.java
index e00b695723..9d2ccf1658 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/Sprint.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/movement/Sprint.java
@@ -58,7 +58,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorAggressiveTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorAggressiveTarget.java
index ba226bace6..017cde8a0b 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorAggressiveTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorAggressiveTarget.java
@@ -107,11 +107,11 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!petEntity.canMove()) {
return true;
- } else if (petEntity.getTarget() == null) {
+ } else if (petEntity.getMyPetTarget() == null) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -133,7 +133,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorDuelTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorDuelTarget.java
index cef6a52c66..88e543c827 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorDuelTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorDuelTarget.java
@@ -99,7 +99,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
Behavior behaviorSkill = myPet.getSkills().get(Behavior.class);
if (behaviorSkill.getBehavior() != BehaviorMode.Duel) {
@@ -118,7 +118,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
+ petEntity.setMyPetTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
setDuelOpponent(this.target);
if (target.getTargetSelector().hasGoal("DuelTarget")) {
BehaviorDuelTarget duelGoal = (BehaviorDuelTarget) target.getTargetSelector().getGoal("DuelTarget");
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorFarmTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorFarmTarget.java
index 9263b0a06a..bab5b156b4 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorFarmTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/BehaviorFarmTarget.java
@@ -87,7 +87,7 @@ public boolean shouldFinish() {
if (!this.petEntity.hasTarget()) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -109,7 +109,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/ControlTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/ControlTarget.java
index 021918a57c..2b220f00b7 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/ControlTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/ControlTarget.java
@@ -129,7 +129,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -143,7 +143,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/HurtByTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/HurtByTarget.java
index 359892ceba..60bee00a07 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/HurtByTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/HurtByTarget.java
@@ -98,7 +98,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -112,7 +112,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/OwnerHurtByTarget.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/OwnerHurtByTarget.java
index c5e30a8c08..f404c62e0a 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/OwnerHurtByTarget.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/ai/target/OwnerHurtByTarget.java
@@ -125,7 +125,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -139,7 +139,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
}
@Override
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/types/EntityMyRabbit.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/types/EntityMyRabbit.java
index 21eb63e219..1f5f51c655 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/types/EntityMyRabbit.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/types/EntityMyRabbit.java
@@ -98,7 +98,7 @@ public void onLivingUpdate() {
if (this.onGround && getNavigation().l() != null && jumpDelay-- <= 0) {
getControllerJump().a();
jumpDelay = (this.random.nextInt(10) + 10);
- if (getTarget() != null) {
+ if (getMyPetTarget() != null) {
jumpDelay /= 3;
}
this.world.broadcastEntityEffect(this, (byte) 1);
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/CraftMyPet.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/CraftMyPet.java
index e35988e647..fdb186bd56 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/CraftMyPet.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/CraftMyPet.java
@@ -165,7 +165,7 @@ public void forgetTarget() {
@Override
public void setTarget(LivingEntity target, TargetPriority priority) {
- getHandle().setTarget(target, priority);
+ getHandle().setMyPetTarget(target, priority);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/EntityMyPet.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/EntityMyPet.java
index 5790a8752e..96fcf24553 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/EntityMyPet.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/EntityMyPet.java
@@ -228,7 +228,7 @@ public TargetPriority getTargetPriority() {
}
@Override
- public LivingEntity getTarget() {
+ public LivingEntity getMyPetTarget() {
if (target != null) {
if (target.isAlive()) {
return (LivingEntity) target.getBukkitEntity();
@@ -239,7 +239,7 @@ public LivingEntity getTarget() {
}
@Override
- public void setTarget(LivingEntity entity, TargetPriority priority) {
+ public void setMyPetTarget(LivingEntity entity, TargetPriority priority) {
if (entity == null || entity.isDead() || entity instanceof ArmorStand || !(entity instanceof CraftLivingEntity)) {
forgetTarget();
return;
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/MeleeAttack.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/MeleeAttack.java
index 490a580be2..bb7628cd9c 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/MeleeAttack.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/MeleeAttack.java
@@ -59,7 +59,7 @@ public boolean shouldStart() {
if (!this.petEntity.hasTarget()) {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (targetEntity instanceof EntityArmorStand) {
return false;
@@ -93,7 +93,7 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!this.petEntity.hasTarget() || !this.petEntity.canMove()) {
return true;
- } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getTarget()) {
+ } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getMyPetTarget()) {
return true;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.g(targetEntity.locX(), targetEntity.getBoundingBox().minY, targetEntity.locZ()) >= 20) {
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/RangedAttack.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/RangedAttack.java
index cee906cbc4..52439b54f9 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/RangedAttack.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/attack/RangedAttack.java
@@ -63,7 +63,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getMyPetTarget()).getHandle();
if (target instanceof EntityArmorStand) {
return false;
@@ -102,7 +102,7 @@ public boolean shouldFinish() {
if (!entityMyPet.hasTarget() || myPet.getRangedDamage() <= 0 || !entityMyPet.canMove()) {
return true;
}
- if (this.target.getBukkitEntity() != entityMyPet.getTarget()) {
+ if (this.target.getBukkitEntity() != entityMyPet.getMyPetTarget()) {
return true;
}
double meleeDamage = myPet.getDamage();
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/EatGrass.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/EatGrass.java
index a203ed0dc9..4a86b9f8c8 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/EatGrass.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/EatGrass.java
@@ -52,7 +52,7 @@ public boolean shouldStart() {
return false;
} else if (entityMySheep.getRandom().nextInt(1000) != 0) {
return false;
- } else if (this.entityMySheep.getTarget() != null && !this.entityMySheep.getTarget().isDead()) {
+ } else if (this.entityMySheep.getMyPetTarget() != null && !this.entityMySheep.getMyPetTarget().isDead()) {
return false;
}
int blockLocX = MathHelper.floor(this.entityMySheep.locX());
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/FollowOwner.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/FollowOwner.java
index 239efcdc35..6f8c610dc6 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/FollowOwner.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/FollowOwner.java
@@ -60,7 +60,7 @@ public boolean shouldStart() {
}
if (!this.petEntity.canMove()) {
return false;
- } else if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ } else if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
} else if (this.petEntity.getOwner() == null) {
return false;
@@ -82,7 +82,7 @@ public boolean shouldFinish() {
return true;
} else if (!this.petEntity.canMove()) {
return true;
- } else if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ } else if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return true;
}
return false;
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/LookAtPlayer.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/LookAtPlayer.java
index 8fc353acb6..2c6d3e590d 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/LookAtPlayer.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/LookAtPlayer.java
@@ -51,7 +51,7 @@ public boolean shouldStart() {
if (this.petEntity.getRandom().nextFloat() >= this.lookAtPlayerChance) {
return false;
}
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/RandomLookaround.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/RandomLookaround.java
index ce42e7cb2f..3c5af13de4 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/RandomLookaround.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/RandomLookaround.java
@@ -38,7 +38,7 @@ public RandomLookaround(EntityMyPet petEntity) {
@Override
public boolean shouldStart() {
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/Sprint.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/Sprint.java
index 4c1b7c9c1e..827aee058d 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/Sprint.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/movement/Sprint.java
@@ -59,7 +59,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorAggressiveTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorAggressiveTarget.java
index 66c97faa60..b5e68f685b 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorAggressiveTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorAggressiveTarget.java
@@ -108,11 +108,11 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!petEntity.canMove()) {
return true;
- } else if (petEntity.getTarget() == null) {
+ } else if (petEntity.getMyPetTarget() == null) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -134,7 +134,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorDuelTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorDuelTarget.java
index a354f21753..a6ca578774 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorDuelTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorDuelTarget.java
@@ -100,7 +100,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
Behavior behaviorSkill = myPet.getSkills().get(Behavior.class);
if (behaviorSkill.getBehavior() != BehaviorMode.Duel) {
@@ -119,7 +119,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
+ petEntity.setMyPetTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
setDuelOpponent(this.target);
if (target.getTargetSelector().hasGoal("DuelTarget")) {
BehaviorDuelTarget duelGoal = (BehaviorDuelTarget) target.getTargetSelector().getGoal("DuelTarget");
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorFarmTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorFarmTarget.java
index f994fc287b..af86e12062 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorFarmTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/BehaviorFarmTarget.java
@@ -88,7 +88,7 @@ public boolean shouldFinish() {
if (!this.petEntity.hasTarget()) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -110,7 +110,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/ControlTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/ControlTarget.java
index 1d86df1031..0c37d005cc 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/ControlTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/ControlTarget.java
@@ -130,7 +130,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -144,7 +144,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/HurtByTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/HurtByTarget.java
index fa04c3049f..5192311147 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/HurtByTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/HurtByTarget.java
@@ -99,7 +99,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -113,7 +113,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/OwnerHurtByTarget.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/OwnerHurtByTarget.java
index ba258dfc84..0fe84deafa 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/OwnerHurtByTarget.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/ai/target/OwnerHurtByTarget.java
@@ -126,7 +126,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -140,7 +140,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
}
@Override
diff --git a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/types/EntityMyRabbit.java b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/types/EntityMyRabbit.java
index c6ae649def..4963d26ab3 100644
--- a/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/types/EntityMyRabbit.java
+++ b/modules/v1_16_R1/src/main/java/de/Keyle/MyPet/compat/v1_16_R1/entity/types/EntityMyRabbit.java
@@ -101,7 +101,7 @@ public void onLivingUpdate() {
if (this.onGround && getNavigation().k() != null && jumpDelay-- <= 0) {
getControllerJump().jump();
jumpDelay = (this.random.nextInt(10) + 10);
- if (getTarget() != null) {
+ if (getMyPetTarget() != null) {
jumpDelay /= 3;
}
this.world.broadcastEntityEffect(this, (byte) 1);
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/CraftMyPet.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/CraftMyPet.java
index 8ff6b97072..b00b5ec047 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/CraftMyPet.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/CraftMyPet.java
@@ -200,7 +200,7 @@ public void forgetTarget() {
@Override
public void setTarget(LivingEntity target, TargetPriority priority) {
- getHandle().setTarget(target, priority);
+ getHandle().setMyPetTarget(target, priority);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityMyPet.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityMyPet.java
index f9e08afb6d..c60e7f15a1 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityMyPet.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityMyPet.java
@@ -20,13 +20,45 @@
package de.Keyle.MyPet.compat.v1_16_R3.entity;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.Color;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap;
+import org.bukkit.craftbukkit.v1_16_R3.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_16_R3.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
+import org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory;
+import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.v1_16_R3.util.CraftChatMessage;
+import org.bukkit.entity.ArmorStand;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
+import org.bukkit.event.player.PlayerMoveEvent;
+import org.bukkit.event.player.PlayerTeleportEvent;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.scheduler.BukkitRunnable;
+
import com.google.common.base.Preconditions;
+
import de.Keyle.MyPet.MyPetApi;
import de.Keyle.MyPet.api.Configuration;
import de.Keyle.MyPet.api.Util;
import de.Keyle.MyPet.api.compat.ParticleCompat;
import de.Keyle.MyPet.api.entity.EntitySize;
-import de.Keyle.MyPet.api.entity.*;
+import de.Keyle.MyPet.api.entity.JumpHelper;
+import de.Keyle.MyPet.api.entity.MyPet;
+import de.Keyle.MyPet.api.entity.MyPetBaby;
+import de.Keyle.MyPet.api.entity.MyPetMinecraftEntity;
+import de.Keyle.MyPet.api.entity.MyPetType;
import de.Keyle.MyPet.api.entity.ai.AIGoalSelector;
import de.Keyle.MyPet.api.entity.ai.navigation.AbstractNavigation;
import de.Keyle.MyPet.api.entity.ai.target.TargetPriority;
@@ -43,40 +75,57 @@
import de.Keyle.MyPet.compat.v1_16_R3.PlatformHelper;
import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.attack.MeleeAttack;
import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.attack.RangedAttack;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.Control;
import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.Float;
-import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.*;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.FollowOwner;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.LookAtPlayer;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.RandomLookaround;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.Sit;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.movement.Sprint;
import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.navigation.VanillaNavigation;
-import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.*;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.BehaviorAggressiveTarget;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.BehaviorDuelTarget;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.BehaviorFarmTarget;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.ControlTarget;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.HurtByTarget;
+import de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target.OwnerHurtByTarget;
import de.Keyle.MyPet.compat.v1_16_R3.entity.types.EntityMyHorse;
import de.Keyle.MyPet.skill.skills.ControlImpl;
import de.Keyle.MyPet.skill.skills.RideImpl;
-import net.minecraft.server.v1_16_R3.*;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.Color;
-import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap;
-import org.bukkit.craftbukkit.v1_16_R3.entity.CraftEntity;
-import org.bukkit.craftbukkit.v1_16_R3.entity.CraftLivingEntity;
-import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
-import org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory;
-import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack;
-import org.bukkit.craftbukkit.v1_16_R3.util.CraftChatMessage;
-import org.bukkit.entity.ArmorStand;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
-import org.bukkit.event.Cancellable;
-import org.bukkit.event.Event;
-import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
-import org.bukkit.event.player.PlayerMoveEvent;
-import org.bukkit.event.player.PlayerTeleportEvent;
-import org.bukkit.potion.PotionEffect;
-import org.bukkit.potion.PotionEffectType;
-import org.bukkit.scheduler.BukkitRunnable;
-
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.util.List;
+import net.minecraft.server.v1_16_R3.AttributeMapBase;
+import net.minecraft.server.v1_16_R3.AttributeProvider;
+import net.minecraft.server.v1_16_R3.AxisAlignedBB;
+import net.minecraft.server.v1_16_R3.BlockPosition;
+import net.minecraft.server.v1_16_R3.DamageSource;
+import net.minecraft.server.v1_16_R3.DataWatcherObject;
+import net.minecraft.server.v1_16_R3.Entity;
+import net.minecraft.server.v1_16_R3.EntityHuman;
+import net.minecraft.server.v1_16_R3.EntityInsentient;
+import net.minecraft.server.v1_16_R3.EntityLiving;
+import net.minecraft.server.v1_16_R3.EntityPlayer;
+import net.minecraft.server.v1_16_R3.EntityPose;
+import net.minecraft.server.v1_16_R3.EntityTypes;
+import net.minecraft.server.v1_16_R3.EnumHand;
+import net.minecraft.server.v1_16_R3.EnumInteractionResult;
+import net.minecraft.server.v1_16_R3.EnumMoveType;
+import net.minecraft.server.v1_16_R3.GenericAttributes;
+import net.minecraft.server.v1_16_R3.IBlockData;
+import net.minecraft.server.v1_16_R3.IChatBaseComponent;
+import net.minecraft.server.v1_16_R3.IJumpable;
+import net.minecraft.server.v1_16_R3.IRegistry;
+import net.minecraft.server.v1_16_R3.ItemStack;
+import net.minecraft.server.v1_16_R3.Items;
+import net.minecraft.server.v1_16_R3.MathHelper;
+import net.minecraft.server.v1_16_R3.MinecraftKey;
+import net.minecraft.server.v1_16_R3.NBTTagCompound;
+import net.minecraft.server.v1_16_R3.PacketPlayOutAttachEntity;
+import net.minecraft.server.v1_16_R3.PacketPlayOutNamedSoundEffect;
+import net.minecraft.server.v1_16_R3.PotionUtil;
+import net.minecraft.server.v1_16_R3.SoundCategory;
+import net.minecraft.server.v1_16_R3.SoundEffect;
+import net.minecraft.server.v1_16_R3.TagsFluid;
+import net.minecraft.server.v1_16_R3.Vec3D;
+import net.minecraft.server.v1_16_R3.World;
public abstract class EntityMyPet extends EntityInsentient implements MyPetMinecraftEntity {
@@ -228,7 +277,7 @@ public TargetPriority getTargetPriority() {
}
@Override
- public LivingEntity getTarget() {
+ public LivingEntity getMyPetTarget() {
if (target != null) {
if (target.isAlive()) {
return (LivingEntity) target.getBukkitEntity();
@@ -239,7 +288,7 @@ public LivingEntity getTarget() {
}
@Override
- public void setTarget(LivingEntity entity, TargetPriority priority) {
+ public void setMyPetTarget(LivingEntity entity, TargetPriority priority) {
if (entity == null || entity.isDead() || entity instanceof ArmorStand || !(entity instanceof CraftLivingEntity)) {
forgetTarget();
return;
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityRegistry.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityRegistry.java
index 04892176fe..c652587cab 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityRegistry.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/EntityRegistry.java
@@ -20,8 +20,19 @@
package de.Keyle.MyPet.compat.v1_16_R3.entity;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.bukkit.ChatColor;
+import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
+
import de.Keyle.MyPet.MyPetApi;
import de.Keyle.MyPet.api.Util;
import de.Keyle.MyPet.api.entity.MyPet;
@@ -30,16 +41,15 @@
import de.Keyle.MyPet.api.util.Compat;
import de.Keyle.MyPet.api.util.ReflectionUtil;
import lombok.SneakyThrows;
-import net.minecraft.server.v1_16_R3.*;
-import org.bukkit.ChatColor;
-import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
+import net.minecraft.server.v1_16_R3.EntityLiving;
+import net.minecraft.server.v1_16_R3.EntitySize;
+import net.minecraft.server.v1_16_R3.EntityTypes;
+import net.minecraft.server.v1_16_R3.EnumCreatureType;
+import net.minecraft.server.v1_16_R3.IRegistry;
+import net.minecraft.server.v1_16_R3.MinecraftKey;
+import net.minecraft.server.v1_16_R3.RegistryBlocks;
+import net.minecraft.server.v1_16_R3.RegistryMaterials;
+import net.minecraft.server.v1_16_R3.World;
@Compat("v1_16_R3")
public class EntityRegistry extends de.Keyle.MyPet.api.entity.EntityRegistry {
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/MeleeAttack.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/MeleeAttack.java
index 892bb96d0b..8d8950d61b 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/MeleeAttack.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/MeleeAttack.java
@@ -59,7 +59,7 @@ public boolean shouldStart() {
if (!this.petEntity.hasTarget()) {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (targetEntity instanceof EntityArmorStand) {
return false;
@@ -93,7 +93,7 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!this.petEntity.hasTarget() || !this.petEntity.canMove()) {
return true;
- } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getTarget()) {
+ } else if (this.targetEntity.getBukkitEntity() != this.petEntity.getMyPetTarget()) {
return true;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.h(targetEntity.locX(), targetEntity.getBoundingBox().minY, targetEntity.locZ()) >= 20) {
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/RangedAttack.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/RangedAttack.java
index 059553dfac..2366cca82f 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/RangedAttack.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/attack/RangedAttack.java
@@ -63,7 +63,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getMyPetTarget()).getHandle();
if (target instanceof EntityArmorStand) {
return false;
@@ -102,7 +102,7 @@ public boolean shouldFinish() {
if (!entityMyPet.hasTarget() || myPet.getRangedDamage() <= 0 || !entityMyPet.canMove()) {
return true;
}
- if (this.target.getBukkitEntity() != entityMyPet.getTarget()) {
+ if (this.target.getBukkitEntity() != entityMyPet.getMyPetTarget()) {
return true;
}
double meleeDamage = myPet.getDamage();
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/EatGrass.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/EatGrass.java
index 6bc90d5069..0b03f7c049 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/EatGrass.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/EatGrass.java
@@ -52,7 +52,7 @@ public boolean shouldStart() {
return false;
} else if (entityMySheep.getRandom().nextInt(1000) != 0) {
return false;
- } else if (this.entityMySheep.getTarget() != null && !this.entityMySheep.getTarget().isDead()) {
+ } else if (this.entityMySheep.getMyPetTarget() != null && !this.entityMySheep.getMyPetTarget().isDead()) {
return false;
}
int blockLocX = MathHelper.floor(this.entityMySheep.locX());
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/FollowOwner.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/FollowOwner.java
index 5d823ab420..7089ec8fc4 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/FollowOwner.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/FollowOwner.java
@@ -60,7 +60,7 @@ public boolean shouldStart() {
}
if (!this.petEntity.canMove()) {
return false;
- } else if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ } else if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
} else if (this.petEntity.getOwner() == null) {
return false;
@@ -79,7 +79,7 @@ public boolean shouldFinish() {
return true;
} else if (!this.petEntity.canMove()) {
return true;
- } else return this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead();
+ } else return this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead();
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/LookAtPlayer.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/LookAtPlayer.java
index a40055f550..f64f1db0ac 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/LookAtPlayer.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/LookAtPlayer.java
@@ -51,7 +51,7 @@ public boolean shouldStart() {
if (this.petEntity.getRandom().nextFloat() >= this.lookAtPlayerChance) {
return false;
}
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/RandomLookaround.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/RandomLookaround.java
index 62e4c205c7..bc0ebb5636 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/RandomLookaround.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/RandomLookaround.java
@@ -38,7 +38,7 @@ public RandomLookaround(EntityMyPet petEntity) {
@Override
public boolean shouldStart() {
- if (this.petEntity.getTarget() != null && !this.petEntity.getTarget().isDead()) {
+ if (this.petEntity.getMyPetTarget() != null && !this.petEntity.getMyPetTarget().isDead()) {
return false;
}
if (this.petEntity.isVehicle()) {
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/Sprint.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/Sprint.java
index b4df44a528..ca10482be8 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/Sprint.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/movement/Sprint.java
@@ -59,7 +59,7 @@ public boolean shouldStart() {
return false;
}
- EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorAggressiveTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorAggressiveTarget.java
index 071426fb68..67bb7da590 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorAggressiveTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorAggressiveTarget.java
@@ -108,11 +108,11 @@ public boolean shouldStart() {
public boolean shouldFinish() {
if (!petEntity.canMove()) {
return true;
- } else if (petEntity.getTarget() == null) {
+ } else if (petEntity.getMyPetTarget() == null) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -131,7 +131,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Aggressive);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorDuelTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorDuelTarget.java
index 1af0d44d10..f478c0089c 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorDuelTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorDuelTarget.java
@@ -100,7 +100,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
Behavior behaviorSkill = myPet.getSkills().get(Behavior.class);
if (behaviorSkill.getBehavior() != BehaviorMode.Duel) {
@@ -116,7 +116,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
+ petEntity.setMyPetTarget(this.target.getBukkitEntity(), TargetPriority.Duel);
setDuelOpponent(this.target);
if (target.getTargetSelector().hasGoal("DuelTarget")) {
BehaviorDuelTarget duelGoal = (BehaviorDuelTarget) target.getTargetSelector().getGoal("DuelTarget");
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorFarmTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorFarmTarget.java
index a05f0cc8c7..8230e4a1fa 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorFarmTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/BehaviorFarmTarget.java
@@ -88,7 +88,7 @@ public boolean shouldFinish() {
if (!this.petEntity.hasTarget()) {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (!target.isAlive()) {
return true;
@@ -107,7 +107,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Farm);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/ControlTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/ControlTarget.java
index 2e12e3e778..88c8c21825 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/ControlTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/ControlTarget.java
@@ -20,6 +20,11 @@
package de.Keyle.MyPet.compat.v1_16_R3.entity.ai.target;
+import org.bukkit.craftbukkit.v1_16_R3.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+
import de.Keyle.MyPet.MyPetApi;
import de.Keyle.MyPet.api.entity.MyPet;
import de.Keyle.MyPet.api.entity.ai.AIGoal;
@@ -33,10 +38,6 @@
import net.minecraft.server.v1_16_R3.EntityLiving;
import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R3.EntityTameableAnimal;
-import org.bukkit.craftbukkit.v1_16_R3.entity.CraftLivingEntity;
-import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
@Compat("v1_16_R3")
public class ControlTarget implements AIGoal {
@@ -130,7 +131,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -141,7 +142,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.Control);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/HurtByTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/HurtByTarget.java
index 5603928f06..b8cbc622cb 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/HurtByTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/HurtByTarget.java
@@ -99,7 +99,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -110,7 +110,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.target.getBukkitEntity(), TargetPriority.GetHurt);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/OwnerHurtByTarget.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/OwnerHurtByTarget.java
index a780570022..c2370912c8 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/OwnerHurtByTarget.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/ai/target/OwnerHurtByTarget.java
@@ -124,7 +124,7 @@ public boolean shouldFinish() {
return true;
}
- EntityLiving target = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
+ EntityLiving target = ((CraftLivingEntity) this.petEntity.getMyPetTarget()).getHandle();
if (target.world != petEntity.world) {
return true;
@@ -135,7 +135,7 @@ public boolean shouldFinish() {
@Override
public void start() {
- petEntity.setTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
+ petEntity.setMyPetTarget((LivingEntity) this.lastDamager.getBukkitEntity(), TargetPriority.OwnerGetsHurt);
}
@Override
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/types/EntityMyRabbit.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/types/EntityMyRabbit.java
index f35a00a4ac..442c291a1a 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/types/EntityMyRabbit.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/entity/types/EntityMyRabbit.java
@@ -101,7 +101,7 @@ public void onLivingUpdate() {
if (this.onGround && getNavigation().k() != null && jumpDelay-- <= 0) {
getControllerJump().jump();
jumpDelay = (this.random.nextInt(10) + 10);
- if (getTarget() != null) {
+ if (getMyPetTarget() != null) {
jumpDelay /= 3;
}
this.world.broadcastEntityEffect(this, (byte) 1);
diff --git a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/skill/skills/ranged/nms/MyPetArrow.java b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/skill/skills/ranged/nms/MyPetArrow.java
index 5db0054963..6985ecace0 100644
--- a/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/skill/skills/ranged/nms/MyPetArrow.java
+++ b/modules/v1_16_R3/src/main/java/de/Keyle/MyPet/compat/v1_16_R3/skill/skills/ranged/nms/MyPetArrow.java
@@ -24,7 +24,12 @@
import de.Keyle.MyPet.api.util.Compat;
import de.Keyle.MyPet.compat.v1_16_R3.entity.EntityMyPet;
import de.Keyle.MyPet.compat.v1_16_R3.skill.skills.ranged.bukkit.CraftMyPetArrow;
-import net.minecraft.server.v1_16_R3.*;
+import net.minecraft.server.v1_16_R3.DamageSource;
+import net.minecraft.server.v1_16_R3.EntityTippedArrow;
+import net.minecraft.server.v1_16_R3.ItemStack;
+import net.minecraft.server.v1_16_R3.Items;
+import net.minecraft.server.v1_16_R3.NBTTagCompound;
+import net.minecraft.server.v1_16_R3.World;
@Compat("v1_16_R3")
public class MyPetArrow extends EntityTippedArrow implements EntityMyPetProjectile {
diff --git a/modules/v1_17_R1/pom.xml b/modules/v1_17_R1/pom.xml
index f42b8156a7..f7123d83f7 100644
--- a/modules/v1_17_R1/pom.xml
+++ b/modules/v1_17_R1/pom.xml
@@ -16,18 +16,12 @@
MyPet-v1_17_R1
-
- org.spigotmc
- spigot-api
- 1.17.1-R0.1-SNAPSHOT
- provided
- true
-
org.spigotmc
spigot
1.17.1-R0.1-SNAPSHOT
provided
+ remapped-mojang
true
@@ -73,6 +67,39 @@
true
+
+ net.md-5
+ specialsource-maven-plugin
+ 1.2.2
+
+
+ package
+
+ remap
+
+ remap-obf
+
+ org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:txt:maps-mojang
+ true
+ org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-mojang
+ true
+ remapped-obf
+
+
+
+ package
+
+ remap
+
+ remap-spigot
+
+ ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
+ org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:csrg:maps-spigot
+ org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-obf
+
+
+
+
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/CompatManager.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/CompatManager.java
index 2d9d2f9443..de402f7b38 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/CompatManager.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/CompatManager.java
@@ -20,6 +20,14 @@
package de.Keyle.MyPet.compat.v1_17_R1;
+import java.lang.reflect.Method;
+
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityToggleGlideEvent;
+
import de.Keyle.MyPet.MyPetApi;
import de.Keyle.MyPet.api.entity.MyPet;
import de.Keyle.MyPet.api.util.Compat;
@@ -27,20 +35,13 @@
import de.Keyle.MyPet.compat.v1_17_R1.services.EggIconService;
import de.Keyle.MyPet.compat.v1_17_R1.services.EntityConverterService;
import de.Keyle.MyPet.compat.v1_17_R1.services.RepositoryMyPetConverterService;
-import net.minecraft.world.EnumHand;
-import net.minecraft.world.entity.EntityLiving;
-import org.bukkit.Bukkit;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityToggleGlideEvent;
-
-import java.lang.reflect.Method;
+import net.minecraft.world.InteractionHand;
+import net.minecraft.world.entity.LivingEntity;
@Compat("v1_17_R1")
public class CompatManager extends de.Keyle.MyPet.api.util.CompatManager implements Listener {
- public static Method ENTITY_LIVING_broadcastItemBreak = ReflectionUtil.getMethod(EntityLiving.class, "d", EnumHand.class);
+ public static Method ENTITY_LIVING_broadcastItemBreak = ReflectionUtil.getMethod(LivingEntity.class, "d", InteractionHand.class);
@Override
public void init() {
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/PlatformHelper.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/PlatformHelper.java
index 1b0679d02e..83828c58dc 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/PlatformHelper.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/PlatformHelper.java
@@ -39,7 +39,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Villager;
-import org.bukkit.entity.WanderingTrader;
import org.bukkit.entity.Zombie;
import com.mojang.brigadier.StringReader;
@@ -54,57 +53,54 @@
import de.Keyle.MyPet.api.util.inventory.material.ItemDatabase;
import de.Keyle.MyPet.compat.v1_17_R1.util.inventory.ItemStackNBTConverter;
import de.keyle.knbt.TagCompound;
-import net.minecraft.core.BlockPosition;
-import net.minecraft.core.IRegistry;
-import net.minecraft.core.particles.Particle;
-import net.minecraft.core.particles.ParticleParam;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Registry;
+import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.chat.ChatMessage;
-import net.minecraft.network.chat.ChatMessageType;
-import net.minecraft.network.chat.IChatBaseComponent;
-import net.minecraft.network.protocol.game.PacketPlayOutChat;
-import net.minecraft.network.protocol.game.PacketPlayOutCollect;
-import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect;
-import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
-import net.minecraft.network.protocol.game.PacketPlayOutWorldParticles;
-import net.minecraft.resources.MinecraftKey;
-import net.minecraft.server.level.ChunkProviderServer;
-import net.minecraft.server.level.WorldServer;
-import net.minecraft.sounds.SoundCategory;
-import net.minecraft.sounds.SoundEffects;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.entity.EntityInsentient;
-import net.minecraft.world.entity.EntityLightning;
-import net.minecraft.world.entity.EntityLiving;
-import net.minecraft.world.entity.EntityTypes;
-import net.minecraft.world.entity.item.EntityItem;
-import net.minecraft.world.entity.npc.EntityVillager;
-import net.minecraft.world.entity.npc.EntityVillagerTrader;
-import net.minecraft.world.entity.player.EntityHuman;
-import net.minecraft.world.item.ItemAxe;
-import net.minecraft.world.item.ItemBow;
-import net.minecraft.world.item.ItemCarrotStick;
-import net.minecraft.world.item.ItemCompass;
-import net.minecraft.world.item.ItemCrossbow;
-import net.minecraft.world.item.ItemFishingRod;
-import net.minecraft.world.item.ItemHoe;
-import net.minecraft.world.item.ItemPickaxe;
-import net.minecraft.world.item.ItemShield;
-import net.minecraft.world.item.ItemSign;
-import net.minecraft.world.item.ItemSpade;
+import net.minecraft.core.particles.SimpleParticleType;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.network.chat.ChatType;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
+import net.minecraft.network.protocol.game.ClientboundChatPacket;
+import net.minecraft.network.protocol.game.ClientboundLevelParticlesPacket;
+import net.minecraft.network.protocol.game.ClientboundSoundPacket;
+import net.minecraft.network.protocol.game.ClientboundTakeItemEntityPacket;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.level.ServerChunkCache;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.sounds.SoundEvents;
+import net.minecraft.sounds.SoundSource;
+import net.minecraft.util.Mth;
+import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.entity.LightningBolt;
+import net.minecraft.world.entity.Mob;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.item.AxeItem;
+import net.minecraft.world.item.BowItem;
+import net.minecraft.world.item.CompassItem;
+import net.minecraft.world.item.CrossbowItem;
+import net.minecraft.world.item.FishingRodItem;
+import net.minecraft.world.item.FoodOnAStickItem;
+import net.minecraft.world.item.HoeItem;
import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.ItemSword;
-import net.minecraft.world.item.ItemTrident;
-import net.minecraft.world.level.block.state.IBlockData;
-import net.minecraft.world.phys.AxisAlignedBB;
+import net.minecraft.world.item.PickaxeItem;
+import net.minecraft.world.item.ShieldItem;
+import net.minecraft.world.item.ShovelItem;
+import net.minecraft.world.item.SignItem;
+import net.minecraft.world.item.SwordItem;
+import net.minecraft.world.item.TridentItem;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.shapes.VoxelShape;
@Compat("v1_17_R1")
public class PlatformHelper extends de.Keyle.MyPet.api.PlatformHelper {
- private static final Method ENTITY_LIVING_cD = ReflectionUtil.getMethod(EntityLiving.class, "cT");
- private static final Method CHAT_MESSAGE_k = ReflectionUtil.getMethod(ChatMessage.class, "k");
+ private static final Method ENTITY_LIVING_cD = ReflectionUtil.getMethod(net.minecraft.world.entity.LivingEntity.class, "cT");
+ private static final Method CHAT_MESSAGE_k = ReflectionUtil.getMethod(TranslatableComponent.class, "k");
/**
* @param location the {@link Location} around which players must be to see the effect
@@ -118,33 +114,33 @@ public class PlatformHelper extends de.Keyle.MyPet.api.PlatformHelper {
*/
@Override
public void playParticleEffect(Location location, String effectName, float offsetX, float offsetY, float offsetZ, float speed, int count, int radius, de.Keyle.MyPet.api.compat.Compat