Allow next page and previous page items to be set

This commit is contained in:
fullwall 2023-11-05 17:41:18 +08:00
parent c046404799
commit de885501cd
1330 changed files with 13385 additions and 87 deletions

View File

@ -97,10 +97,9 @@ public class ShopTrait extends Trait {
}
public void onRightClick(Player player) {
if (rightClickShop == null || rightClickShop.isEmpty())
return;
if (!Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString().isEmpty()
&& !player.hasPermission(Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString()))
if (rightClickShop == null || rightClickShop.isEmpty()
|| !Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString().isEmpty()
&& !player.hasPermission(Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString()))
return;
NPCShop shop = shops.globalShops.getOrDefault(rightClickShop, getDefaultShop());
@ -133,18 +132,15 @@ public class ShopTrait extends Trait {
}
public void display(Player sender) {
if (viewPermission != null && !sender.hasPermission(viewPermission))
return;
if (!Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString().isEmpty()
&& !sender.hasPermission(Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString()))
if (viewPermission != null && !sender.hasPermission(viewPermission)
|| !Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString().isEmpty()
&& !sender.hasPermission(Setting.SHOP_GLOBAL_VIEW_PERMISSION.asString()))
return;
if (pages.size() == 0) {
Messaging.sendError(sender, "Empty shop");
return;
}
InventoryMenu.createSelfRegistered(new NPCShopViewer(this, sender)).present(sender);
}
@ -179,7 +175,7 @@ public class ShopTrait extends Trait {
}
public void setPermission(String permission) {
this.viewPermission = permission;
viewPermission = permission;
if (viewPermission != null && viewPermission.isEmpty()) {
viewPermission = null;
}
@ -198,8 +194,8 @@ public class ShopTrait extends Trait {
}
public void changePage(int newPage) {
this.page = newPage;
ctx.setTitle("NPC Shop Contents Editor Page " + newPage);
page = newPage;
ctx.setTitle("NPC Shop Contents Editor (" + (newPage + 1) + "/" + (shop.pages.size() + 1) + ")");
NPCShopPage shopPage = shop.getOrCreatePage(page);
for (int i = 0; i < ctx.getInventory().getSize(); i++) {
InventoryMenuSlot slot = ctx.getSlot(i);
@ -208,8 +204,7 @@ public class ShopTrait extends Trait {
if (shopPage.getItem(i) != null) {
slot.setItemStack(shopPage.getItem(i).getDisplayItem(null));
}
final int idx = i;
int idx = i;
slot.setClickHandler(evt -> {
NPCShopItem display = shopPage.getItem(idx);
if (display != null && evt.isShiftClick() && evt.getCursorNonNull().getType() == Material.AIR
@ -219,7 +214,6 @@ public class ShopTrait extends Trait {
evt.setCancelled(true);
return;
}
if (display == null) {
if (copying != null && evt.getCursorNonNull().getType() != Material.AIR
&& evt.getCursorNonNull().equals(copying.getDisplayItem(null))) {
@ -227,13 +221,11 @@ public class ShopTrait extends Trait {
copying = null;
return;
}
display = new NPCShopItem();
if (evt.getCursor() != null) {
display.display = evt.getCursor().clone();
}
}
ctx.clearSlots();
ctx.getMenu().transition(new NPCShopItemEditor(display, modified -> {
if (modified == null) {
@ -244,12 +236,11 @@ public class ShopTrait extends Trait {
}));
});
}
InventoryMenuSlot prev = ctx.getSlot(4 * 9 + 3);
InventoryMenuSlot edit = ctx.getSlot(4 * 9 + 4);
InventoryMenuSlot next = ctx.getSlot(4 * 9 + 5);
if (page > 0) {
prev.setItemStack(new ItemStack(Material.FEATHER, 1), "Previous page (" + (page) + ")");
prev.setItemStack(shopPage.getNextPageItem(null, 4 * 9 + 3), "Previous page (" + newPage + ")");
Consumer<CitizensInventoryClickEvent> prevItemEditor = prev.getClickHandlers().get(0);
prev.setClickHandler(evt -> {
if (evt.isShiftClick()) {
@ -260,9 +251,8 @@ public class ShopTrait extends Trait {
changePage(page - 1);
});
}
next.setItemStack(new ItemStack(Material.FEATHER, 1),
page + 1 >= shop.pages.size() ? "New page" : "Next page (" + (page + 1) + ")");
next.setItemStack(shopPage.getNextPageItem(null, 4 * 9 + 5),
page + 1 >= shop.pages.size() ? "New page" : "Next page (" + (newPage + 1) + ")");
Consumer<CitizensInventoryClickEvent> nextItemEditor = next.getClickHandlers().get(0);
next.setClickHandler(evt -> {
if (evt.isShiftClick()) {
@ -323,7 +313,7 @@ public class ShopTrait extends Trait {
for (NPCShopAction action : actions) {
Transaction take = func.apply(action);
if (!take.isPossible()) {
pending.forEach(a -> a.rollback());
pending.forEach(Transaction::rollback);
return null;
} else {
take.run();
@ -383,6 +373,7 @@ public class ShopTrait extends Trait {
lore.add(r.describe());
}
});
if (timesPurchasable > 0) {
lore.add("Times purchasable: " + timesPurchasable);
}
@ -431,7 +422,7 @@ public class ShopTrait extends Trait {
if (max == 0)
return;
}
final int repeats = max == Integer.MAX_VALUE ? 1 : max;
int repeats = max == Integer.MAX_VALUE ? 1 : max;
List<Transaction> take = apply(cost, action -> action.take(event.getWhoClicked(), repeats));
if (take == null) {
if (costMessage != null) {
@ -440,7 +431,7 @@ public class ShopTrait extends Trait {
return;
}
if (apply(result, action -> action.grant(event.getWhoClicked(), repeats)) == null) {
take.forEach(a -> a.rollback());
take.forEach(Transaction::rollback);
return;
}
if (resultMessage != null) {
@ -469,7 +460,7 @@ public class ShopTrait extends Trait {
public void save(DataKey key) {
}
private static final Pattern PLACEHOLDER_REGEX = Pattern.compile("<(cost|result)>", Pattern.CASE_INSENSITIVE);
private static Pattern PLACEHOLDER_REGEX = Pattern.compile("<(cost|result)>", Pattern.CASE_INSENSITIVE);
}
@Menu(title = "NPC Shop Item Editor", type = InventoryType.CHEST, dimensions = { 6, 9 })
@ -490,9 +481,9 @@ public class ShopTrait extends Trait {
private final NPCShopItem modified;
public NPCShopItemEditor(NPCShopItem item, Consumer<NPCShopItem> consumer) {
this.base = item;
this.modified = base.clone();
this.callback = consumer;
base = item;
modified = base.clone();
callback = consumer;
}
@Override
@ -520,7 +511,8 @@ public class ShopTrait extends Trait {
ctx.getSlot(9 * 4 + 2).setDescription(modified.alreadyPurchasedMessage);
})));
ctx.getSlot(9 * 3 + 3).setItemStack(new ItemStack(Util.getFallbackMaterial("EMERALD", "OAK_SIGN", "SIGN")),
ctx.getSlot(9 * 3 + 3).setItemStack(
new ItemStack(Util.getFallbackMaterial("GREEN_WOOL", "EMERALD", "OAK_SIGN", "SIGN")),
"Set successful click message, currently:\n",
modified.resultMessage == null ? "Unset" : modified.resultMessage);
ctx.getSlot(9 * 3 + 3).setClickHandler(
@ -529,7 +521,7 @@ public class ShopTrait extends Trait {
ctx.getSlot(9 * 3 + 3).setDescription(modified.resultMessage);
})));
ctx.getSlot(9 * 3 + 6).setItemStack(new ItemStack(Util.getFallbackMaterial("BARRIER", "FIRE")),
ctx.getSlot(9 * 3 + 6).setItemStack(new ItemStack(Util.getFallbackMaterial("RED_WOOL", "OAK_SIGN", "SIGN")),
"Set unsuccessful click message, currently:\n",
modified.costMessage == null ? "Unset" : modified.costMessage);
ctx.getSlot(9 * 3 + 6).setClickHandler(
@ -538,7 +530,7 @@ public class ShopTrait extends Trait {
ctx.getSlot(9 * 3 + 6).setDescription(modified.costMessage);
})));
ctx.getSlot(9 * 3 + 5).setItemStack(new ItemStack(Util.getFallbackMaterial("FEATHER", "SIGN")),
ctx.getSlot(9 * 3 + 5).setItemStack(new ItemStack(Util.getFallbackMaterial("FEATHER", "OAK_SIGN", "SIGN")),
"Set click to confirm message.",
"For example, 'click again to buy this item'\nYou can use <cost> or <result> placeholders.\nCurrently:\n"
+ (modified.clickToConfirmMessage == null ? "Unset" : modified.clickToConfirmMessage));
@ -553,10 +545,11 @@ public class ShopTrait extends Trait {
ctx.getSlot(9 * 3 + 4).setClickHandler(
InputMenus.toggler(res -> modified.maxRepeatsOnShiftClick = res, modified.maxRepeatsOnShiftClick));
int pos = 0;
for (GUI template : NPCShopAction.getGUIs()) {
if (template.createMenuItem(null) == null)
continue;
for (GUI template : NPCShopAction.getGUIs()) {
if (template.createMenuItem(null) == null) {
continue;
}
NPCShopAction oldCost = modified.cost.stream().filter(template::manages).findFirst().orElse(null);
costItems.getSlots().get(pos)
.setItemStack(Util.editTitle(template.createMenuItem(oldCost), title -> title + " Cost"));
@ -591,6 +584,7 @@ public class ShopTrait extends Trait {
event.setCancelled(true);
if (modified.display == null)
return;
ctx.getMenu()
.transition(InputMenus.stringSetter(() -> modified.display.getItemMeta().hasLore()
? Joiner.on("<br>").skipNulls().join(modified.display.getItemMeta().getLore())
@ -607,6 +601,7 @@ public class ShopTrait extends Trait {
event.setCancelled(true);
if (modified.display == null)
return;
ctx.getMenu().transition(InputMenus.stringSetter(modified.display.getItemMeta()::getDisplayName, name -> {
ItemMeta meta = modified.display.getItemMeta();
meta.setDisplayName(ChatColor.RESET + Messaging.parseComponents(name));
@ -651,13 +646,21 @@ public class ShopTrait extends Trait {
}
public NPCShopPage(int page) {
this.index = page;
index = page;
}
public NPCShopItem getItem(int idx) {
return items.get(idx);
}
public ItemStack getNextPageItem(Player player, int idx) {
return items.containsKey(idx) ? items.get(idx).getDisplayItem(player) : new ItemStack(Material.FEATHER, 1);
}
public ItemStack getPreviousPageItem(Player player, int idx) {
return items.containsKey(idx) ? items.get(idx).getDisplayItem(player) : new ItemStack(Material.FEATHER, 1);
}
public void removeItem(int idx) {
items.remove(idx);
}
@ -748,13 +751,14 @@ public class ShopTrait extends Trait {
event.setCancelled(true);
if (trait == null)
return;
if (shop.getName().equals(trait.rightClickShop)) {
trait.rightClickShop = null;
} else {
trait.rightClickShop = shop.name;
}
ctx.getSlot(8)
.setDescription("<f>Show shop on right click<br>" + (shop.getName().equals(trait.rightClickShop)));
.setDescription("<f>Show shop on right click<br>" + shop.getName().equals(trait.rightClickShop));
}
}
@ -772,7 +776,7 @@ public class ShopTrait extends Trait {
}
public void changePage(int newPage) {
this.currentPage = newPage;
currentPage = newPage;
NPCShopPage page = shop.pages.get(currentPage);
if (page.title != null && !page.title.isEmpty()) {
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> {
@ -792,21 +796,19 @@ public class ShopTrait extends Trait {
lastClickedItem = item;
});
}
InventoryMenuSlot prev = ctx.getSlot(4 * 9 + 3);
InventoryMenuSlot next = ctx.getSlot(4 * 9 + 5);
if (currentPage > 0) {
prev.clear();
prev.setItemStack(new ItemStack(Material.FEATHER, 1), "Previous page (" + (currentPage) + ")");
prev.setItemStack(page.getPreviousPageItem(player, 4 * 9 + 3), "Previous page (" + newPage + ")");
prev.setClickHandler(evt -> {
evt.setCancelled(true);
changePage(currentPage - 1);
});
}
if (currentPage + 1 < shop.pages.size()) {
next.clear();
next.setItemStack(new ItemStack(Material.FEATHER, 1), "Next page (" + (currentPage + 1) + ")");
next.setItemStack(page.getNextPageItem(player, 4 * 9 + 5), "Next page (" + (newPage + 1) + ")");
next.setClickHandler(evt -> {
evt.setCancelled(true);
changePage(currentPage + 1);

View File

@ -84,6 +84,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -97,6 +98,7 @@ public class ArmorStandController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -104,6 +106,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ArmorStandNPC(this);
}
return super.getBukkitEntity();
}
@ -118,6 +121,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -127,6 +131,7 @@ public class ArmorStandController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -58,6 +58,7 @@ public class BatController extends MobEntityController {
if (npc != null) {
setAsleep(false);
}
}
@Override
@ -99,6 +100,7 @@ public class BatController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -112,6 +114,7 @@ public class BatController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -124,6 +127,7 @@ public class BatController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new BatNPC(this);
}
return super.getBukkitEntity();
}
@ -142,6 +146,7 @@ public class BatController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -152,6 +157,7 @@ public class BatController extends MobEntityController {
NMSImpl.updateAI(this);
npc.update();
}
}
}
}

View File

@ -96,6 +96,7 @@ public class BlazeController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -109,6 +110,7 @@ public class BlazeController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -121,6 +123,7 @@ public class BlazeController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new BlazeNPC(this);
}
return super.getBukkitEntity();
}
@ -139,6 +142,7 @@ public class BlazeController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -146,6 +150,7 @@ public class BlazeController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
}
}

View File

@ -69,6 +69,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class CaveSpiderController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class CaveSpiderController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CaveSpiderNPC(this);
}
return super.getBukkitEntity();
}
@ -164,6 +170,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -172,6 +179,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -189,6 +197,7 @@ public class CaveSpiderController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -70,6 +70,7 @@ public class ChickenController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -78,6 +79,7 @@ public class ChickenController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -114,6 +116,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -126,6 +129,7 @@ public class ChickenController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -134,6 +138,7 @@ public class ChickenController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -143,6 +148,7 @@ public class ChickenController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -155,6 +161,7 @@ public class ChickenController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ChickenNPC(this);
}
return super.getBukkitEntity();
}
@ -173,6 +180,7 @@ public class ChickenController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -181,6 +189,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -196,6 +205,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
this.bD = 100; // egg timer
}
super.n();
}
}

View File

@ -74,6 +74,7 @@ public class CowController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -82,6 +83,7 @@ public class CowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -128,6 +130,7 @@ public class CowController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -140,6 +143,7 @@ public class CowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -148,6 +152,7 @@ public class CowController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -157,6 +162,7 @@ public class CowController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -169,6 +175,7 @@ public class CowController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CowNPC(this);
}
return super.getBukkitEntity();
}
@ -187,6 +194,7 @@ public class CowController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -195,6 +203,7 @@ public class CowController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -75,6 +75,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -116,6 +117,7 @@ public class CreeperController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -128,6 +130,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isProtected()) {
super.dh();
}
}
@Override
@ -135,6 +138,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -143,6 +147,7 @@ public class CreeperController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -152,6 +157,7 @@ public class CreeperController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -164,6 +170,7 @@ public class CreeperController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CreeperNPC(this);
}
return super.getBukkitEntity();
}
@ -182,6 +189,7 @@ public class CreeperController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -190,6 +198,7 @@ public class CreeperController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -205,6 +214,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || allowPowered) {
super.onLightningStrike(entitylightning);
}
}
public void setAllowPowered(boolean allowPowered) {
@ -218,6 +228,7 @@ public class CreeperController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -102,6 +102,7 @@ public class EnderDragonController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -121,6 +122,7 @@ public class EnderDragonController extends MobEntityController {
motY = old.y;
motZ = old.z;
}
return res;
}
@ -130,6 +132,7 @@ public class EnderDragonController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -142,6 +145,7 @@ public class EnderDragonController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EnderDragonNPC(this);
}
return super.getBukkitEntity();
}
@ -160,6 +164,7 @@ public class EnderDragonController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -167,16 +172,19 @@ public class EnderDragonController extends MobEntityController {
if (npc != null) {
npc.update();
}
if (npc != null) {
if (getDragonControllerManager().a().getControllerPhase() == DragonControllerPhase.j) {
setHealth(0F);
return;
}
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;
this.b[i][1] = this.locY;
}
}
if (++this.c == this.b.length) {
@ -199,6 +207,7 @@ public class EnderDragonController extends MobEntityController {
if (getBukkitEntity().getPassenger() != null) {
yaw = getBukkitEntity().getPassenger().getLocation().getYaw() - 180;
}
if (motX != 0 || motY != 0 || motZ != 0) {
motX *= 0.98;
motY *= 0.98;
@ -206,6 +215,7 @@ public class EnderDragonController extends MobEntityController {
if (getBukkitEntity().getPassenger() == null) {
yaw = Util.getDragonYaw(getBukkitEntity(), motX, motZ);
}
setPosition(locX + motX, locY + motY, locZ + motZ);
}
@ -218,8 +228,11 @@ public class EnderDragonController extends MobEntityController {
} catch (Throwable e) {
e.printStackTrace();
}
}
}
if (npc.data().get(NPC.Metadata.COLLIDABLE, false)) {
try {
KNOCKBACK.invoke(this, this.world.getEntities(this,
@ -231,10 +244,13 @@ public class EnderDragonController extends MobEntityController {
} catch (Throwable t) {
t.printStackTrace();
}
}
} else {
super.n();
}
}
private static final MethodHandle HURT = NMS.getMethodHandle(EntityEnderDragon.class, "b", true,

View File

@ -69,6 +69,7 @@ public class EndermanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class EndermanController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class EndermanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class EndermanController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class EndermanController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class EndermanController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EndermanNPC(this);
}
return super.getBukkitEntity();
}
@ -171,6 +177,7 @@ public class EndermanController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -179,6 +186,7 @@ public class EndermanController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -196,6 +204,7 @@ public class EndermanController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -69,6 +69,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class EndermiteController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class EndermiteController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EndermiteNPC(this);
}
return super.getBukkitEntity();
}
@ -164,6 +170,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -172,6 +179,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -189,6 +197,7 @@ public class EndermiteController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -84,6 +84,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
skinTracker = null;
}
}
@Override
@ -91,6 +92,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -126,6 +128,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -138,6 +141,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
velocityChanged = false;
Bukkit.getScheduler().runTask(CitizensAPI.getPlugin(), () -> EntityHumanNPC.this.velocityChanged = true);
}
return damaged;
}
@ -148,7 +152,14 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (dead)
return;
super.die(damagesource);
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 15); // give enough time for death and smoke animation
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 15); // give
// enough
// time
// for
// death
// and
// smoke
// animation
}
@Override
@ -156,6 +167,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -164,6 +176,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -173,6 +186,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -180,6 +194,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc != null && bukkitEntity == null) {
bukkitEntity = new PlayerNPC(this);
}
return super.getBukkitEntity();
}
@ -206,6 +221,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (skinName == null) {
skinName = npc.getName();
}
return skinName.toLowerCase();
}
@ -229,10 +245,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} catch (IOException e) {
// swallow
}
AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
if (range == null) {
range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE);
}
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
controllerJump = new PlayerControllerJump(this);
controllerMove = new PlayerControllerMove(this);
@ -258,6 +276,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
super.k_();
return;
}
super.U();
boolean navigating = npc.getNavigator().isNavigating() || controllerMove.a();
if (!navigating && getBukkitEntity() != null
@ -266,15 +285,19 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
moveWithFallDamage(0, 0);
}
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
motX = motY = motZ = 0;
}
if (navigating) {
if (!NMSImpl.isNavigationFinished(navigation)) {
NMSImpl.updateNavigation(navigation);
}
moveOnCurrentHeading();
}
updateAI();
cs();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
@ -284,12 +307,16 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
axisalignedbb = this.getBoundingBox().grow(1.0, 0.5, 1.0);
}
for (Entity entity : this.world.getEntities(this, axisalignedbb)) {
if (!entity.dead) {
entity.d(this);
}
}
}
}
@Override
@ -317,9 +344,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
cl();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
bf *= 0.98F;
bg *= 0.98F;
bh *= 0.9F;
@ -328,6 +357,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (jumpTicks > 0) {
jumpTicks--;
}
}
private void moveWithFallDamage(float mx, float my) {
@ -336,6 +366,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (!npc.isProtected()) {
a(this.locY - y, onGround);
}
}
public void setMoveDestination(double x, double y, double z, double speed) {
@ -395,9 +426,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (equipment != null) {
this.getAttributeMap().b(equipment.a(slot));
}
}
equipmentCache.put(slot, equipment);
}
if (!itemChanged)
return;
Location current = getBukkitEntity().getLocation(packetLocationCache);
@ -406,6 +440,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
}
NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
}

