Preliminary prerelease update

This commit is contained in:
fullwall 2019-06-24 14:24:11 +08:00
parent d0b358a27c
commit 8da0b6d228
10 changed files with 30 additions and 30 deletions

View File

@ -13,7 +13,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.14.2-R0.1-SNAPSHOT</craftbukkit.version> <craftbukkit.version>1.14.3-pre4-SNAPSHOT</craftbukkit.version>
<citizensapi.version>${project.version}</citizensapi.version> <citizensapi.version>${project.version}</citizensapi.version>
<powermock.version>1.4.12</powermock.version> <powermock.version>1.4.12</powermock.version>
<bstats.version>1.5</bstats.version> <bstats.version>1.5</bstats.version>

View File

@ -12,7 +12,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.14.2-R0.1-SNAPSHOT</craftbukkit.version> <craftbukkit.version>1.14.3-pre4-SNAPSHOT</craftbukkit.version>
</properties> </properties>
<repositories> <repositories>

View File

@ -99,9 +99,9 @@ public class OcelotController extends MobEntityController {
} }
@Override @Override
protected void dV() { protected void dW() {
if (npc == null) { if (npc == null) {
super.dV(); super.dW();
} }
} }

View File

@ -101,9 +101,9 @@ public class PigController extends MobEntityController {
} }
@Override @Override
public boolean dD() { public boolean dE() {
// block carrot-on-a-stick behaviour // block carrot-on-a-stick behaviour
return npc == null ? super.dD() : false; return npc == null ? super.dE() : false;
} }
@Override @Override

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_14_R1.BlockPosition;
import net.minecraft.server.v1_14_R1.DamageSource; import net.minecraft.server.v1_14_R1.DamageSource;
import net.minecraft.server.v1_14_R1.EntitySnowman; import net.minecraft.server.v1_14_R1.EntitySnowman;
import net.minecraft.server.v1_14_R1.EntityTypes; import net.minecraft.server.v1_14_R1.EntityTypes;
import net.minecraft.server.v1_14_R1.GameRules;
import net.minecraft.server.v1_14_R1.IBlockData; import net.minecraft.server.v1_14_R1.IBlockData;
import net.minecraft.server.v1_14_R1.NBTTagCompound; import net.minecraft.server.v1_14_R1.NBTTagCompound;
import net.minecraft.server.v1_14_R1.SoundEffect; import net.minecraft.server.v1_14_R1.SoundEffect;
@ -188,14 +189,13 @@ public class SnowmanController extends MobEntityController {
@Override @Override
public void movementTick() { public void movementTick() {
boolean allowsGriefing = this.world.getGameRules().getBoolean("mobGriefing"); boolean allowsGriefing = this.world.getGameRules().get(GameRules.MOB_GRIEFING).a();
if (npc != null) { if (npc != null) {
this.world.getGameRules().set("mobGriefing", "false", this.world.getMinecraftServer()); this.world.getGameRules().get(GameRules.MOB_GRIEFING).setValue("false");
} }
super.movementTick(); super.movementTick();
if (npc != null) { if (npc != null) {
this.world.getGameRules().set("mobGriefing", Boolean.toString(allowsGriefing), this.world.getGameRules().get(GameRules.MOB_GRIEFING).setValue(Boolean.toString(allowsGriefing));
this.world.getMinecraftServer());
} }
} }

View File

@ -121,12 +121,12 @@ public class VillagerController extends MobEntityController {
} }
@Override @Override
public boolean dY() { public boolean dZ() {
if (blockingATrade) { if (blockingATrade) {
blockingATrade = false; blockingATrade = false;
return true; return true;
} }
return super.dY(); return super.dZ();
} }
@Override @Override

View File

@ -121,12 +121,12 @@ public class WanderingTraderController extends MobEntityController {
} }
@Override @Override
public boolean dY() { public boolean dZ() {
if (blockingATrade) { if (blockingATrade) {
blockingATrade = false; blockingATrade = false;
return true; return true;
} }
return super.dY(); return super.dZ();
} }
@Override @Override

View File

