mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Preliminary prerelease update
This commit is contained in:
parent
d0b358a27c
commit
8da0b6d228
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -99,9 +99,9 @@ public class OcelotController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dV() {
|
||||
protected void dW() {
|
||||
if (npc == null) {
|
||||
super.dV();
|
||||
super.dW();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ public class PigController extends MobEntityController {
|
||||
}
|
||||
|
||||
@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
|
||||
|
@ -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.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;
|
||||
@ -188,14 +189,13 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,12 +121,12 @@ public class VillagerController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dY() {
|
||||
public boolean dZ() {
|
||||
if (blockingATrade) {
|
||||
blockingATrade = false;
|
||||
return true;
|
||||
}
|
||||
return super.dY();
|
||||
return super.dZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,12 +121,12 @@ public class WanderingTraderController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dY() {
|
||||
public boolean dZ() {
|
||||
if (blockingATrade) {
|
||||
blockingATrade = false;
|
||||
return true;
|
||||
}
|
||||
return super.dY();
|
||||
return super.dZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1101,7 +1101,7 @@ public class NMSImpl implements NMSBridge {
|
||||
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());
|
||||
}
|
||||
}
|
||||
@ -1254,7 +1254,7 @@ public class NMSImpl implements NMSBridge {
|
||||
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)) {
|
||||
@ -1269,7 +1269,7 @@ public class NMSImpl implements NMSBridge {
|
||||
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());
|
||||
@ -1385,7 +1385,7 @@ public class NMSImpl implements NMSBridge {
|
||||
|
||||
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)) {
|
||||
@ -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) {
|
||||
try {
|
||||
if (ENTITY_FISH_NUM_IN_SCHOOL != null) {
|
||||
@ -1654,14 +1662,6 @@ public class NMSImpl implements NMSBridge {
|
||||
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,
|
||||
@ -1670,6 +1670,7 @@ public class NMSImpl implements NMSBridge {
|
||||
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;
|
||||
@ -1696,7 +1697,6 @@ public class NMSImpl implements NMSBridge {
|
||||
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 {
|
||||
|
@ -208,7 +208,7 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
} 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) {
|
||||
@ -499,7 +499,7 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
|
||||
@Override
|
||||
protected boolean p() {
|
||||
return this.a.au() || this.a.aC();
|
||||
return this.a.au() || this.a.aD();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -325,7 +325,7 @@ public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
|
||||
}
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user