View File

@ -82,6 +82,7 @@ public class GhastController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -100,6 +101,7 @@ public class GhastController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -112,6 +114,7 @@ public class GhastController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GhastNPC(this);
}
return super.getBukkitEntity();
}
@ -130,6 +133,7 @@ public class GhastController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -137,6 +141,7 @@ public class GhastController extends MobEntityController {
if (npc != null) {
npc.update();
}
super.M();
}
}

View File

@ -55,6 +55,7 @@ public class GiantController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class GiantController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class GiantController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class GiantController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class GiantController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class GiantController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GiantNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class GiantController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class GiantController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class GiantController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class GuardianController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class GuardianController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class GuardianController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class GuardianController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class GuardianController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class GuardianController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GuardianNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class GuardianController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -159,6 +166,7 @@ public class GuardianController extends MobEntityController {
} else {
npc.update();
}
}
@Override
@ -178,6 +186,7 @@ public class GuardianController extends MobEntityController {
this.setPosition(locX - 0.01, locY, locZ - 0.01);
this.setPosition(locX + 0.01, locY, locZ + 0.01);
}
}
@Override
@ -187,6 +196,7 @@ public class GuardianController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -62,6 +62,7 @@ public class HorseController extends MobEntityController {
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
}
}
@Override
@ -75,6 +76,7 @@ public class HorseController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -83,6 +85,7 @@ public class HorseController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -119,6 +122,7 @@ public class HorseController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -139,6 +143,7 @@ public class HorseController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -147,6 +152,7 @@ public class HorseController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -156,6 +162,7 @@ public class HorseController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -168,6 +175,7 @@ public class HorseController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new HorseNPC(this);
}
return super.getBukkitEntity();
}
@ -186,6 +194,7 @@ public class HorseController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -199,16 +208,20 @@ public class HorseController extends MobEntityController {
} else {
riding = false;
}
if (riding) {
try {
C.invoke(this, 4, true);
} catch (Throwable e) {
e.printStackTrace();
}
}
NMS.setStepHeight(getBukkitEntity(), 1);
npc.update();
}
}
@Override

View File

@ -35,9 +35,11 @@ public class HumanController extends AbstractEntityController {
if (npc.requiresNameHologram()) {
name = teamName;
}
if (Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
npc.getOrAddTrait(ScoreboardTrait.class).createTeam(name);
}
final GameProfile profile = new GameProfile(uuid, name);
final EntityHumanNPC handle = new EntityHumanNPC(nmsWorld.getServer().getServer(), nmsWorld, profile,
new PlayerInteractManager(nmsWorld), npc);
@ -45,6 +47,7 @@ public class HumanController extends AbstractEntityController {
if (skin != null) {
skin.apply(handle);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
if (getBukkitEntity() == null || !getBukkitEntity().isValid()
|| getBukkitEntity() != handle.getBukkitEntity())

View File

@ -55,6 +55,7 @@ public class IronGolemController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class IronGolemController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class IronGolemController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class IronGolemController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class IronGolemController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class IronGolemController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new IronGolemNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class IronGolemController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class IronGolemController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class IronGolemController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -49,6 +49,7 @@ public class MagmaCubeController extends MobEntityController {
setSize(3);
this.moveController = new PlayerControllerMove(this);
}
}
@Override
@ -61,6 +62,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -97,6 +99,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -104,6 +107,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null) {
super.d(human);
}
}
@Override
@ -116,6 +120,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -124,6 +129,7 @@ public class MagmaCubeController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -133,6 +139,7 @@ public class MagmaCubeController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -145,6 +152,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MagmaCubeNPC(this);
}
return super.getBukkitEntity();
}
@ -163,6 +171,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -171,6 +180,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -188,6 +198,7 @@ public class MagmaCubeController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -34,6 +34,7 @@ public abstract class MobEntityController extends AbstractEntityController {
if (entity instanceof EntityInsentient) {
NMSImpl.clearGoals(((EntityInsentient) entity).goalSelector, ((EntityInsentient) entity).targetSelector);
}
entity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
if (npc != null) {
// entity.onGround isn't updated right away - we approximate here so
@ -42,15 +43,19 @@ public abstract class MobEntityController extends AbstractEntityController {
if (beneath.isSolid()) {
entity.onGround = true;
}
try {
UUID_FIELD.invoke(entity, npc.getUniqueId());
} catch (Throwable e) {
e.printStackTrace();
}
if (Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
npc.getOrAddTrait(ScoreboardTrait.class).createTeam(npc.getUniqueId().toString());
}
}
return entity.getBukkitEntity();
}
@ -61,6 +66,7 @@ public abstract class MobEntityController extends AbstractEntityController {
ex.printStackTrace();
return null;
}
}
private static Constructor<?> getConstructor(Class<?> clazz) {
@ -73,6 +79,7 @@ public abstract class MobEntityController extends AbstractEntityController {
} catch (Exception ex) {
throw new IllegalStateException("unable to find an entity constructor");
}
}
private static final Map<Class<?>, Constructor<?>> CONSTRUCTOR_CACHE = new WeakHashMap<>();