@ -1101,7 +1101,7 @@ public class NMSImpl implements NMSBridge {
Entity handle = NMSImpl.getHandle(entity); Entity handle = NMSImpl.getHandle(entity);
if (handle == null) if (handle == null)
return; return;
if (RANDOM.nextFloat() < 0.8F && (handle.at() || handle.ax())) { if (RANDOM.nextFloat() < 0.8F && (handle.isInWaterOrRain() || handle.ay())) {
handle.setMot(handle.getMot().getX(), handle.getMot().getY() + power, handle.getMot().getZ()); handle.setMot(handle.getMot().getX(), handle.getMot().getY() + power, handle.getMot().getZ());
} }
} }
@ -1254,7 +1254,7 @@ public class NMSImpl implements NMSBridge {
public static void flyingMoveLogic(EntityLiving entity, Vec3D vec3d) { public static void flyingMoveLogic(EntityLiving entity, Vec3D vec3d) {
double d0; double d0;
float f; float f;
if (entity.de() || entity.bZ()) { if (entity.df() || entity.ca()) {
d0 = 0.08D; d0 = 0.08D;
boolean flag = entity.getMot().y <= 0.0D; boolean flag = entity.getMot().y <= 0.0D;
if (flag && entity.hasEffect(MobEffects.SLOW_FALLING)) { if (flag && entity.hasEffect(MobEffects.SLOW_FALLING)) {
@ -1269,7 +1269,7 @@ public class NMSImpl implements NMSBridge {
Vec3D vec3d2; Vec3D vec3d2;
if (!entity.isInWater() || entity instanceof EntityHuman && ((EntityHuman) entity).abilities.isFlying) { if (!entity.isInWater() || entity instanceof EntityHuman && ((EntityHuman) entity).abilities.isFlying) {
Vec3D vec3d4; Vec3D vec3d4;
if (entity.aC() && (!(entity instanceof EntityHuman) || !((EntityHuman) entity).abilities.isFlying)) { if (entity.aD() && (!(entity instanceof EntityHuman) || !((EntityHuman) entity).abilities.isFlying)) {
d1 = entity.locY; d1 = entity.locY;
entity.a(0.02F, vec3d); entity.a(0.02F, vec3d);
entity.move(EnumMoveType.SELF, entity.getMot()); entity.move(EnumMoveType.SELF, entity.getMot());
@ -1385,7 +1385,7 @@ public class NMSImpl implements NMSBridge {
if (f2 > 0.0F) { if (f2 > 0.0F) {
f1 += (0.54600006F - f1) * f2 / 3.0F; f1 += (0.54600006F - f1) * f2 / 3.0F;
f += (entity.da() - f) * f2 / 3.0F; f += (entity.db() - f) * f2 / 3.0F;
} }
if (entity.hasEffect(MobEffects.DOLPHINS_GRACE)) { if (entity.hasEffect(MobEffects.DOLPHINS_GRACE)) {
@ -1593,6 +1593,14 @@ public class NMSImpl implements NMSBridge {
} }
} }
public static void setBukkitEntity(Entity entity, CraftEntity bukkitEntity) {
try {
BUKKITENTITY_FIELD_SETTER.invoke(entity, bukkitEntity);
} catch (Throwable e) {
e.printStackTrace();
}
}
public static void setNotInSchool(EntityFish entity) { public static void setNotInSchool(EntityFish entity) {
try { try {
if (ENTITY_FISH_NUM_IN_SCHOOL != null) { if (ENTITY_FISH_NUM_IN_SCHOOL != null) {
@ -1654,14 +1662,6 @@ public class NMSImpl implements NMSBridge {
navigation.c(); navigation.c();
} }
public static void setBukkitEntity(Entity entity, CraftEntity bukkitEntity) {
try {
BUKKITENTITY_FIELD_SETTER.invoke(entity, bukkitEntity);
} catch (Throwable e) {
e.printStackTrace();
}
}
private static final MethodHandle ADVANCEMENT_PLAYER_FIELD = NMS.getFinalSetter(EntityPlayer.class, private static final MethodHandle ADVANCEMENT_PLAYER_FIELD = NMS.getFinalSetter(EntityPlayer.class,
"advancementDataPlayer"); "advancementDataPlayer");
private static final Set<EntityType> BAD_CONTROLLER_LOOK = EnumSet.of(EntityType.POLAR_BEAR, EntityType.SILVERFISH, private static final Set<EntityType> BAD_CONTROLLER_LOOK = EnumSet.of(EntityType.POLAR_BEAR, EntityType.SILVERFISH,
@ -1670,6 +1670,7 @@ public class NMSImpl implements NMSBridge {
private static final MethodHandle BEHAVIOR_MAP = NMS.getGetter(BehaviorController.class, "c"); private static final MethodHandle BEHAVIOR_MAP = NMS.getGetter(BehaviorController.class, "c");
private static final MethodHandle BLOCK_POSITION_B_D = NMS.getMethodHandle(BlockPosition.PooledBlockPosition.class, private static final MethodHandle BLOCK_POSITION_B_D = NMS.getMethodHandle(BlockPosition.PooledBlockPosition.class,
"c", false, double.class, double.class, double.class); "c", false, double.class, double.class, double.class);
private static final MethodHandle BUKKITENTITY_FIELD_SETTER = NMS.getSetter(Entity.class, "bukkitEntity");
private static final Map<Class<?>, EntityTypes<?>> CITIZENS_ENTITY_TYPES = Maps.newHashMap(); private static final Map<Class<?>, EntityTypes<?>> CITIZENS_ENTITY_TYPES = Maps.newHashMap();
private static final MethodHandle CRAFT_BOSSBAR_HANDLE_FIELD = NMS.getSetter(CraftBossBar.class, "handle"); private static final MethodHandle CRAFT_BOSSBAR_HANDLE_FIELD = NMS.getSetter(CraftBossBar.class, "handle");
private static final float DEFAULT_SPEED = 1F; private static final float DEFAULT_SPEED = 1F;
@ -1696,7 +1697,6 @@ public class NMSImpl implements NMSBridge {
private static final Random RANDOM = Util.getFastRandom(); private static final Random RANDOM = Util.getFastRandom();
private static final MethodHandle SIZE_FIELD_GETTER = NMS.getGetter(Entity.class, "size"); private static final MethodHandle SIZE_FIELD_GETTER = NMS.getGetter(Entity.class, "size");
private static final MethodHandle SIZE_FIELD_SETTER = NMS.getSetter(Entity.class, "size"); private static final MethodHandle SIZE_FIELD_SETTER = NMS.getSetter(Entity.class, "size");
private static final MethodHandle BUKKITENTITY_FIELD_SETTER = NMS.getSetter(Entity.class, "bukkitEntity");
private static Field SKULL_PROFILE_FIELD; private static Field SKULL_PROFILE_FIELD;
static { static {
try { try {

View File

@ -208,7 +208,7 @@ public class PlayerNavigation extends NavigationAbstract {
} else { } else {
this.h = var1; this.h = var1;
double var2 = var0.f(this.h); double var2 = var0.f(this.h);
this.k = this.a.da() > 0.0F ? var2 / this.a.da() * 1000.0D : 0.0D; this.k = this.a.db() > 0.0F ? var2 / this.a.db() * 1000.0D : 0.0D;
} }
if (this.k > 0.0D && this.i > this.k * 3.0D) { if (this.k > 0.0D && this.i > this.k * 3.0D) {
@ -499,7 +499,7 @@ public class PlayerNavigation extends NavigationAbstract {
@Override @Override
protected boolean p() { protected boolean p() {
return this.a.au() || this.a.aC(); return this.a.au() || this.a.aD();
} }
@Override @Override

View File

@ -325,7 +325,7 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
} }
var18 = this.a(var0, var1, var2); var18 = this.a(var0, var1, var2);
if (var16++ >= this.b.bu()) { if (var16++ >= this.b.bv()) {
var18.l = PathType.BLOCKED; var18.l = PathType.BLOCKED;
var18.k = -1.0F; var18.k = -1.0F;
return var18; return var18;