Preliminary 1.13 update

This commit is contained in:
fullwall 2018-07-22 14:27:08 +08:00
parent 0cb3096125
commit ecfc4f451c
63 changed files with 219 additions and 191 deletions

View File

@ -12,7 +12,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.13-pre7-R0.1-SNAPSHOT</craftbukkit.version>
<craftbukkit.version>1.13-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0.23-SNAPSHOT</citizensapi.version>
<vault.version>1.5.4</vault.version>
<powermock.version>1.4.12</powermock.version>

View File

@ -92,7 +92,8 @@ public class Util {
}
public static boolean isAlwaysFlyable(EntityType type) {
if (type.name().toLowerCase().contains("vex") || type.name().toLowerCase().contains("parrot"))
if (type.name().toLowerCase().equals("vex") || type.name().toLowerCase().equals("parrot")
|| type.name().toLowerCase().equals("phantom"))
// 1.8.8 compatibility
return true;
switch (type) {

View File

@ -11,7 +11,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.13-pre7-R0.1-SNAPSHOT</craftbukkit.version>
<craftbukkit.version>1.13-R0.1-SNAPSHOT</craftbukkit.version>
</properties>
<repositories>

View File

@ -61,8 +61,8 @@ public class BatController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -60,8 +60,8 @@ public class BlazeController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -78,8 +78,8 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -106,8 +106,8 @@ public class ChickenController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -94,8 +94,8 @@ public class CodController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -90,8 +90,8 @@ public class CowController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class CreeperController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -58,6 +58,7 @@ public class DolphinController extends MobEntityController {
this.npc = (CitizensNPC) npc;
if (npc != null) {
NMSImpl.clearGoals(goalSelector, targetSelector);
this.setNoAI(true);
}
}
@ -94,8 +95,8 @@ public class DolphinController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -94,8 +94,8 @@ public class DrownedController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -60,8 +60,8 @@ public class EnderDragonController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -78,8 +78,8 @@ public class EndermanController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -78,8 +78,8 @@ public class EndermiteController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class EvokerController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -51,8 +51,8 @@ public class GhastController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class GiantController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class GuardianController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class GuardianElderController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -85,8 +85,8 @@ public class HorseController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -85,8 +85,8 @@ public class HorseDonkeyController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -85,8 +85,8 @@ public class HorseMuleController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -86,8 +86,8 @@ public class HorseSkeletonController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -86,8 +86,8 @@ public class HorseZombieController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class IllusionerController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class IronGolemController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -85,8 +85,8 @@ public class LlamaController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -76,8 +76,8 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -76,8 +76,8 @@ public class MushroomCowController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -92,8 +92,8 @@ public class OcelotController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override
@ -112,9 +112,9 @@ public class OcelotController extends MobEntityController {
}
@Override
protected void dz() {
protected void dA() {
if (npc == null) {
super.dz();
super.dA();
}
}

View File

@ -57,8 +57,8 @@ public class ParrotController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -15,8 +15,11 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_13_R1.BlockPosition;
import net.minecraft.server.v1_13_R1.ControllerLook;
import net.minecraft.server.v1_13_R1.ControllerMove;
import net.minecraft.server.v1_13_R1.DamageSource;
import net.minecraft.server.v1_13_R1.EntityPhantom;
import net.minecraft.server.v1_13_R1.EnumDifficulty;
import net.minecraft.server.v1_13_R1.IBlockData;
import net.minecraft.server.v1_13_R1.NBTTagCompound;
import net.minecraft.server.v1_13_R1.SoundEffect;
@ -45,6 +48,9 @@ public class PhantomController extends MobEntityController {
if (npc != null) {
NMSImpl.clearGoals(goalSelector, targetSelector);
setNoAI(true);
this.moveController = new ControllerMove(this);
this.lookController = new ControllerLook(this);
// TODO: phantom pitch reversed
}
}
@ -81,8 +87,8 @@ public class PhantomController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override
@ -101,9 +107,9 @@ public class PhantomController extends MobEntityController {
}
@Override
public boolean dq() {
public boolean dr() {
if (npc == null || !npc.isProtected())
return super.dq();
return super.dr();
return false;
}
@ -176,14 +182,28 @@ public class PhantomController extends MobEntityController {
@Override
public void k() {
if (npc == null) {
super.k();
} else {
NMSImpl.updateAI(this);
super.k();
if (npc != null) {
if (npc.isProtected()) {
this.setOnFire(0);
}
npc.update();
}
}
@Override
public void tick() {
// avoid suicide
boolean resetDifficulty = this.world.getDifficulty() == EnumDifficulty.PEACEFUL;
if (npc != null && resetDifficulty) {
this.world.getWorldData().setDifficulty(EnumDifficulty.NORMAL);
}
super.tick();
if (npc != null && resetDifficulty) {
this.world.getWorldData().setDifficulty(EnumDifficulty.PEACEFUL);
}
}
@Override
public boolean z_() {
if (npc == null || !npc.isFlyable()) {

View File

@ -93,8 +93,8 @@ public class PigController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override
@ -113,9 +113,9 @@ public class PigController extends MobEntityController {
}
@Override
public boolean dh() {
public boolean di() {
// block carrot-on-a-stick behaviour
return npc == null ? super.dh() : false;
return npc == null ? super.di() : false;
}
@Override

View File

@ -65,8 +65,8 @@ public class PigZombieController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -57,8 +57,8 @@ public class PolarBearController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class PufferFishController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -94,8 +94,8 @@ public class RabbitController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class SalmonController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -75,8 +75,8 @@ public class SheepController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -81,8 +81,8 @@ public class ShulkerController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -54,8 +54,8 @@ public class SilverfishController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class SkeletonController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class SkeletonStrayController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class SkeletonWitherController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -76,8 +76,8 @@ public class SlimeController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class SnowmanController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class SpiderController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class SquidController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class TropicalFishController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -80,8 +80,8 @@ public class TurtleController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -47,8 +47,8 @@ public class VexController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -112,8 +112,8 @@ public class VillagerController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -75,8 +75,8 @@ public class VindicatorController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class WitchController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -46,8 +46,8 @@ public class WitherController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -77,8 +77,8 @@ public class WolfController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class ZombieController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class ZombieHuskController extends MobEntityController {
}
@Override
protected SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
protected SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -64,8 +64,8 @@ public class ZombieVillagerController extends MobEntityController {
}
@Override
public SoundEffect cr() {
return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA);
public SoundEffect cs() {
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
}
@Override

View File

@ -486,10 +486,10 @@ public class NMSImpl implements NMSBridge {
@Override
public void stop() {
if (navigation.n() != null) {
if (navigation.m() != null) {
for (Player player : Bukkit.getOnlinePlayers()) {
for (int i = 0; i < navigation.n().d(); i++) {
PathPoint pp = navigation.n().a(i);
for (int i = 0; i < navigation.m().d(); i++) {
PathPoint pp = navigation.m().a(i);
org.bukkit.block.Block block = new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld())
.getBlock();
player.sendBlockChange(block.getLocation(), block.getType(), block.getData());
@ -520,8 +520,8 @@ public class NMSImpl implements NMSBridge {
}
if (params.debug() && !NMSImpl.isNavigationFinished(navigation)) {
for (Player player : Bukkit.getOnlinePlayers()) {
for (int i = 0; i < navigation.n().d(); i++) {
PathPoint pp = navigation.n().a(i);
for (int i = 0; i < navigation.m().d(); i++) {
PathPoint pp = navigation.m().a(i);
player.sendBlockChange(new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()),
Material.SUNFLOWER, (byte) 0);
}
@ -1165,9 +1165,9 @@ public class NMSImpl implements NMSBridge {
@Override
public Iterator<Vector> iterator() {
final int npoints = navigation.n() == null ? 0 : navigation.n().d();
final int npoints = navigation.m() == null ? 0 : navigation.m().d();
return new Iterator<Vector>() {
PathPoint curr = npoints > 0 ? navigation.n().a(0) : null;
PathPoint curr = npoints > 0 ? navigation.m().a(0) : null;
int i = 0;
@Override
@ -1178,7 +1178,7 @@ public class NMSImpl implements NMSBridge {
@Override
public Vector next() {
PathPoint old = curr;
curr = i + 1 < npoints ? navigation.n().a(++i) : null;
curr = i + 1 < npoints ? navigation.m().a(++i) : null;
return new Vector(old.a, old.b, old.c);
}
@ -1204,7 +1204,7 @@ public class NMSImpl implements NMSBridge {
}
public static void flyingMoveLogic(EntityLiving entity, float f, float f1, float f2) {
if ((entity.cO()) || (entity.bT())) {
if ((entity.cP()) || (entity.bT())) {
double d0 = 0.08D;
if ((entity.motY <= 0.0D) && (entity.hasEffect(MobEffects.SLOW_FALLING))) {
d0 = 0.01D;
@ -1225,7 +1225,7 @@ public class NMSImpl implements NMSBridge {
}
if (f3 > 0.0F) {
f5 += (0.54600006F - f5) * f3 / 3.0F;
f4 += (entity.cJ() - f4) * f3 / 3.0F;
f4 += (entity.cK() - f4) * f3 / 3.0F;
}
if (entity.hasEffect(MobEffects.DOLPHINS_GRACE)) {
f5 = 0.96F;
@ -1262,7 +1262,7 @@ public class NMSImpl implements NMSBridge {
&& (entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d2, entity.motZ))) {
entity.motY = 0.30000001192092896D;
}
} else if (entity.db()) {
} else if (entity.dc()) {
if (entity.motY > -0.5D) {
entity.fallDistance = 1.0F;
}
@ -1323,7 +1323,7 @@ public class NMSImpl implements NMSBridge {
}
f4 = 0.16277137F / (f9 * f9 * f9);
if (entity.onGround) {
f3 = entity.cJ() * f4;
f3 = entity.cK() * f4;
} else {
f3 = entity.aU;
}
@ -1476,7 +1476,7 @@ public class NMSImpl implements NMSBridge {
}
public static boolean isNavigationFinished(NavigationAbstract navigation) {
return navigation.q();
return navigation.p();
}
@SuppressWarnings("deprecation")
@ -1549,7 +1549,7 @@ public class NMSImpl implements NMSBridge {
}
public static void stopNavigation(NavigationAbstract navigation) {
navigation.r();
navigation.q();
}
public static void updateAI(EntityLiving entity) {

View File

@ -45,7 +45,7 @@ public class PlayerControllerLook {
// this.a.aP = a(this.a.aS, this.a.aQ, 10.0F);
}
float f3 = MathHelper.g(this.a.aS - this.a.aQ);
if (!this.a.getNavigation().q()) {
if (!this.a.getNavigation().p()) {
if (f3 < -75.0F) {
this.a.aS = (this.a.aQ - 75.0F);
}

View File

@ -156,7 +156,7 @@ public class PlayerNavigation extends NavigationAbstract {
protected void a(Vec3D paramVec3D) {
if (this.e - this.f > 100) {
if (paramVec3D.distanceSquared(this.g) < 2.25D) {
r();
q();
}
this.f = this.e;
this.g = paramVec3D;
@ -168,13 +168,13 @@ public class PlayerNavigation extends NavigationAbstract {
} else {
this.h = localVec3D;
double d1 = paramVec3D.f(this.h);
this.k = (this.a.cJ() > 0.0F ? d1 / this.a.cJ() * 1000.0D : 0.0D);
this.k = (this.a.cK() > 0.0F ? d1 / this.a.cK() * 1000.0D : 0.0D);
}
if ((this.k > 0.0D) && (this.i > this.k * 3.0D)) {
this.h = Vec3D.a;
this.i = 0L;
this.k = 0.0D;
r();
q();
}
this.j = SystemUtils.b();
}
@ -242,7 +242,7 @@ public class PlayerNavigation extends NavigationAbstract {
@Override
protected boolean b() {
return (this.a.onGround) || (s()) || (this.a.isPassenger());
return (this.a.onGround) || (r()) || (this.a.isPassenger());
}
@Override
@ -267,9 +267,9 @@ public class PlayerNavigation extends NavigationAbstract {
&& (this.b.getType(localBlockPosition).getMaterial().isBuildable())) {
localBlockPosition = localBlockPosition.up();
}
return superb(localBlockPosition);
return super.b(localBlockPosition);
}
return superb(paramBlockPosition);
return super.b(paramBlockPosition);
}
public void b(boolean paramBoolean) {
@ -297,20 +297,20 @@ public class PlayerNavigation extends NavigationAbstract {
}
public void c(boolean paramBoolean) {
this.o.c(paramBoolean);
this.pp = paramBoolean;
}
@Override
public void d() {
this.e += 1;
if (this.m) {
m();
l();
}
if (q()) {
if (p()) {
return;
}
if (b()) {
p();
o();
} else if ((this.c != null) && (this.c.e() < this.c.d())) {
Vec3D localVec3D = c();
Vec3D localObject = this.c.a(this.a, this.c.e());
@ -320,8 +320,8 @@ public class PlayerNavigation extends NavigationAbstract {
this.c.c(this.c.e() + 1);
}
}
o();
if (q()) {
n();
if (p()) {
return;
}
Vec3D localVec3D = this.c.a(this.a);
@ -333,30 +333,14 @@ public class PlayerNavigation extends NavigationAbstract {
localVec3D.z, this.d);
}
@Override
public void d(boolean paramBoolean) {
this.pp = paramBoolean;
this.o.c(paramBoolean);
}
@Override
protected void E_() {
if (this.c == null) {
return;
}
for (int i1 = 0; i1 < this.c.d(); i1++) {
PathPoint localPathPoint = this.c.a(i1);
Object localObject = i1 + 1 < this.c.d() ? this.c.a(i1 + 1) : null;
IBlockData localIBlockData = this.b
.getType(new BlockPosition(localPathPoint.a, localPathPoint.b, localPathPoint.c));
Block localBlock = localIBlockData.getBlock();
if (localBlock == Blocks.CAULDRON) {
this.c.a(i1, localPathPoint.a(localPathPoint.a, localPathPoint.b + 1, localPathPoint.c));
if ((localObject != null) && (localPathPoint.b >= ((PathPoint) localObject).b)) {
this.c.a(i1 + 1, ((PathPoint) localObject).a(((PathPoint) localObject).a, localPathPoint.b + 1,
((PathPoint) localObject).c));
}
}
}
superE_();
if (this.pp) {
if (this.b.e(new BlockPosition(MathHelper.floor(this.a.locX), (int) (this.a.getBoundingBox().b + 0.5D),
MathHelper.floor(this.a.locZ)))) {
@ -376,27 +360,23 @@ public class PlayerNavigation extends NavigationAbstract {
return this.o.c();
}
public boolean h() {
return this.o.e();
}
@Override
public BlockPosition j() {
public BlockPosition i() {
return this.q;
}
@Override
public float k() {
public float j() {
return (float) this.p.getValue();
}
@Override
public boolean l() {
public boolean k() {
return this.m;
}
@Override
public void m() {
public void l() {
if (this.b.getTime() - this.n > 20L) {
if (this.q != null) {
this.c = null;
@ -410,16 +390,16 @@ public class PlayerNavigation extends NavigationAbstract {
}
@Override
public PathEntity n() {
public PathEntity m() {
return this.c;
}
@Override
protected void o() {
protected void n() {
}
@Override
protected void p() {
protected void o() {
Vec3D localVec3D1 = c();
int i1 = this.c.d();
@ -449,20 +429,25 @@ public class PlayerNavigation extends NavigationAbstract {
}
@Override
public boolean q() {
public boolean p() {
return (this.c == null) || (this.c.b());
}
@Override
public void r() {
public void q() {
this.c = null;
}
@Override
protected boolean s() {
protected boolean r() {
return (this.a.aq()) || (this.a.ax());
}
@Override
public PathfinderAbstract s() {
return this.o;
}
public void setRange(float pathfindingRange) {
this.p.setValue(pathfindingRange);
}
@ -476,7 +461,7 @@ public class PlayerNavigation extends NavigationAbstract {
}
this.q = paramBlockPosition;
float f1 = k();
float f1 = j();
this.b.methodProfiler.a("pathfind");
BlockPosition localBlockPosition = new BlockPosition(this.a);
int i1 = (int) (f1 + 8.0F);
@ -488,13 +473,34 @@ public class PlayerNavigation extends NavigationAbstract {
return localPathEntity;
}
protected void superE_() {
if (this.c == null) {
return;
}
for (int i1 = 0; i1 < this.c.d(); i1++) {
PathPoint localPathPoint = this.c.a(i1);
Object localObject = i1 + 1 < this.c.d() ? this.c.a(i1 + 1) : null;
IBlockData localIBlockData = this.b
.getType(new BlockPosition(localPathPoint.a, localPathPoint.b, localPathPoint.c));
Block localBlock = localIBlockData.getBlock();
if (localBlock == Blocks.CAULDRON) {
this.c.a(i1, localPathPoint.a(localPathPoint.a, localPathPoint.b + 1, localPathPoint.c));
if ((localObject != null) && (localPathPoint.b >= ((PathPoint) localObject).b)) {
this.c.a(i1 + 1, ((PathPoint) localObject).a(((PathPoint) localObject).a, localPathPoint.b + 1,
((PathPoint) localObject).c));
}
}
}
}
@Override
public PathfinderAbstract t() {
return this.o;
public boolean t() {
return this.o.e();
}
private int u() {
if ((!this.a.isInWater()) || (!h())) {
if ((!this.a.isInWater()) || (!t())) {
return (int) (this.a.getBoundingBox().b + 0.5D);
}
int i = (int) this.a.getBoundingBox().b;