View File

@ -59,6 +59,7 @@ public class MushroomCowController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -67,6 +68,7 @@ public class MushroomCowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -110,6 +112,7 @@ public class MushroomCowController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -122,6 +125,7 @@ public class MushroomCowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -130,6 +134,7 @@ public class MushroomCowController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -139,6 +144,7 @@ public class MushroomCowController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -151,6 +157,7 @@ public class MushroomCowController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MushroomCowNPC(this);
}
return super.getBukkitEntity();
}
@ -169,6 +176,7 @@ public class MushroomCowController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -177,6 +185,7 @@ public class MushroomCowController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -56,6 +56,7 @@ public class OcelotController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -64,6 +65,7 @@ public class OcelotController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -100,6 +102,7 @@ public class OcelotController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -112,6 +115,7 @@ public class OcelotController extends MobEntityController {
if (npc == null) {
super.df();
}
}
@Override
@ -119,6 +123,7 @@ public class OcelotController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -127,6 +132,7 @@ public class OcelotController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -136,6 +142,7 @@ public class OcelotController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -148,6 +155,7 @@ public class OcelotController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new OcelotNPC(this);
}
return super.getBukkitEntity();
}
@ -166,6 +174,7 @@ public class OcelotController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -174,6 +183,7 @@ public class OcelotController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -57,6 +57,7 @@ public class PigController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -65,6 +66,7 @@ public class PigController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -101,6 +103,7 @@ public class PigController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -120,6 +123,7 @@ public class PigController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -128,6 +132,7 @@ public class PigController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -137,6 +142,7 @@ public class PigController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -149,6 +155,7 @@ public class PigController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new PigNPC(this);
}
return super.getBukkitEntity();
}
@ -167,6 +174,7 @@ public class PigController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -175,6 +183,7 @@ public class PigController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -190,6 +199,7 @@ public class PigController extends MobEntityController {
if (npc == null) {
super.onLightningStrike(entitylightning);
}
}
}

View File

@ -55,6 +55,7 @@ public class PigZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class PigZombieController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class PigZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class PigZombieController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class PigZombieController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class PigZombieController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new PigZombieNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class PigZombieController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class PigZombieController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -54,6 +54,7 @@ public class PolarBearController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -91,6 +92,7 @@ public class PolarBearController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -104,6 +106,7 @@ public class PolarBearController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -116,6 +119,7 @@ public class PolarBearController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new PolarBearNPC(this);
}
return super.getBukkitEntity();
}
@ -134,6 +138,7 @@ public class PolarBearController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -143,6 +148,7 @@ public class PolarBearController extends MobEntityController {
NMSImpl.updateAI(this);
npc.update();
}
}
}

View File

@ -57,6 +57,7 @@ public class RabbitController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -65,6 +66,7 @@ public class RabbitController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -101,6 +103,7 @@ public class RabbitController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -113,6 +116,7 @@ public class RabbitController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -121,6 +125,7 @@ public class RabbitController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -130,6 +135,7 @@ public class RabbitController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -142,6 +148,7 @@ public class RabbitController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new RabbitNPC(this);
}
return super.getBukkitEntity();
}
@ -165,6 +172,7 @@ public class RabbitController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -176,6 +184,7 @@ public class RabbitController extends MobEntityController {
} else {
super.M();
}
}
@Override
@ -194,6 +203,7 @@ public class RabbitController extends MobEntityController {
this.datawatcher.set(NMSImpl.getRabbitTypeField(), i);
return;
}
super.setRabbitType(i);
}
}

View File

@ -56,6 +56,7 @@ public class SheepController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -64,6 +65,7 @@ public class SheepController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -100,6 +102,7 @@ public class SheepController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -112,6 +115,7 @@ public class SheepController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -120,6 +124,7 @@ public class SheepController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -129,6 +134,7 @@ public class SheepController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -141,6 +147,7 @@ public class SheepController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SheepNPC(this);
}
return super.getBukkitEntity();
}
@ -159,6 +166,7 @@ public class SheepController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -167,6 +175,7 @@ public class SheepController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -56,6 +56,7 @@ public class ShulkerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -92,6 +93,7 @@ public class ShulkerController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -104,6 +106,7 @@ public class ShulkerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -112,6 +115,7 @@ public class ShulkerController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -121,6 +125,7 @@ public class ShulkerController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -133,6 +138,7 @@ public class ShulkerController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ShulkerNPC(this);
}
return super.getBukkitEntity();
}
@ -151,6 +157,7 @@ public class ShulkerController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -160,6 +167,7 @@ public class ShulkerController extends MobEntityController {
} else {
super.m();
}
}
@Override
@ -175,6 +183,7 @@ public class ShulkerController extends MobEntityController {
if (npc == null) {
super.n();
}
}
@Override
@ -189,6 +198,7 @@ public class ShulkerController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class SilverfishController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class SilverfishController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class SilverfishController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class SilverfishController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class SilverfishController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class SilverfishController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SilverfishNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class SilverfishController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class SilverfishController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class SilverfishController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class SkeletonController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class SkeletonController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class SkeletonController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class SkeletonController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class SkeletonController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class SkeletonController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SkeletonNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class SkeletonController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class SkeletonController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class SkeletonController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -49,6 +49,7 @@ public class SlimeController extends MobEntityController {
setSize(3);
this.moveController = new PlayerControllerMove(this);
}
}
@Override
@ -61,6 +62,7 @@ public class SlimeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -97,6 +99,7 @@ public class SlimeController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -104,6 +107,7 @@ public class SlimeController extends MobEntityController {
if (npc == null) {
super.d(human);
}
}
@Override
@ -116,6 +120,7 @@ public class SlimeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -124,6 +129,7 @@ public class SlimeController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -133,6 +139,7 @@ public class SlimeController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -145,6 +152,7 @@ public class SlimeController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SlimeNPC(this);
}
return super.getBukkitEntity();
}
@ -163,6 +171,7 @@ public class SlimeController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -171,6 +180,7 @@ public class SlimeController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -188,6 +198,7 @@ public class SlimeController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class SnowmanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class SnowmanController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class SnowmanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class SnowmanController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class SnowmanController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class SnowmanController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SnowmanNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class SnowmanController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class SnowmanController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class SnowmanController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class SpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class SpiderController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class SpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class SpiderController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class SpiderController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class SpiderController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SpiderNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class SpiderController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class SpiderController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class SpiderController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class SquidController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class SquidController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class SquidController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class SquidController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class SquidController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class SquidController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SquidNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class SquidController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -166,6 +173,7 @@ public class SquidController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class SquidController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -62,6 +62,7 @@ public class VillagerController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -70,6 +71,7 @@ public class VillagerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -83,6 +85,7 @@ public class VillagerController extends MobEntityController {
if (npc != null && npc.data().get(NPC.Metadata.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
}
return super.a(entityhuman, enumhand, itemstack);
}
@ -114,6 +117,7 @@ public class VillagerController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -127,6 +131,7 @@ public class VillagerController extends MobEntityController {
blockingATrade = false;
return true;
}
return super.dh();
}
@ -135,6 +140,7 @@ public class VillagerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -143,6 +149,7 @@ public class VillagerController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -152,6 +159,7 @@ public class VillagerController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -164,6 +172,7 @@ public class VillagerController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new VillagerNPC(this);
}
return super.getBukkitEntity();
}
@ -182,6 +191,7 @@ public class VillagerController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -190,6 +200,7 @@ public class VillagerController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -205,6 +216,7 @@ public class VillagerController extends MobEntityController {
if (npc == null) {
super.onLightningStrike(entitylightning);
}
}
}

View File

@ -55,6 +55,7 @@ public class WitchController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class WitchController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class WitchController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class WitchController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class WitchController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class WitchController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new WitchNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class WitchController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class WitchController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class WitchController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -82,6 +82,7 @@ public class WitherController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -101,6 +102,7 @@ public class WitherController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -113,6 +115,7 @@ public class WitherController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new WitherNPC(this);
}
return super.getBukkitEntity();
}
@ -131,6 +134,7 @@ public class WitherController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -144,6 +148,7 @@ public class WitherController extends MobEntityController {
super.M();
return;
}
npc.update();
}
}

View File

@ -58,6 +58,7 @@ public class WolfController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -66,6 +67,7 @@ public class WolfController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -102,6 +104,7 @@ public class WolfController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -114,6 +117,7 @@ public class WolfController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -122,6 +126,7 @@ public class WolfController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -131,6 +136,7 @@ public class WolfController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -143,6 +149,7 @@ public class WolfController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new WolfNPC(this);
}
return super.getBukkitEntity();
}
@ -161,6 +168,7 @@ public class WolfController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -169,6 +177,7 @@ public class WolfController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -55,6 +55,7 @@ public class ZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class ZombieController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class ZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class ZombieController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class ZombieController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class ZombieController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ZombieNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class ZombieController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class ZombieController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -67,6 +67,7 @@ public class AreaEffectCloudController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -80,6 +81,7 @@ public class AreaEffectCloudController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -87,6 +89,7 @@ public class AreaEffectCloudController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new AreaEffectCloudNPC(this);
}
return super.getBukkitEntity();
}
@ -102,6 +105,7 @@ public class AreaEffectCloudController extends MobEntityController {
} else {
super.m();
}
}
}
}

View File

@ -68,6 +68,7 @@ public class BoatController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -81,6 +82,7 @@ public class BoatController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -88,6 +90,7 @@ public class BoatController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new BoatNPC(this);
}
return super.getBukkitEntity();
}
@ -103,6 +106,7 @@ public class BoatController extends MobEntityController {
} else {
super.m();
}
}
@Override
@ -112,6 +116,7 @@ public class BoatController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -68,6 +68,7 @@ public class DragonFireballController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -81,6 +82,7 @@ public class DragonFireballController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -88,6 +90,7 @@ public class DragonFireballController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new DragonFireballNPC(this);
}
return super.getBukkitEntity();
}
@ -103,9 +106,11 @@ public class DragonFireballController extends MobEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
@Override
@ -115,6 +120,7 @@ public class DragonFireballController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -83,6 +83,7 @@ public class EggController extends AbstractEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -96,6 +97,7 @@ public class EggController extends AbstractEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -103,6 +105,7 @@ public class EggController extends AbstractEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EggNPC(this);
}
return super.getBukkitEntity();
}
@ -118,9 +121,11 @@ public class EggController extends AbstractEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
}
}

View File

@ -67,6 +67,7 @@ public class EnderCrystalController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -80,6 +81,7 @@ public class EnderCrystalController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -87,6 +89,7 @@ public class EnderCrystalController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EnderCrystalNPC(this);
}
return super.getBukkitEntity();
}
@ -102,6 +105,7 @@ public class EnderCrystalController extends MobEntityController {
} else {
super.m();
}
}
}
}

View File

@ -67,6 +67,7 @@ public class EnderPearlController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -80,6 +81,7 @@ public class EnderPearlController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -87,6 +89,7 @@ public class EnderPearlController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EnderPearlNPC(this);
}
return super.getBukkitEntity();
}
@ -102,9 +105,11 @@ public class EnderPearlController extends MobEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
}
}

View File

