Skip to content

Commit

Permalink
Preliminary prerelease update
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 24, 2019
1 parent d0b358a commit 8da0b6d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion main/pom.xml
Expand Up @@ -13,7 +13,7 @@

<properties>
<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>
<powermock.version>1.4.12</powermock.version>
<bstats.version>1.5</bstats.version>
Expand Down
2 changes: 1 addition & 1 deletion v1_14_R1/pom.xml
Expand Up @@ -12,7 +12,7 @@

<properties>
<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>

<repositories>
Expand Down
Expand Up @@ -99,9 +99,9 @@ public boolean d(NBTTagCompound save) {
}

@Override
protected void dV() {
protected void dW() {
if (npc == null) {
super.dV();
super.dW();
}
}

Expand Down
Expand Up @@ -101,9 +101,9 @@ public boolean d(NBTTagCompound save) {
}

@Override
public boolean dD() {
public boolean dE() {
// block carrot-on-a-stick behaviour
return npc == null ? super.dD() : false;
return npc == null ? super.dE() : false;
}

@Override
Expand Down
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.server.v1_14_R1.DamageSource;
import net.minecraft.server.v1_14_R1.EntitySnowman;
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.NBTTagCompound;
import net.minecraft.server.v1_14_R1.SoundEffect;
Expand Down Expand Up @@ -188,14 +189,13 @@ public void mobTick() {

@Override
public void movementTick() {
boolean allowsGriefing = this.world.getGameRules().getBoolean("mobGriefing");
boolean allowsGriefing = this.world.getGameRules().get(GameRules.MOB_GRIEFING).a();
if (npc != null) {
this.world.getGameRules().set("mobGriefing", "false", this.world.getMinecraftServer());
this.world.getGameRules().get(GameRules.MOB_GRIEFING).setValue("false");
}
super.movementTick();
if (npc != null) {
this.world.getGameRules().set("mobGriefing", Boolean.toString(allowsGriefing),
this.world.getMinecraftServer());
this.world.getGameRules().get(GameRules.MOB_GRIEFING).setValue(Boolean.toString(allowsGriefing));
}
}

Expand Down
Expand Up @@ -121,12 +121,12 @@ public boolean d(NBTTagCompound save) {
}

@Override
public boolean dY() {
public boolean dZ() {
if (blockingATrade) {
blockingATrade = false;
return true;
}
return super.dY();
return super.dZ();
}

@Override
Expand Down
Expand Up @@ -121,12 +121,12 @@ public boolean d(NBTTagCompound save) {
}

@Override
public boolean dY() {
public boolean dZ() {
if (blockingATrade) {
blockingATrade = false;
return true;
}
return super.dY();
return super.dZ();
}

@Override
Expand Down
Expand Up @@ -1101,7 +1101,7 @@ public void trySwim(org.bukkit.entity.Entity entity, float power) {
Entity handle = NMSImpl.getHandle(entity);
if (handle == null)
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());
}
}
Expand Down Expand Up @@ -1254,7 +1254,7 @@ public static void clearGoals(PathfinderGoalSelector... goalSelectors) {
public static void flyingMoveLogic(EntityLiving entity, Vec3D vec3d) {
double d0;
float f;
if (entity.de() || entity.bZ()) {
if (entity.df() || entity.ca()) {
d0 = 0.08D;
boolean flag = entity.getMot().y <= 0.0D;
if (flag && entity.hasEffect(MobEffects.SLOW_FALLING)) {
Expand All @@ -1269,7 +1269,7 @@ public static void flyingMoveLogic(EntityLiving entity, Vec3D vec3d) {
Vec3D vec3d2;
if (!entity.isInWater() || entity instanceof EntityHuman && ((EntityHuman) entity).abilities.isFlying) {
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;
entity.a(0.02F, vec3d);
entity.move(EnumMoveType.SELF, entity.getMot());
Expand Down Expand Up @@ -1385,7 +1385,7 @@ public static void flyingMoveLogic(EntityLiving entity, Vec3D vec3d) {

if (f2 > 0.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)) {
Expand Down Expand Up @@ -1593,6 +1593,14 @@ public static void setAdvancement(Player entity, AdvancementDataPlayer instance)
}
}

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) {
try {
if (ENTITY_FISH_NUM_IN_SCHOOL != null) {
Expand Down Expand Up @@ -1654,14 +1662,6 @@ public static void updateNavigation(NavigationAbstract navigation) {
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,
"advancementDataPlayer");
private static final Set<EntityType> BAD_CONTROLLER_LOOK = EnumSet.of(EntityType.POLAR_BEAR, EntityType.SILVERFISH,
Expand All @@ -1670,6 +1670,7 @@ public static void setBukkitEntity(Entity entity, CraftEntity bukkitEntity) {
private static final MethodHandle BEHAVIOR_MAP = NMS.getGetter(BehaviorController.class, "c");
private static final MethodHandle BLOCK_POSITION_B_D = NMS.getMethodHandle(BlockPosition.PooledBlockPosition.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 MethodHandle CRAFT_BOSSBAR_HANDLE_FIELD = NMS.getSetter(CraftBossBar.class, "handle");
private static final float DEFAULT_SPEED = 1F;
Expand All @@ -1696,7 +1697,6 @@ public static void setBukkitEntity(Entity entity, CraftEntity bukkitEntity) {
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_SETTER = NMS.getSetter(Entity.class, "size");
private static final MethodHandle BUKKITENTITY_FIELD_SETTER = NMS.getSetter(Entity.class, "bukkitEntity");
private static Field SKULL_PROFILE_FIELD;
static {
try {
Expand Down
Expand Up @@ -208,7 +208,7 @@ protected void a(Vec3D var0) {
} else {
this.h = var1;
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) {
Expand Down Expand Up @@ -499,7 +499,7 @@ public void o() {

@Override
protected boolean p() {
return this.a.au() || this.a.aC();
return this.a.au() || this.a.aD();
}

@Override
Expand Down
Expand Up @@ -325,7 +325,7 @@ private PathPoint a(int var0, int var1, int var2, int var3, double var4, EnumDir
}

var18 = this.a(var0, var1, var2);
if (var16++ >= this.b.bu()) {
if (var16++ >= this.b.bv()) {
var18.l = PathType.BLOCKED;
var18.k = -1.0F;
return var18;
Expand Down

0 comments on commit 8da0b6d

Please sign in to comment.