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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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