@ -67,6 +67,7 @@ public class EnderSignalController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -80,6 +81,7 @@ public class EnderSignalController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -87,6 +89,7 @@ public class EnderSignalController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EnderSignalNPC(this);
}
return super.getBukkitEntity();
}
@ -102,6 +105,7 @@ public class EnderSignalController extends MobEntityController {
} else {
super.m();
}
}
}
}

View File

@ -53,6 +53,7 @@ public class ExperienceOrbController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class ExperienceOrbController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class ExperienceOrbController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ExperienceOrbNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class ExperienceOrbController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -75,6 +75,7 @@ public class FallingBlockController extends AbstractEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -88,6 +89,7 @@ public class FallingBlockController extends AbstractEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -95,6 +97,7 @@ public class FallingBlockController extends AbstractEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new FallingBlockNPC(this);
}
return super.getBukkitEntity();
}
@ -113,9 +116,11 @@ public class FallingBlockController extends AbstractEntityController {
motZ *= 0.98;
move(motX, motY, motZ);
}
} else {
super.m();
}
}
@Override
@ -125,6 +130,7 @@ public class FallingBlockController extends AbstractEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
private static final double EPSILON = 0.001;

View File

@ -53,6 +53,7 @@ public class FireworkController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class FireworkController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class FireworkController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new FireworkNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class FireworkController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class FishingHookController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class FishingHookController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class FishingHookController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new FishingHookNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class FishingHookController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -66,6 +66,7 @@ public class ItemController extends AbstractEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -73,6 +74,7 @@ public class ItemController extends AbstractEntityController {
if (npc == null) {
super.d(entityhuman);
}
}
@Override
@ -86,6 +88,7 @@ public class ItemController extends AbstractEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -93,6 +96,7 @@ public class ItemController extends AbstractEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ItemNPC(this);
}
return super.getBukkitEntity();
}
@ -108,6 +112,7 @@ public class ItemController extends AbstractEntityController {
} else {
super.m();
}
}
}

View File

@ -66,6 +66,7 @@ public class ItemFrameController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -79,6 +80,7 @@ public class ItemFrameController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -86,6 +88,7 @@ public class ItemFrameController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ItemFrameNPC(this);
}
return super.getBukkitEntity();
}
@ -101,6 +104,7 @@ public class ItemFrameController extends MobEntityController {
} else {
super.m();
}
}
@Override

View File

@ -54,6 +54,7 @@ public class LargeFireballController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class LargeFireballController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -74,6 +76,7 @@ public class LargeFireballController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new LargeFireballNPC(this);
}
return super.getBukkitEntity();
}
@ -89,9 +92,11 @@ public class LargeFireballController extends MobEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
@Override
@ -101,6 +106,7 @@ public class LargeFireballController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -53,6 +53,7 @@ public class LeashController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class LeashController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class LeashController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new LeashNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class LeashController extends MobEntityController {
} else {
super.m();
}
}
@Override

View File

@ -54,6 +54,7 @@ public class MinecartChestController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class MinecartChestController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -74,6 +76,7 @@ public class MinecartChestController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MinecartChestNPC(this);
}
return super.getBukkitEntity();
}
@ -89,6 +92,7 @@ public class MinecartChestController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}

View File

@ -54,6 +54,7 @@ public class MinecartCommandController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class MinecartCommandController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -74,6 +76,7 @@ public class MinecartCommandController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MinecartCommandNPC(this);
}
return super.getBukkitEntity();
}
@ -89,6 +92,7 @@ public class MinecartCommandController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}

View File

@ -54,6 +54,7 @@ public class MinecartFurnaceController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class MinecartFurnaceController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -74,6 +76,7 @@ public class MinecartFurnaceController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MinecartFurnaceNPC(this);
}
return super.getBukkitEntity();
}
@ -89,6 +92,7 @@ public class MinecartFurnaceController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}

View File

@ -50,6 +50,7 @@ public class MinecartHopperController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -63,6 +64,7 @@ public class MinecartHopperController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -77,6 +79,7 @@ public class MinecartHopperController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}
}

View File

@ -54,6 +54,7 @@ public class MinecartRideableController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class MinecartRideableController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -74,6 +76,7 @@ public class MinecartRideableController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new MinecartRideableNPC(this);
}
return super.getBukkitEntity();
}
@ -89,6 +92,7 @@ public class MinecartRideableController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}

View File

@ -50,6 +50,7 @@ public class MinecartSpawnerController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -63,6 +64,7 @@ public class MinecartSpawnerController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -77,6 +79,7 @@ public class MinecartSpawnerController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}
}

View File

@ -50,6 +50,7 @@ public class MinecartTNTController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -63,6 +64,7 @@ public class MinecartTNTController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -77,6 +79,7 @@ public class MinecartTNTController extends MobEntityController {
npc.update();
NMSImpl.minecartItemLogic(this);
}
}
}
}

View File

@ -53,6 +53,7 @@ public class PaintingController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class PaintingController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class PaintingController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new PaintingNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class PaintingController extends MobEntityController {
} else {
super.m();
}
}
@Override

View File

@ -53,6 +53,7 @@ public class ShulkerBulletController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class ShulkerBulletController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class ShulkerBulletController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ShulkerBulletNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class ShulkerBulletController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class SmallFireballController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class SmallFireballController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class SmallFireballController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SmallFireballNPC(this);
}
return super.getBukkitEntity();
}
@ -88,9 +91,11 @@ public class SmallFireballController extends MobEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class SnowballController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class SnowballController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class SnowballController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SnowballNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class SnowballController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class SpectralArrowController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class SpectralArrowController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class SpectralArrowController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new SpectralArrowNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class SpectralArrowController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class TNTPrimedController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class TNTPrimedController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class TNTPrimedController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new TNTPrimedNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class TNTPrimedController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class ThrownExpBottleController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class ThrownExpBottleController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class ThrownExpBottleController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ThrownExpBottleNPC(this);
}
return super.getBukkitEntity();
}
@ -88,9 +91,11 @@ public class ThrownExpBottleController extends MobEntityController {
if (!npc.isProtected()) {
super.m();
}
} else {
super.m();
}
}
}

View File

@ -54,6 +54,7 @@ public class ThrownPotionController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -67,6 +68,7 @@ public class ThrownPotionController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -77,7 +79,9 @@ public class ThrownPotionController extends MobEntityController {
} else {
bukkitEntity = new SplashThrownPotionNPC(this);
}
}
return super.getBukkitEntity();
}
@ -93,6 +97,7 @@ public class ThrownPotionController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class TippedArrowController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class TippedArrowController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class TippedArrowController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new TippedArrowNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class TippedArrowController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -53,6 +53,7 @@ public class WitherSkullController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -66,6 +67,7 @@ public class WitherSkullController extends MobEntityController {
if (vector != null) {
super.g(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -73,6 +75,7 @@ public class WitherSkullController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new WitherSkullNPC(this);
}
return super.getBukkitEntity();
}
@ -88,6 +91,7 @@ public class WitherSkullController extends MobEntityController {
} else {
super.m();
}
}
}

View File

@ -47,6 +47,7 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
ItemStack current = getCurrentItem();
return current != null ? current.b(block) : false;
}
}
@Override
@ -64,10 +65,13 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
if (i > 0) {
f += i * i + 1;
}
}
if (handle.hasEffect(MobEffects.FASTER_DIG)) {
f *= 1.0F + (handle.getEffect(MobEffects.FASTER_DIG).getAmplifier() + 1) * 0.2F;
}
if (handle.hasEffect(MobEffects.SLOWER_DIG)) {
float f1 = 1.0F;
switch (handle.getEffect(MobEffects.SLOWER_DIG).getAmplifier()) {
@ -84,15 +88,20 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
default:
f1 = 8.1E-4F;
}
f *= f1;
}
if (handle.a(Material.WATER) && !EnchantmentManager.i(handle)) {
f /= 5.0F;
}
}
if (!getHandle().onGround) {
f /= 5.0F;
}
return f;
}
}

View File

@ -274,6 +274,7 @@ public class NMSImpl implements NMSBridge {
} else if (!handle.world.players.contains(handle)) {
handle.world.players.add(handle);
}
}
@Override
@ -286,6 +287,7 @@ public class NMSImpl implements NMSBridge {
PlayerAnimation.ARM_SWING.play(humanHandle.getBukkitEntity());
return;
}
AttributeInstance attackDamage = handle.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE);
float f = (float) (attackDamage == null ? 1 : attackDamage.getValue());
int i = 0;
@ -293,6 +295,7 @@ public class NMSImpl implements NMSBridge {
f += EnchantmentManager.a(handle.getItemInMainHand(), target.getMonsterType());
i += EnchantmentManager.a(handle);
}
boolean flag = target.damageEntity(DamageSource.mobAttack(handle), f);
if (!flag)
return;
@ -302,10 +305,12 @@ public class NMSImpl implements NMSBridge {
handle.motX *= 0.6D;
handle.motZ *= 0.6D;
}
int fireAspectLevel = EnchantmentManager.getFireAspectEnchantmentLevel(handle);
if (fireAspectLevel > 0) {
target.setOnFire(fireAspectLevel * 4);
}
}
@Override
@ -317,9 +322,11 @@ public class NMSImpl implements NMSBridge {
} catch (Throwable t) {
t.printStackTrace();
}
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).getControllerMove().f = false;
}
}
@Override
@ -353,14 +360,19 @@ public class NMSImpl implements NMSBridge {
if (!changed && !ItemStack.matches(old, curr)) {
changed = true;
}
equipment.put(slot, curr);
}
if (changed) {
for (EnumItemSlot slot : EnumItemSlot.values()) {
agg.send(new PacketPlayOutEntityEquipment(handle.getId(), slot, equipment.get(slot)));
}
}
}
tracker.track(Lists.newArrayList(tracker.trackedPlayers));
}
@ -380,7 +392,9 @@ public class NMSImpl implements NMSBridge {
if (callback != null) {
callback.accept(entity);
}
}
tracker.trackedPlayers.clear();
}
};
@ -428,8 +442,10 @@ public class NMSImpl implements NMSBridge {
bserver = (BossBattleServer) ENDERDRAGON_BATTLE_BAR_FIELD
.get(ENDERDRAGON_BATTLE_FIELD.get(NMSImpl.getHandle(entity)));
}
} catch (Exception e) {
}
if (bserver == null)
return null;
BossBar ret = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SEGMENTED_10);
@ -437,6 +453,7 @@ public class NMSImpl implements NMSBridge {
CRAFT_BOSSBAR_HANDLE_FIELD.set(ret, bserver);
} catch (Exception e) {
}
return ret;
}
@ -454,6 +471,7 @@ public class NMSImpl implements NMSBridge {
if (aabb == null) {
aabb = world.getType(pos).d(world, pos);
}
return new BoundingBox(aabb.a, aabb.b, aabb.c, aabb.d, aabb.e, aabb.f);
}
@ -553,12 +571,15 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
return null;
}
}
try {
return (GameProfile) SKULL_PROFILE_FIELD.get(meta);
} catch (Exception e) {
return null;
}
}
@Override
@ -571,6 +592,7 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
throw new CommandException(Messages.INVALID_SOUND);
}
}
@Override
@ -586,6 +608,7 @@ public class NMSImpl implements NMSBridge {
EntityLiving handle = NMSImpl.getHandle((LivingEntity) npc.getEntity());
if (handle == null) {
}
return DEFAULT_SPEED;
// return (float)
// handle.getAttributeInstance(GenericAttributes.d).getValue();
@ -629,7 +652,9 @@ public class NMSImpl implements NMSBridge {
} else {
((EntityInsentient) raw).a(PathType.WATER, oldWater + 1F);
}
}
navigation.q().b(params.hasExaminer(DoorExaminer.class));
return new MCNavigator() {
float lastSpeed;
@ -653,7 +678,9 @@ public class NMSImpl implements NMSBridge {
} else {
((EntityInsentient) raw).a(PathType.WATER, oldWater);
}
}
stopNavigation(navigation);
}
@ -665,13 +692,16 @@ public class NMSImpl implements NMSBridge {
if (handle instanceof EntityHorse) {
handle.width = Math.min(0.99f, oldWidth);
}
if (!function.apply(navigation)) {
reason = CancelReason.STUCK;
}
handle.width = oldWidth; // minecraft requires that an entity fit onto both blocks if width >= 1f,
// but we'd prefer to make it just fit on 1 so hack around it a bit.
lastSpeed = params.speed();
}
navigation.a(params.speed());
return NMSImpl.isNavigationFinished(navigation);
}
@ -836,30 +866,37 @@ public class NMSImpl implements NMSBridge {
if (zDiff < 0.0) {
yaw += Math.abs(180 - yaw) * 2;
}
if (handle instanceof EntityEnderDragon) {
yaw = Util.getDragonYaw(handle.getBukkitEntity(), xDiff, zDiff);
} else {
yaw = yaw - 90;
}
if (headOnly) {
setHeadYaw(entity, (float) yaw);
} else {
look(entity, (float) yaw, (float) pitch);
}
return;
}
if (handle instanceof EntityInsentient) {
((EntityInsentient) handle).getControllerLook().a(to.getX(), to.getY(), to.getZ(),
((EntityInsentient) handle).cJ(), ((EntityInsentient) handle).N());
while (((EntityInsentient) handle).aQ >= 180F) {
((EntityInsentient) handle).aQ -= 360F;
}
while (((EntityInsentient) handle).aQ < -180F) {
((EntityInsentient) handle).aQ += 360F;
}
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).getNPC().getOrAddTrait(RotationTrait.class).getPhysicalSession().rotateToFace(to);
}
}
@Override
@ -872,18 +909,22 @@ public class NMSImpl implements NMSBridge {
} else {
look(from, to.getLocation(), false, true);
}
} else if (handle instanceof EntityInsentient) {
((EntityInsentient) handle).getControllerLook().a(target, ((EntityInsentient) handle).cJ(),
((EntityInsentient) handle).N());
while (((EntityLiving) handle).aQ >= 180F) {
((EntityLiving) handle).aQ -= 360F;
}
while (((EntityLiving) handle).aQ < -180F) {
((EntityLiving) handle).aQ += 360F;
}
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).getNPC().getOrAddTrait(RotationTrait.class).getPhysicalSession().rotateToFace(to);
}
}
@Override
@ -923,7 +964,9 @@ public class NMSImpl implements NMSBridge {
e.printStackTrace();
return super.getBukkitView();
}
}
return this.bukkitEntity;
}
};
@ -969,6 +1012,7 @@ public class NMSImpl implements NMSBridge {
if (entity1.dead || !entity1.w(entity)) {
entity.stopRiding();
}
} else {
if (!entity.dead) {
try {
@ -979,17 +1023,22 @@ public class NMSImpl implements NMSBridge {
entity.appendEntityCrashDetails(crashreportsystemdetails);
throw new ReportedException(crashreport);
}
}
if (entity.dead) {
entity.world.removeEntity(entity);
} else if (!removeFromPlayerList) {
if (!entity.world.players.contains(entity)) {
entity.world.players.add(entity);
}
} else {
entity.world.players.remove(entity);
}
}
};
}
@ -1002,11 +1051,13 @@ public class NMSImpl implements NMSBridge {
if (!ENTITY_CLASS_TO_INT.containsKey(search)) {
continue;
}
int code = ENTITY_CLASS_TO_INT.get(search);
ENTITY_CLASS_TO_INT.put(clazz, code);
ENTITY_CLASS_TO_NAME.put(clazz, ENTITY_CLASS_TO_NAME.get(search));
return;
}
throw new IllegalArgumentException("unable to find valid entity superclass for class " + clazz.toString());
}
@ -1045,6 +1096,7 @@ public class NMSImpl implements NMSBridge {
hook.hooked = null;
hook.getBukkitEntity().remove();
}
}
@Override
@ -1066,10 +1118,13 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
if (getHandle(entity) instanceof EntityHumanNPC) {
((EntityHumanNPC) getHandle(entity)).setTracked();
}
}
@Override
@ -1079,9 +1134,11 @@ public class NMSImpl implements NMSBridge {
if (bodyYaw == null) {
bodyYaw = handle.yaw;
}
if (pitch == null) {
pitch = handle.pitch;
}
List<Packet<?>> toSend = Lists.newArrayList();
if (position) {
EntityTrackerEntry entry = ((WorldServer) handle.world).getTracker().trackedEntities.get(handle.getId());
@ -1094,15 +1151,18 @@ public class NMSImpl implements NMSBridge {
e.printStackTrace();
return;
}
toSend.add(new PacketPlayOutRelEntityMoveLook(handle.getId(), (short) dx, (short) dy, (short) dz,
(byte) (bodyYaw * 256.0F / 360.0F), (byte) (pitch * 256.0F / 360.0F), handle.onGround));
} else {
toSend.add(new PacketPlayOutEntityLook(handle.getId(), (byte) (bodyYaw * 256.0F / 360.0F),
(byte) (pitch * 256.0F / 360.0F), handle.onGround));
}
if (headYaw != null) {
toSend.add(new PacketPlayOutEntityHeadRotation(handle, (byte) (headYaw * 256.0F / 360.0F)));
}
sendPacketsNearby(null, from.getLocation(), toSend, 64);
}
@ -1126,6 +1186,7 @@ public class NMSImpl implements NMSBridge {
entities[i] = (EntityPlayer) skinnable;
i++;
}
NMSImpl.sendPacket(recipient,
new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entities));
}
@ -1146,12 +1207,14 @@ public class NMSImpl implements NMSBridge {
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getGetter(team.getClass(), "team");
}
try {
ScoreboardTeam nmsTeam = (ScoreboardTeam) TEAM_FIELD.invoke(team);
sendPacket(recipient, new PacketPlayOutScoreboardTeam(nmsTeam, mode));
} catch (Throwable e) {
e.printStackTrace();
}
}
@Override
@ -1179,6 +1242,7 @@ public class NMSImpl implements NMSBridge {
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).setMoveDestination(x, y, z, speed);
}
}
@Override
@ -1203,6 +1267,7 @@ public class NMSImpl implements NMSBridge {
if (!(handle instanceof EntityHuman)) {
handle.aO = yaw;
}
handle.aQ = yaw;
}
@ -1252,11 +1317,14 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
return;
}
}
try {
SKULL_PROFILE_FIELD.set(meta, profile);
} catch (Exception e) {
}
}
@Override
@ -1270,6 +1338,7 @@ public class NMSImpl implements NMSBridge {
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).setShouldJump();
}
}
@Override
@ -1287,6 +1356,7 @@ public class NMSImpl implements NMSBridge {
if (entity instanceof Player) {
((Player) entity).setSneaking(sneaking);
}
}
@Override
@ -1319,6 +1389,7 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return false;
}
@ -1356,6 +1427,7 @@ public class NMSImpl implements NMSBridge {
facingByte = (byte) 3;
break;
}
Location bedLoc = loc.clone().add(0, -loc.getY(), 0);
PacketPlayOutBed bed = new PacketPlayOutBed(from,
new BlockPosition(bedLoc.getBlockX(), bedLoc.getBlockY(), bedLoc.getBlockZ()));
@ -1374,6 +1446,7 @@ public class NMSImpl implements NMSBridge {
list.forEach(packet -> sendPacket(nearby, packet));
meta.set(nearby.getUniqueId(), entity.getUniqueId().toString(), System.currentTimeMillis());
}
} else {
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(from, 2);
sendPacketNearby(entity, entity.getLocation(), packet, 64);
@ -1381,8 +1454,11 @@ public class NMSImpl implements NMSBridge {
if (meta.remove(player.getUniqueId(), entity.getUniqueId().toString())) {
sendPacket(player, packet);
}
}
}
}
@Override
@ -1398,6 +1474,7 @@ public class NMSImpl implements NMSBridge {
if (RANDOM.nextFloat() <= 0.85F && (handle.ak() || handle.ao())) {
handle.motY += power;
}
}
@Override
@ -1425,6 +1502,7 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
Messaging.logTr(Messages.ERROR_UPDATING_NAVIGATION_WORLD, e.getMessage());
}
}
@Override
@ -1436,8 +1514,10 @@ public class NMSImpl implements NMSBridge {
if (en instanceof EntityHumanNPC) {
((EntityHumanNPC) en).updatePathfindingRange(pathfindingRange);
}
return;
}
if (PATHFINDING_RANGE == null)
return;
EntityInsentient handle = (EntityInsentient) en;
@ -1450,6 +1530,7 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
private static class CitizensInventoryAnvil extends CraftInventoryAnvil implements ForwardingInventory {
@ -1558,6 +1639,7 @@ public class NMSImpl implements NMSBridge {
living.setPosition(living.locX - 0.01, living.locY, living.locZ - 0.01);
living.setPosition(living.locX + 0.01, living.locY, living.locZ + 0.01);
}
}
public static void clearGoals(PathfinderGoalSelector... goalSelectors) {
@ -1570,7 +1652,9 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
Messaging.logTr(Messages.ERROR_CLEARING_GOALS, e.getLocalizedMessage());
}
}
}
private static CompoundTag convertNBT(net.minecraft.server.v1_10_R1.NBTTagCompound tag) {
@ -1580,6 +1664,7 @@ public class NMSImpl implements NMSBridge {
for (String key : tag.c()) {
tags.put(key, convertNBT(key, tag.get(key)));
}
return new CompoundTag("", tags);
}
@ -1610,8 +1695,10 @@ public class NMSImpl implements NMSBridge {
for (int i = 0; i < list.size(); i++) {
converted.add(convertNBT("", list.get(i)));
}
return new ListTag(key, tagType, converted);
}
} else if (base instanceof net.minecraft.server.v1_10_R1.NBTTagCompound)
return convertNBT((net.minecraft.server.v1_10_R1.NBTTagCompound) base);
else if (base instanceof net.minecraft.server.v1_10_R1.NBTTagEnd)
@ -1630,13 +1717,16 @@ public class NMSImpl implements NMSBridge {
if (f2 > 3.0F) {
f2 = 3.0F;
}
if (!entity.onGround) {
f2 *= 0.5F;
}
if (f2 > 0.0F) {
f4 += (0.54600006F - f4) * f2 / 3.0F;
f3 += (entity.cp() - f3) * f2 / 3.0F;
}
entity.a(f, f1, f3);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= f4;
@ -1645,10 +1735,12 @@ public class NMSImpl implements NMSBridge {
if (!entity.isNoGravity()) {
entity.motY -= 0.02D;
}
if (entity.positionChanged
&& entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d1, entity.motZ)) {
entity.motY = 0.30000001192092896D;
}
} else if (entity.ao()
&& (!(entity instanceof EntityHuman) || !((EntityHuman) entity).abilities.isFlying)) {
double d1 = entity.locY;
@ -1660,14 +1752,17 @@ public class NMSImpl implements NMSBridge {
if (!entity.isNoGravity()) {
entity.motY -= 0.02D;
}
if (entity.positionChanged
&& entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d1, entity.motZ)) {
entity.motY = 0.30000001192092896D;
}
} else if (entity.cG()) {
if (entity.motY > -0.5D) {
entity.fallDistance = 1.0F;
}
Vec3D vec3d = entity.aB();
float f5 = entity.pitch * 0.017453292F;
double d0 = Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z);
@ -1682,16 +1777,19 @@ public class NMSImpl implements NMSBridge {
entity.motX += vec3d.x * d4 / d0;
entity.motZ += vec3d.z * d4 / d0;
}
if (f5 < 0.0F) {
double d4 = d2 * -MathHelper.sin(f5) * 0.04D;
entity.motY += d4 * 3.2D;
entity.motX -= vec3d.x * d4 / d0;
entity.motZ -= vec3d.z * d4 / d0;
}
if (d0 > 0.0D) {
entity.motX += (vec3d.x / d0 * d2 - entity.motX) * 0.1D;
entity.motZ += (vec3d.z / d0 * d2 - entity.motZ) * 0.1D;
}
entity.motX *= 0.9900000095367432D;
entity.motY *= 0.9800000190734863D;
entity.motZ *= 0.9900000095367432D;
@ -1704,11 +1802,14 @@ public class NMSImpl implements NMSBridge {
entity.a(entity.e((int) f7), 1.0F, 1.0F);
entity.damageEntity(DamageSource.FLY_INTO_WALL, f7);
}
}
if (entity.onGround && !entity.world.isClientSide && entity.getFlag(7)
&& !CraftEventFactory.callToggleGlideEvent(entity, false).isCancelled()) {
entity.setFlag(7, false);
}
} else {
float f8 = 0.91F;
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition
@ -1716,6 +1817,7 @@ public class NMSImpl implements NMSBridge {
if (entity.onGround) {
f8 = entity.world.getType(blockposition_pooledblockposition).getBlock().frictionFactor * 0.91F;
}
float f4 = 0.16277136F / (f8 * f8 * f8);
float f3;
if (entity.onGround) {
@ -1723,12 +1825,14 @@ public class NMSImpl implements NMSBridge {
} else {
f3 = entity.aS;
}
entity.a(f, f1, f3);
f8 = 0.91F;
if (entity.onGround) {
f8 = entity.world.getType(blockposition_pooledblockposition.e(entity.locX,
entity.getBoundingBox().b - 1.0D, entity.locZ)).getBlock().frictionFactor * 0.91F;
}
if (entity.m_()) {
entity.motX = MathHelper.a(entity.motX, -0.15000000596046448D, 0.15000000596046448D);
entity.motZ = MathHelper.a(entity.motZ, -0.15000000596046448D, 0.15000000596046448D);
@ -1736,15 +1840,19 @@ public class NMSImpl implements NMSBridge {
if (entity.motY < -0.15D) {
entity.motY = -0.15D;
}
boolean flag = entity.isSneaking() && entity instanceof EntityHuman;
if (flag && entity.motY < 0.0D) {
entity.motY = 0.0D;
}
}
entity.move(entity.motX, entity.motY, entity.motZ);
if (entity.positionChanged && entity.m_()) {
entity.motY = 0.2D;
}
if (entity.hasEffect(MobEffects.LEVITATION)) {
entity.motY += (0.05D * (entity.getEffect(MobEffects.LEVITATION).getAmplifier() + 1) - entity.motY)
* 0.2D;
@ -1757,16 +1865,21 @@ public class NMSImpl implements NMSBridge {
} else {
entity.motY = 0.0D;
}
} else if (!entity.isNoGravity()) {
entity.motY -= 0.08D;
}
}
entity.motY *= 0.9800000190734863D;
entity.motX *= f8;
entity.motZ *= f8;
blockposition_pooledblockposition.t();
}
}
entity.aG = entity.aH;
double d1 = entity.locX - entity.lastX;
double d0 = entity.locZ - entity.lastZ;
@ -1774,6 +1887,7 @@ public class NMSImpl implements NMSBridge {
if (f2 > 1.0F) {
f2 = 1.0F;
}
entity.aH += (f2 - entity.aH) * 0.4F;
entity.aI += entity.aH;
}
@ -1804,6 +1918,7 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
@ -1825,6 +1940,7 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
public static boolean isLeashed(NPC npc, Supplier<Boolean> isLeashed, EntityInsentient entity) {
@ -1847,6 +1963,7 @@ public class NMSImpl implements NMSBridge {
if (mat != null) {
minecart.setDisplayBlock(Block.getById(mat.getId()).fromLegacyData(data));
}
minecart.setDisplayBlockOffset(offset);
}
@ -1874,10 +1991,13 @@ public class NMSImpl implements NMSBridge {
|| location.distanceSquared(player.getLocation(PACKET_CACHE_LOCATION)) > radius) {
continue;
}
for (Packet<?> packet : packets) {
NMSImpl.sendPacket(player, packet);
}
}
}
public static void sendPacketsNearby(Player from, Location location, Packet<?>... packets) {
@ -1890,6 +2010,7 @@ public class NMSImpl implements NMSBridge {
} catch (Throwable e) {
e.printStackTrace();
}
}
public static void setSize(Entity entity, float f, float f1, boolean justCreated) {
@ -1903,7 +2024,9 @@ public class NMSImpl implements NMSBridge {
if (entity.width > f2 && !justCreated && !entity.world.isClientSide) {
entity.move((f2 - entity.width) / 2, 0.0D, (f2 - entity.width) / 2);
}
}
}
public static void stopNavigation(NavigationAbstract navigation) {
@ -1921,6 +2044,7 @@ public class NMSImpl implements NMSBridge {
} else if (entity instanceof EntityHumanNPC) {
((EntityHumanNPC) entity).updateAI();
}
}
public static void updateNavigation(NavigationAbstract navigation) {
@ -1974,6 +2098,7 @@ public class NMSImpl implements NMSBridge {
} catch (Exception e) {
Messaging.logTr(Messages.ERROR_GETTING_ID_MAPPING, e.getMessage());
}
try {
MAKE_REQUEST = YggdrasilAuthenticationService.class.getDeclaredMethod("makeRequest", URL.class,
Object.class, Class.class);
@ -1981,6 +2106,7 @@ public class NMSImpl implements NMSBridge {
} catch (Exception ex) {
ex.printStackTrace();
}
try {
ENDERMAN_ANGRY = (DataWatcherObject<Boolean>) NMS.getField(EntityEnderman.class, "by").get(null);
} catch (IllegalArgumentException e) {
@ -1988,5 +2114,6 @@ public class NMSImpl implements NMSBridge {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}

View File

@ -21,6 +21,7 @@ public class PlayerAnimationImpl {
playDefaultAnimation(player, to, DEFAULTS.get(animation));
return;
}
switch (animation) {
case SNEAK:
player.getBukkitEntity().setSneaking(true);
@ -51,6 +52,7 @@ public class PlayerAnimationImpl {
default:
throw new UnsupportedOperationException();
}
}
protected static void playDefaultAnimation(EntityPlayer player, Iterable<Player> to, int code) {
@ -62,6 +64,7 @@ public class PlayerAnimationImpl {
for (Player player : to) {
NMSImpl.sendPacket(player, packet);
}
}
private static EnumMap<PlayerAnimation, Integer> DEFAULTS = Maps.newEnumMap(PlayerAnimation.class);

View File

@ -50,15 +50,18 @@ public class PlayerControllerMove extends ControllerMove {
if (f3 > f2) {
f3 = f2;
}
if (f3 < -f2) {
f3 = -f2;
}
float f4 = f + f3;
if (f4 < 0.0F) {
f4 += 360.0F;
} else if (f4 > 360.0F) {
f4 -= 360.0F;
}
return f4;
}
@ -96,8 +99,11 @@ public class PlayerControllerMove extends ControllerMove {
} else {
((EntityInsentient) this.a).getControllerJump().a();
}
}
}
}
protected int cg() {

View File

@ -64,22 +64,27 @@ public class PlayerNavigation extends NavigationAbstract {
while (localBlockPosition.getY() > 0 && this.b.getType(localBlockPosition).getMaterial() == Material.AIR) {
localBlockPosition = localBlockPosition.down();
}
if (localBlockPosition.getY() > 0)
return supera(localBlockPosition.up());
while (localBlockPosition.getY() < this.b.getHeight()
&& this.b.getType(localBlockPosition).getMaterial() == Material.AIR) {
localBlockPosition = localBlockPosition.up();
}
paramBlockPosition = localBlockPosition;
}
if (this.b.getType(paramBlockPosition).getMaterial().isBuildable()) {
localBlockPosition = paramBlockPosition.up();
while (localBlockPosition.getY() < this.b.getHeight()
&& this.b.getType(localBlockPosition).getMaterial().isBuildable()) {
localBlockPosition = localBlockPosition.up();
}
return a2(localBlockPosition);
}
return a2(paramBlockPosition);
}
@ -138,8 +143,11 @@ public class PlayerNavigation extends NavigationAbstract {
|| localPathType == PathType.DAMAGE_OTHER)
return false;
}
}
}
return true;
}
@ -149,9 +157,11 @@ public class PlayerNavigation extends NavigationAbstract {
this.c = null;
return false;
}
if (!paramPathEntity.a(this.c)) {
this.c = paramPathEntity;
}
d();
if (this.c.d() == 0)
return false;
@ -168,9 +178,11 @@ public class PlayerNavigation extends NavigationAbstract {
if (paramVec3D.distanceSquared(this.j) < 2.25D) {
o();
}
this.i = this.h;
this.j = paramVec3D;
}
if (this.c != null && !this.c.b()) {
Vec3D localVec3D = this.c.f();
if (!localVec3D.equals(this.k)) {
@ -180,14 +192,17 @@ public class PlayerNavigation extends NavigationAbstract {
} else {
this.l += System.currentTimeMillis() - this.m;
}
if (this.n > 0.0D && this.l > this.n * 3.0D) {
this.k = Vec3D.a;
this.l = 0L;
this.n = 0.0D;
o();
}
this.m = System.currentTimeMillis();
}
}
@Override
@ -215,9 +230,11 @@ public class PlayerNavigation extends NavigationAbstract {
if (d1 >= 0.0D) {
d7 += 1.0D;
}
if (d2 >= 0.0D) {
d8 += 1.0D;
}
d7 /= d1;
d8 /= d2;
int k = d1 < 0.0D ? -1 : 1;
@ -236,9 +253,11 @@ public class PlayerNavigation extends NavigationAbstract {
j += m;
i3 = i1 - j;
}
if (!a(i, (int) paramVec3D1.y, j, paramInt1, paramInt2, paramInt3, paramVec3D1, d1, d2))
return false;
}
return true;
}
@ -284,7 +303,9 @@ public class PlayerNavigation extends NavigationAbstract {
if (!localBlock.b(this.b, localBlockPosition))
return false;
}
}
return true;
}
@ -313,8 +334,11 @@ public class PlayerNavigation extends NavigationAbstract {
this.c.a(i + 1, ((PathPoint) localObject).a(((PathPoint) localObject).a, localPathPoint.b + 1,
((PathPoint) localObject).c));
}
}
}
if (this.f2) {
if (this.b.h(new BlockPosition(MathHelper.floor(this.a.locX), (int) (this.a.getBoundingBox().b + 0.5D),
MathHelper.floor(this.a.locZ))))
@ -325,8 +349,11 @@ public class PlayerNavigation extends NavigationAbstract {
this.c.b(i - 1);
return;
}
}
}
}
public boolean f() {
@ -356,9 +383,11 @@ public class PlayerNavigation extends NavigationAbstract {
this.q = this.b.getTime();
this.p = false;
}
} else {
this.p = true;
}
}
@Override
@ -372,6 +401,7 @@ public class PlayerNavigation extends NavigationAbstract {
if (this.p) {
j();
}
if (n())
return;
if (b()) {
@ -384,7 +414,9 @@ public class PlayerNavigation extends NavigationAbstract {
&& MathHelper.floor(localVec3D.z) == MathHelper.floor(localObject.z)) {
this.c.c(this.c.e() + 1);
}
}
if (n())
return;
Vec3D localVec3D = this.c.a(this.a);
@ -406,13 +438,16 @@ public class PlayerNavigation extends NavigationAbstract {
i1 = i2;
break;
}
}
this.o = this.a.width > 0.75F ? this.a.width / 2.0F : 0.75F - this.a.width / 2.0F;
Vec3D localVec3D2 = this.c.f();
if (MathHelper.e((float) (this.a.locX - (localVec3D2.x + 0.5D))) < this.o
&& MathHelper.e((float) (this.a.locZ - (localVec3D2.z + 0.5D))) < this.o) {
this.c.c(this.c.e() + 1);
}
int i3 = MathHelper.f(this.a.width);
int i4 = (int) this.a.length + 1;
int i5 = i3;
@ -421,7 +456,9 @@ public class PlayerNavigation extends NavigationAbstract {
this.c.c(i6);
break;
}
}
a(localVec3D1);
}
@ -456,6 +493,7 @@ public class PlayerNavigation extends NavigationAbstract {
if (j > 16)
return (int) this.a.getBoundingBox().b;
}
return i;
}

View File

@ -51,6 +51,7 @@ public class PlayerPathfinder {
i++;
localPathPoint = localPathPoint.h;
}
PathPoint[] arrayOfPathPoint = new PathPoint[i];
localPathPoint = paramPathPoint2;
arrayOfPathPoint[--i] = localPathPoint;
@ -58,6 +59,7 @@ public class PlayerPathfinder {
localPathPoint = localPathPoint.h;
arrayOfPathPoint[--i] = localPathPoint;
}
return new PathEntity(arrayOfPathPoint);
}
@ -75,14 +77,17 @@ public class PlayerPathfinder {
if (i >= 2000) {
break;
}
PathPoint localObject2 = this.a.c();
if (localObject2.equals(paramPathPoint2)) {
localObject1 = paramPathPoint2;
break;
}
if (localObject2.c(paramPathPoint2) < ((PathPoint) localObject1).c(paramPathPoint2)) {
localObject1 = localObject2;
}
localObject2.i = true;
int j = this.d.a(this.c, localObject2, paramPathPoint2, paramFloat);
for (int k = 0; k < j; k++) {
@ -101,9 +106,13 @@ public class PlayerPathfinder {
localPathPoint.g = localPathPoint.e + localPathPoint.f;
this.a.a(localPathPoint);
}
}
}
}
if (localObject1 == paramPathPoint1)
return null;
Object localObject2 = a(paramPathPoint1, (PathPoint) localObject1);

View File

@ -56,6 +56,7 @@ public abstract class PlayerPathfinderAbstract extends PathfinderAbstract {
localPathPoint = new PathPoint(paramInt1, paramInt2, paramInt3);
this.c.a(j, localPathPoint);
}
return localPathPoint;
}

View File

@ -61,10 +61,12 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
while (localPathType2 == PathType.OPEN && --paramInt2 >= 1) {
localPathType2 = getPathTypeBase(paramIBlockAccess, paramInt1, paramInt2, paramInt3);
}
localPathType1 = localPathType2 == PathType.WALKABLE || localPathType2 == PathType.OPEN
|| localPathType2 == PathType.WATER || localPathType2 == PathType.LAVA ? PathType.OPEN
: PathType.WALKABLE;
}
if (localPathType1 == PathType.WALKABLE) {
for (int i = paramInt1 - 1; i <= paramInt1 + 1; i++) {
for (int k = paramInt3 - 1; k <= paramInt3 + 1; k++) {
@ -75,10 +77,15 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
} else if (localBlock2 == Blocks.FIRE) {
localPathType1 = PathType.DANGER_FIRE;
}
}
}
}
}
return localPathType1;
}
@ -97,9 +104,11 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (localPathType2 == PathType.DOOR_WOOD_CLOSED && paramBoolean1 && paramBoolean2) {
localPathType2 = PathType.WALKABLE;
}
if (localPathType2 == PathType.DOOR_OPEN && !paramBoolean2) {
localPathType2 = PathType.BLOCKED;
}
if (localPathType2 == PathType.RAIL
&& !(paramIBlockAccess.getType(localBlockPosition)
.getBlock() instanceof BlockMinecartTrackAbstract)
@ -107,20 +116,27 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
.getBlock() instanceof BlockMinecartTrackAbstract)) {
localPathType2 = PathType.FENCE;
}
if (i == paramInt1 && k == paramInt2 && m == paramInt3) {
localObject1 = localPathType2;
}
if (k > paramInt2 && localPathType2 != PathType.OPEN) {
AxisAlignedBB localAxisAlignedBB = new AxisAlignedBB(i - d + 0.5D, paramInt2 + 0.001D,
m - d + 0.5D, i + d + 0.5D, paramInt2 + paramEntityInsentient.length, m + d + 0.5D);
if (!paramEntityInsentient.world.b(localAxisAlignedBB)) {
localPathType2 = PathType.OPEN;
}
}
localEnumSet.add(localPathType2);
}
}
}
if (localEnumSet.contains(PathType.FENCE))
return PathType.FENCE;
Object localObject2 = PathType.BLOCKED;
@ -130,7 +146,9 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a((PathType) localObject2)) {
localObject2 = localPathType1;
}
}
if (localObject1 == PathType.OPEN && paramEntityInsentient.a((PathType) localObject2) == 0.0F)
return PathType.OPEN;
return (PathType) localObject2;
@ -151,9 +169,11 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (localPathType2 == PathType.DOOR_WOOD_CLOSED && paramBoolean1 && paramBoolean2) {
localPathType2 = PathType.WALKABLE;
}
if (localPathType2 == PathType.DOOR_OPEN && !paramBoolean2) {
localPathType2 = PathType.BLOCKED;
}
if (localPathType2 == PathType.RAIL
&& !(paramIBlockAccess.getType(localBlockPosition)
.getBlock() instanceof BlockMinecartTrackAbstract)
@ -161,20 +181,27 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
.getBlock() instanceof BlockMinecartTrackAbstract)) {
localPathType2 = PathType.FENCE;
}
if (i == paramInt1 && k == paramInt2 && m == paramInt3) {
localObject1 = localPathType2;
}
if (k > paramInt2 && localPathType2 != PathType.OPEN) {
AxisAlignedBB localAxisAlignedBB = new AxisAlignedBB(i - d + 0.5D, paramInt2 + 0.001D,
m - d + 0.5D, i + d + 0.5D, paramInt2 + paramEntityInsentient.length, m + d + 0.5D);
if (!paramEntityInsentient.world.b(localAxisAlignedBB)) {
localPathType2 = PathType.OPEN;
}
}
localEnumSet.add(localPathType2);
}
}
}
if (localEnumSet.contains(PathType.FENCE))
return PathType.FENCE;
Object localObject2 = PathType.BLOCKED;
@ -184,7 +211,9 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a((PathType) localObject2)) {
localObject2 = localPathType1;
}
}
if (localObject1 == PathType.OPEN && paramEntityInsentient.a((PathType) localObject2) == 0.0F)
return PathType.OPEN;
return (PathType) localObject2;
@ -206,6 +235,7 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
localPathPoint.m = localPathType;
localPathPoint.l = Math.max(localPathPoint.l, f);
}
if (localPathType == PathType.WALKABLE)
return localPathPoint;
if (localPathPoint == null && paramInt4 > 0 && localPathType != PathType.FENCE
@ -222,8 +252,11 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (this.b.world.b(localAxisAlignedBB3)) {
localPathPoint = null;
}
}
}
if (localPathType == PathType.OPEN) {
AxisAlignedBB localAxisAlignedBB4 = new AxisAlignedBB(paramInt1 - d2 + 0.5D, paramInt2 + 0.001D,
paramInt3 - d2 + 0.5D, paramInt1 + d2 + 0.5D, paramInt2 + this.b.length, paramInt3 + d2 + 0.5D);
@ -242,8 +275,11 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
localPathPoint.l = Math.max(localPathPoint.l, f);
} else if (f < 0.0F)
return null;
}
}
return localPathPoint;
}
@ -256,6 +292,7 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (this.b.a(localPathType) >= 0.0F) {
k = 1;
}
BlockPosition localBlockPosition = new BlockPosition(paramPathPoint1.a, paramPathPoint1.b, paramPathPoint1.c)
.down();
double d = paramPathPoint1.b - (1.0D - this.a.getType(localBlockPosition).c(this.a, localBlockPosition).e);
@ -270,15 +307,19 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (localPathPoint1 != null && !localPathPoint1.i && localPathPoint1.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint1;
}
if (localPathPoint2 != null && !localPathPoint2.i && localPathPoint2.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint2;
}
if (localPathPoint3 != null && !localPathPoint3.i && localPathPoint3.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint3;
}
if (localPathPoint4 != null && !localPathPoint4.i && localPathPoint4.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint4;
}
int m = localPathPoint4 == null || localPathPoint4.m == PathType.OPEN || localPathPoint4.l != 0.0F ? 1 : 0;
int n = localPathPoint1 == null || localPathPoint1.m == PathType.OPEN || localPathPoint1.l != 0.0F ? 1 : 0;
int i1 = localPathPoint3 == null || localPathPoint3.m == PathType.OPEN || localPathPoint3.l != 0.0F ? 1 : 0;
@ -290,28 +331,36 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (localPathPoint5 != null && !localPathPoint5.i && localPathPoint5.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint5;
}
}
if (m != 0 && i1 != 0) {
localPathPoint5 = a(paramPathPoint1.a + 1, paramPathPoint1.b, paramPathPoint1.c - 1, k, d,
EnumDirection.NORTH);
if (localPathPoint5 != null && !localPathPoint5.i && localPathPoint5.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint5;
}
}
if (n != 0 && i2 != 0) {
localPathPoint5 = a(paramPathPoint1.a - 1, paramPathPoint1.b, paramPathPoint1.c + 1, k, d,
EnumDirection.SOUTH);
if (localPathPoint5 != null && !localPathPoint5.i && localPathPoint5.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint5;
}
}
if (n != 0 && i1 != 0) {
localPathPoint5 = a(paramPathPoint1.a + 1, paramPathPoint1.b, paramPathPoint1.c + 1, k, d,
EnumDirection.SOUTH);
if (localPathPoint5 != null && !localPathPoint5.i && localPathPoint5.a(paramPathPoint2) < paramFloat) {
paramArrayOfPathPoint[i++] = localPathPoint5;
}
}
return i;
}
@ -330,16 +379,19 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
MathHelper.floor(this.b.locZ));
localObject2 = this.a.getType(localObject1).getBlock();
}
} else if (!this.b.onGround) {
localObject1 = new BlockPosition(this.b);
while ((this.a.getType(localObject1).getMaterial() == Material.AIR
|| this.a.getType(localObject1).getBlock().b(this.a, localObject1)) && localObject1.getY() > 0) {
localObject1 = localObject1.down();
}
i = localObject1.up().getY();
} else {
i = MathHelper.floor(this.b.getBoundingBox().b + 0.5D);
}
localObject1 = new BlockPosition(this.b);
Object localObject2 = a(this.b, localObject1.getX(), i, localObject1.getZ());
if (this.b.a((PathType) localObject2) < 0.0F) {
@ -353,7 +405,9 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (this.b.a(localPathType) >= 0.0F)
return a(localBlockPosition.getX(), localBlockPosition.getY(), localBlockPosition.getZ());
}
}
return a(localObject1.getX(), i, localObject1.getZ());
}
@ -390,9 +444,11 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
if (localMaterial == Material.LAVA)
return PathType.LAVA;
}
if (localBlock1.b(paramIBlockAccess, localBlockPosition) && localPathType1 == PathType.BLOCKED) {
localPathType1 = PathType.OPEN;
}
return localPathType1;
}
}

View File

@ -59,7 +59,9 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
Bukkit.getPluginManager().callEvent(
new NPCLinkToPlayerEvent(((NPCHolder) tracker).getNPC(), entityplayer.getBukkitEntity()));
}
}
}
private static int getE(EntityTrackerEntry entry) {
@ -73,6 +75,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return 0;
}
@ -84,6 +87,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return 0;
}
@ -95,6 +99,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return 0;
}
@ -106,6 +111,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
@ -117,6 +123,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return false;
}

View File

@ -80,6 +80,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -90,6 +91,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class ArmorStandController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -110,6 +113,7 @@ public class ArmorStandController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ArmorStandNPC(this);
}
return super.getBukkitEntity();
}

View File

@ -58,6 +58,7 @@ public class BatController extends MobEntityController {
if (npc != null) {
setAsleep(false);
}
}
@Override
@ -99,6 +100,7 @@ public class BatController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -112,6 +114,7 @@ public class BatController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -124,6 +127,7 @@ public class BatController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new BatNPC(this);
}
return super.getBukkitEntity();
}
@ -142,6 +146,7 @@ public class BatController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -152,6 +157,7 @@ public class BatController extends MobEntityController {
NMSImpl.updateAI(this);
npc.update();
}
}
}
}

View File

@ -96,6 +96,7 @@ public class BlazeController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -109,6 +110,7 @@ public class BlazeController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -121,6 +123,7 @@ public class BlazeController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new BlazeNPC(this);
}
return super.getBukkitEntity();
}
@ -139,6 +142,7 @@ public class BlazeController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -146,6 +150,7 @@ public class BlazeController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
}
}

View File

@ -69,6 +69,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class CaveSpiderController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class CaveSpiderController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CaveSpiderNPC(this);
}
return super.getBukkitEntity();
}
@ -164,6 +170,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -172,6 +179,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -189,6 +197,7 @@ public class CaveSpiderController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -70,6 +70,7 @@ public class ChickenController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -78,6 +79,7 @@ public class ChickenController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -114,6 +116,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -126,6 +129,7 @@ public class ChickenController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -134,6 +138,7 @@ public class ChickenController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -143,6 +148,7 @@ public class ChickenController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -155,6 +161,7 @@ public class ChickenController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new ChickenNPC(this);
}
return super.getBukkitEntity();
}
@ -173,6 +180,7 @@ public class ChickenController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -181,6 +189,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -196,6 +205,7 @@ public class ChickenController extends MobEntityController {
if (npc != null) {
this.bC = 100; // egg timer
}
super.n();
}
}

View File

@ -74,6 +74,7 @@ public class CowController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -82,6 +83,7 @@ public class CowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -128,6 +130,7 @@ public class CowController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -140,6 +143,7 @@ public class CowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -148,6 +152,7 @@ public class CowController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -157,6 +162,7 @@ public class CowController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -169,6 +175,7 @@ public class CowController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CowNPC(this);
}
return super.getBukkitEntity();
}
@ -187,6 +194,7 @@ public class CowController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -195,6 +203,7 @@ public class CowController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -72,6 +72,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -108,6 +109,7 @@ public class CreeperController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -120,6 +122,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isProtected()) {
super.dk();
}
}
@Override
@ -127,6 +130,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -135,6 +139,7 @@ public class CreeperController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -144,6 +149,7 @@ public class CreeperController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -156,6 +162,7 @@ public class CreeperController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new CreeperNPC(this);
}
return super.getBukkitEntity();
}
@ -174,6 +181,7 @@ public class CreeperController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -182,6 +190,7 @@ public class CreeperController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -197,6 +206,7 @@ public class CreeperController extends MobEntityController {
if (npc == null || allowPowered) {
super.onLightningStrike(entitylightning);
}
}
public void setAllowPowered(boolean allowPowered) {
@ -210,6 +220,7 @@ public class CreeperController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -103,6 +103,7 @@ public class EnderDragonController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -122,6 +123,7 @@ public class EnderDragonController extends MobEntityController {
motY = old.y;
motZ = old.z;
}
return res;
}
@ -131,6 +133,7 @@ public class EnderDragonController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -143,6 +146,7 @@ public class EnderDragonController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EnderDragonNPC(this);
}
return super.getBukkitEntity();
}
@ -161,6 +165,7 @@ public class EnderDragonController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -168,16 +173,19 @@ public class EnderDragonController extends MobEntityController {
if (npc != null) {
npc.update();
}
if (npc != null) {
if (getDragonControllerManager().a().getControllerPhase() == DragonControllerPhase.j) {
setHealth(0F);
return;
}
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;
this.b[i][1] = this.locY;
}
}
if (++this.c == this.b.length) {
@ -200,6 +208,7 @@ public class EnderDragonController extends MobEntityController {
if (getBukkitEntity().getPassenger() != null) {
yaw = getBukkitEntity().getPassenger().getLocation().getYaw() - 180;
}
if (motX != 0 || motY != 0 || motZ != 0) {
motX *= 0.98;
motY *= 0.98;
@ -207,6 +216,7 @@ public class EnderDragonController extends MobEntityController {
if (getBukkitEntity().getPassenger() == null) {
yaw = Util.getDragonYaw(getBukkitEntity(), motX, motZ);
}
setPosition(locX + motX, locY + motY, locZ + motZ);
}
@ -219,8 +229,11 @@ public class EnderDragonController extends MobEntityController {
} catch (Throwable e) {
e.printStackTrace();
}
}
}
if (npc.data().get(NPC.Metadata.COLLIDABLE, false)) {
try {
KNOCKBACK.invoke(this, this.world.getEntities(this,
@ -234,10 +247,13 @@ public class EnderDragonController extends MobEntityController {
} catch (Throwable t) {
t.printStackTrace();
}
}
} else {
super.n();
}
}
private static final MethodHandle HURT = NMS.getMethodHandle(EntityEnderDragon.class, "b", true,

View File

@ -69,6 +69,7 @@ public class EndermanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class EndermanController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class EndermanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class EndermanController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class EndermanController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class EndermanController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EndermanNPC(this);
}
return super.getBukkitEntity();
}
@ -171,6 +177,7 @@ public class EndermanController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -179,6 +186,7 @@ public class EndermanController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -196,6 +204,7 @@ public class EndermanController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -69,6 +69,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -105,6 +106,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -117,6 +119,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -125,6 +128,7 @@ public class EndermiteController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -134,6 +138,7 @@ public class EndermiteController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -146,6 +151,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EndermiteNPC(this);
}
return super.getBukkitEntity();
}
@ -164,6 +170,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -172,6 +179,7 @@ public class EndermiteController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -189,6 +197,7 @@ public class EndermiteController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}
}

View File

@ -86,6 +86,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
skinTracker = null;
}
}
@Override
@ -93,6 +94,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -140,6 +142,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -152,6 +155,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
velocityChanged = false;
Bukkit.getScheduler().runTask(CitizensAPI.getPlugin(), () -> EntityHumanNPC.this.velocityChanged = true);
}
return damaged;
}
@ -162,7 +166,14 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (dead)
return;
super.die(damagesource);
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 15); // give enough time for death and smoke animation
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 15); // give
// enough
// time
// for
// death
// and
// smoke
// animation
}
@Override
@ -170,6 +181,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -178,6 +190,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -187,6 +200,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -194,6 +208,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new PlayerNPC(this);
}
return super.getBukkitEntity();
}
@ -227,6 +242,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (skinName == null) {
skinName = npc.getName();
}
return skinName.toLowerCase();
}
@ -250,10 +266,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} catch (IOException e) {
// swallow
}
AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
if (range == null) {
range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE);
}
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
controllerJump = new PlayerControllerJump(this);
controllerMove = new PlayerControllerMove(this);
@ -287,9 +305,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
cm();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;
@ -298,6 +318,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (jumpTicks > 0) {
jumpTicks--;
}
}
private void moveWithFallDamage(float mx, float my) {
@ -306,6 +327,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (!npc.isProtected()) {
a(this.locY - y, onGround);
}
}
@Override
@ -314,6 +336,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
super.playerTick();
return;
}
cA();
boolean navigating = npc.getNavigator().isNavigating();
if (!navigating && getBukkitEntity() != null
@ -322,15 +345,19 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
moveWithFallDamage(0, 0);
}
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
motX = motY = motZ = 0;
}
if (navigating) {
if (!NMSImpl.isNavigationFinished(navigation)) {
NMSImpl.updateNavigation(navigation);
}
moveOnCurrentHeading();
}
updateAI();
ct();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
@ -340,12 +367,16 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} else {
axisalignedbb = this.getBoundingBox().grow(1.0, 0.5, 1.0);
}
for (Entity entity : this.world.getEntities(this, axisalignedbb)) {
if (!entity.dead) {
entity.d(this);
}
}
}
}
public void setMoveDestination(double x, double y, double z, double speed) {
@ -405,9 +436,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (equipment != null && !equipment.isEmpty()) {
this.getAttributeMap().b(equipment.a(slot));
}
}
equipmentCache.put(slot, equipment);
}
if (!itemChanged)
return;
Location current = getBukkitEntity().getLocation(packetLocationCache);
@ -416,6 +450,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
}
NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
}

View File

@ -55,6 +55,7 @@ public class EvokerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class EvokerController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class EvokerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class EvokerController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class EvokerController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class EvokerController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new EvokerNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class EvokerController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class EvokerController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -82,6 +82,7 @@ public class GhastController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -100,6 +101,7 @@ public class GhastController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -112,6 +114,7 @@ public class GhastController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GhastNPC(this);
}
return super.getBukkitEntity();
}
@ -130,6 +133,7 @@ public class GhastController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -137,6 +141,7 @@ public class GhastController extends MobEntityController {
if (npc != null) {
npc.update();
}
super.M();
}
}

View File

@ -55,6 +55,7 @@ public class GiantController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class GiantController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class GiantController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class GiantController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class GiantController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class GiantController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GiantNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class GiantController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -158,6 +165,7 @@ public class GiantController extends MobEntityController {
if (npc != null) {
npc.update();
}
}
@Override
@ -175,6 +183,7 @@ public class GiantController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class GuardianController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class GuardianController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class GuardianController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class GuardianController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class GuardianController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class GuardianController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GuardianNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class GuardianController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -168,6 +175,7 @@ public class GuardianController extends MobEntityController {
NMSImpl.updateAI(this);
npc.update();
}
}
@Override
@ -177,6 +185,7 @@ public class GuardianController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -55,6 +55,7 @@ public class GuardianElderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -91,6 +92,7 @@ public class GuardianElderController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -103,6 +105,7 @@ public class GuardianElderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -111,6 +114,7 @@ public class GuardianElderController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -120,6 +124,7 @@ public class GuardianElderController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -132,6 +137,7 @@ public class GuardianElderController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new GuardianElderNPC(this);
}
return super.getBukkitEntity();
}
@ -150,6 +156,7 @@ public class GuardianElderController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -168,6 +175,7 @@ public class GuardianElderController extends MobEntityController {
NMSImpl.updateAI(this);
npc.update();
}
}
@Override
@ -177,6 +185,7 @@ public class GuardianElderController extends MobEntityController {
} else {
NMSImpl.setSize(this, f, f1, justCreated);
}
}
}

View File

@ -60,6 +60,7 @@ public class HorseController extends MobEntityController {
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
}
}
@Override
@ -73,6 +74,7 @@ public class HorseController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -81,6 +83,7 @@ public class HorseController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -117,6 +120,7 @@ public class HorseController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -129,6 +133,7 @@ public class HorseController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -137,6 +142,7 @@ public class HorseController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -146,6 +152,7 @@ public class HorseController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -158,6 +165,7 @@ public class HorseController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new HorseNPC(this);
}
return super.getBukkitEntity();
}
@ -176,6 +184,7 @@ public class HorseController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -189,12 +198,15 @@ public class HorseController extends MobEntityController {
} else {
riding = false;
}
if (riding) {
c(4, true);
}
NMS.setStepHeight(getBukkitEntity(), 1);
npc.update();
}
}
@Override

View File

@ -62,6 +62,7 @@ public class HorseDonkeyController extends MobEntityController {
.setDomestication(((AbstractHorse) getBukkitEntity()).getMaxDomestication());
baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
}
}
@Override
@ -75,6 +76,7 @@ public class HorseDonkeyController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -83,6 +85,7 @@ public class HorseDonkeyController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -119,6 +122,7 @@ public class HorseDonkeyController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -131,6 +135,7 @@ public class HorseDonkeyController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -139,6 +144,7 @@ public class HorseDonkeyController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -148,6 +154,7 @@ public class HorseDonkeyController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -160,6 +167,7 @@ public class HorseDonkeyController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new HorseDonkeyNPC(this);
}
return super.getBukkitEntity();
}
@ -178,6 +186,7 @@ public class HorseDonkeyController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -191,12 +200,15 @@ public class HorseDonkeyController extends MobEntityController {
} else {
riding = false;
}
if (riding) {
c(4, true);
}
NMS.setStepHeight(getBukkitEntity(), 1);
npc.update();
}
}
@Override

View File

@ -62,6 +62,7 @@ public class HorseMuleController extends MobEntityController {
.setDomestication(((AbstractHorse) getBukkitEntity()).getMaxDomestication());
baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
}
}
@Override
@ -75,6 +76,7 @@ public class HorseMuleController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -83,6 +85,7 @@ public class HorseMuleController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -119,6 +122,7 @@ public class HorseMuleController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -131,6 +135,7 @@ public class HorseMuleController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -139,6 +144,7 @@ public class HorseMuleController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -148,6 +154,7 @@ public class HorseMuleController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -160,6 +167,7 @@ public class HorseMuleController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new HorseMuleNPC(this);
}
return super.getBukkitEntity();
}
@ -178,6 +186,7 @@ public class HorseMuleController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -191,12 +200,15 @@ public class HorseMuleController extends MobEntityController {
} else {
riding = false;
}
if (riding) {
c(4, true);
}
NMS.setStepHeight(getBukkitEntity(), 1);
npc.update();
}
}
@Override

View File

@ -62,6 +62,7 @@ public class HorseSkeletonController extends MobEntityController {
.setDomestication(((AbstractHorse) getBukkitEntity()).getMaxDomestication());
baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
}
}
@Override
@ -75,6 +76,7 @@ public class HorseSkeletonController extends MobEntityController {
super.a(flag);
return;
}
NMSImpl.checkAndUpdateHeight(this, flag, super::a);
}
@ -83,6 +85,7 @@ public class HorseSkeletonController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.a(d0, flag, block, blockposition);
}
}
@Override
@ -119,6 +122,7 @@ public class HorseSkeletonController extends MobEntityController {
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -131,6 +135,7 @@ public class HorseSkeletonController extends MobEntityController {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
@ -139,6 +144,7 @@ public class HorseSkeletonController extends MobEntityController {
if (vector != null) {
super.f(vector.getX(), vector.getY(), vector.getZ());
}
}
@Override
@ -148,6 +154,7 @@ public class HorseSkeletonController extends MobEntityController {
} else {
NMSImpl.flyingMoveLogic(this, f, f1);
}
}
@Override
@ -160,6 +167,7 @@ public class HorseSkeletonController extends MobEntityController {
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
bukkitEntity = new HorseSkeletonNPC(this);
}
return super.getBukkitEntity();
}
@ -178,6 +186,7 @@ public class HorseSkeletonController extends MobEntityController {
if (npc == null) {
super.L();
}
}
@Override
@ -191,12 +200,15 @@ public class HorseSkeletonController extends MobEntityController {
} else {
riding = false;
}
if (riding) {
c(4, true);
}
NMS.setStepHeight(getBukkitEntity(), 1);
npc.update();
}
}
@Override

Some files were not shown because too many files have changed in this diff Show More