Archiviert
13
0

Update to Minecraft 1.12

Dieser Commit ist enthalten in:
md_5 2017-06-08 18:00:00 +10:00
Ursprung fe3ca95c76
Commit bb4ae3b3b8
32 geänderte Dateien mit 65 neuen und 98 gelöschten Zeilen

Datei anzeigen

@ -1,27 +0,0 @@
org/bukkit/Bukkit getOnlinePlayers ()[Lorg/bukkit/entity/Player; _INVALID_getOnlinePlayers
org/bukkit/Server getOnlinePlayers ()[Lorg/bukkit/entity/Player; _INVALID_getOnlinePlayers
org/bukkit/entity/Damageable damage (I)V _INVALID_damage
org/bukkit/entity/Damageable damage (ILorg/bukkit/entity/Entity;)V _INVALID_damage
org/bukkit/entity/Damageable getHealth ()I _INVALID_getHealth
org/bukkit/entity/Damageable getMaxHealth ()I _INVALID_getMaxHealth
org/bukkit/entity/Damageable setHealth (I)V _INVALID_setHealth
org/bukkit/entity/Damageable setMaxHealth (I)V _INVALID_setMaxHealth
org/bukkit/entity/LivingEntity getLastDamage ()I _INVALID_getLastDamage
org/bukkit/entity/LivingEntity setLastDamage (I)V _INVALID_setLastDamage
org/bukkit/entity/Minecart getDamage ()I _INVALID_getDamage
org/bukkit/entity/Minecart setDamage (I)V _INVALID_setDamage
org/bukkit/entity/Projectile getShooter ()Lorg/bukkit/entity/LivingEntity; _INVALID_getShooter
org/bukkit/entity/Projectile setShooter (Lorg/bukkit/entity/LivingEntity;)V _INVALID_setShooter
org/bukkit/event/entity/EntityDamageEvent getDamage ()I _INVALID_getDamage
org/bukkit/event/entity/EntityDamageEvent setDamage (I)V _INVALID_setDamage
org/bukkit/event/entity/EntityRegainHealthEvent getAmount ()I _INVALID_getAmount
org/bukkit/event/entity/EntityRegainHealthEvent setAmount (I)V _INVALID_setAmount
org/bukkit/event/vehicle/VehicleDamageEvent getDamage ()I _INVALID_getDamage
org/bukkit/event/vehicle/VehicleDamageEvent setDamage (I)V _INVALID_setDamage

Datei anzeigen

@ -12,7 +12,7 @@
@@ -37,6 +39,10 @@ @@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bd() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) { if (!entity.isPassenger() && !entity.isVehicle() && entity.bf() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

Datei anzeigen

@ -19,7 +19,7 @@
+ Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); + Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
if (entity != null) { if (entity != null) {
entity.portalCooldown = entity.aK(); entity.portalCooldown = entity.aM();
@@ -70,14 +74,16 @@ @@ -70,14 +74,16 @@
BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X); BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X);
@ -44,7 +44,7 @@
@@ -108,6 +114,10 @@ @@ -108,6 +114,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bd()) { if (!entity.isPassenger() && !entity.isVehicle() && entity.bf()) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

Datei anzeigen

@ -191,6 +191,6 @@
+ public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { + public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ if (world.addEntity(entity, reason) && entity.isVehicle()) { + if (world.addEntity(entity, reason) && entity.isVehicle()) {
+ // CraftBukkit end + // CraftBukkit end
Iterator iterator = entity.bD().iterator(); Iterator iterator = entity.bF().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {

Datei anzeigen

@ -98,7 +98,7 @@
+ +
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.12-pre6"); DedicatedServer.LOGGER.info("Starting minecraft server version 1.12");
@@ -79,7 +126,7 @@ @@ -79,7 +126,7 @@
} }

Datei anzeigen

@ -111,7 +111,7 @@
+ +
+ if (this.al++ >= i) { + if (this.al++ >= i) {
+ this.al = i; + this.al = i;
+ this.portalCooldown = this.aK(); + this.portalCooldown = this.aM();
+ byte b0; + byte b0;
+ +
+ if (this.world.worldProvider.getDimensionManager().getDimensionID() == -1) { + if (this.world.worldProvider.getDimensionManager().getDimensionID() == -1) {
@ -144,7 +144,7 @@
+ +
public void Y() { public void Y() {
this.world.methodProfiler.a("entityBaseTick"); this.world.methodProfiler.a("entityBaseTick");
if (this.isPassenger() && this.bH().dead) { if (this.isPassenger() && this.bJ().dead) {
@@ -246,6 +361,8 @@ @@ -246,6 +361,8 @@
this.lastZ = this.locZ; this.lastZ = this.locZ;
this.lastPitch = this.pitch; this.lastPitch = this.pitch;
@ -439,7 +439,7 @@
entityitem.q(); entityitem.q();
@@ -1589,6 +1863,24 @@ @@ -1589,6 +1863,24 @@
if (entity.bH() != this) { if (entity.bJ() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
@ -460,11 +460,11 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bC() instanceof EntityHuman)) { if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bE() instanceof EntityHuman)) {
this.passengers.add(0, entity); this.passengers.add(0, entity);
} else { } else {
@@ -1602,6 +1894,22 @@ @@ -1602,6 +1894,22 @@
if (entity.bH() == this) { if (entity.bJ() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
@ -705,7 +705,7 @@
public float getHeadHeight() { public float getHeadHeight() {
@@ -2295,7 +2728,7 @@ @@ -2295,7 +2728,7 @@
for (Iterator iterator = this.bD().iterator(); iterator.hasNext(); entity.a(oclass, set)) { for (Iterator iterator = this.bF().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
entity = (Entity) iterator.next(); entity = (Entity) iterator.next();
if (oclass.isAssignableFrom(entity.getClass())) { if (oclass.isAssignableFrom(entity.getClass())) {
- set.add(entity); - set.add(entity);

Datei anzeigen

@ -21,7 +21,7 @@
@@ -76,6 +81,7 @@ @@ -76,6 +81,7 @@
this.s(f); this.q(f);
if (f > 10.0F) { if (f > 10.0F) {
+ this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
this.unleash(true, true); this.unleash(true, true);

Datei anzeigen

@ -56,7 +56,7 @@
- this.aU = true; - this.aU = true;
- this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag); - this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag);
- this.die(); - this.die();
- this.dq(); - this.ds();
+ // CraftBukkit start + // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false);
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
@ -64,7 +64,7 @@
+ this.aU = true; + this.aU = true;
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag); + this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag);
+ this.die(); + this.die();
+ this.dq(); + this.ds();
+ } else { + } else {
+ fuseTicks = 0; + fuseTicks = 0;
+ } + }

Datei anzeigen

@ -52,14 +52,14 @@
this.locX += this.motX; this.locX += this.motX;
@@ -150,6 +167,11 @@ @@ -150,6 +167,11 @@
} else { } else {
this.av(); this.ax();
if (damagesource.getEntity() != null) { if (damagesource.getEntity() != null) {
+ // CraftBukkit start + // CraftBukkit start
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) { + if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
Vec3D vec3d = damagesource.getEntity().aH(); Vec3D vec3d = damagesource.getEntity().aJ();
if (vec3d != null) { if (vec3d != null) {
@@ -163,6 +185,7 @@ @@ -163,6 +185,7 @@

Datei anzeigen

@ -143,7 +143,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
this.die(); this.die();
this.av(); this.ax();
this.a(damagesource.getEntity()); this.a(damagesource.getEntity());
@@ -151,6 +199,18 @@ @@ -151,6 +199,18 @@

Datei anzeigen

@ -20,8 +20,8 @@
public void loadChest() { public void loadChest() {
InventoryHorseChest inventoryhorsechest = this.inventoryChest; InventoryHorseChest inventoryhorsechest = this.inventoryChest;
- this.inventoryChest = new InventoryHorseChest("HorseChest", this.dl()); - this.inventoryChest = new InventoryHorseChest("HorseChest", this.dn());
+ this.inventoryChest = new InventoryHorseChest("HorseChest", this.dl(), this); // CraftBukkit + this.inventoryChest = new InventoryHorseChest("HorseChest", this.dn(), this); // CraftBukkit
this.inventoryChest.a(this.getName()); this.inventoryChest.a(this.getName());
if (inventoryhorsechest != null) { if (inventoryhorsechest != null) {
inventoryhorsechest.b(this); inventoryhorsechest.b(this);
@ -33,7 +33,7 @@
+ return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 + return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
} }
protected float co() { protected float cq() {
@@ -414,7 +416,7 @@ @@ -414,7 +416,7 @@
} }
@ -68,7 +68,7 @@
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit + this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
} }
if (this.dH()) { if (this.dJ()) {
@@ -723,6 +726,7 @@ @@ -723,6 +726,7 @@
if (this.getOwnerUUID() != null) { if (this.getOwnerUUID() != null) {
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString()); nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
@ -106,5 +106,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.canSlide = true; this.canSlide = true;
this.dr(); this.dt();
} }

Datei anzeigen

@ -63,7 +63,7 @@
if (this.foodData.c() && this.ticksLived % 10 == 0) { if (this.foodData.c() && this.ticksLived % 10 == 0) {
@@ -334,7 +359,7 @@ @@ -334,7 +359,7 @@
this.m((float) attributeinstance.getValue()); this.k((float) attributeinstance.getValue());
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
- float f1 = (float) (Math.atan(-this.motY * 0.20000000298023224D) * 15.0D); - float f1 = (float) (Math.atan(-this.motY * 0.20000000298023224D) * 15.0D);
+ float f1 = (float) ( org.bukkit.craftbukkit.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0D); // CraftBukkit + float f1 = (float) ( org.bukkit.craftbukkit.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0D); // CraftBukkit
@ -153,8 +153,8 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
- ScoreboardTeamBase scoreboardteambase = this.aW(); - ScoreboardTeamBase scoreboardteambase = this.aY();
- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aW(); - ScoreboardTeamBase scoreboardteambase1 = entityhuman.aY();
+ // CraftBukkit start - Change to check OTHER player's scoreboard team according to API + // CraftBukkit start - Change to check OTHER player's scoreboard team according to API
+ // To summarize this method's logic, it's "Can parameter hurt this" + // To summarize this method's logic, it's "Can parameter hurt this"
+ org.bukkit.scoreboard.Team team; + org.bukkit.scoreboard.Team team;

Datei anzeigen

@ -74,7 +74,7 @@
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.av(); this.ax();
this.f = (int) ((float) this.f - f); this.f = (int) ((float) this.f - f);
if (this.f <= 0) { if (this.f <= 0) {
@@ -270,6 +289,26 @@ @@ -270,6 +289,26 @@

Datei anzeigen

@ -99,7 +99,7 @@
@@ -274,19 +323,19 @@ @@ -274,19 +323,19 @@
protected void bM() { protected void bO() {
++this.deathTicks; ++this.deathTicks;
- if (this.deathTicks == 20) { - if (this.deathTicks == 20) {
+ if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) + if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead)
@ -587,12 +587,12 @@
+ return this.isAlive() && !this.m_() && this.collides; // CraftBukkit + return this.isAlive() && !this.m_() && this.collides; // CraftBukkit
} }
protected void av() { protected void ax() {
@@ -2072,7 +2357,27 @@ @@ -2072,7 +2357,27 @@
protected void v() { protected void v() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) { if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16); this.b(this.activeItem, 16);
- this.a(this.cF(), this.activeItem.a(this.world, this)); - this.a(this.cH(), this.activeItem.a(this.world, this));
+ // CraftBukkit start - fire PlayerItemConsumeEvent + // CraftBukkit start - fire PlayerItemConsumeEvent
+ ItemStack itemstack; + ItemStack itemstack;
+ if (this instanceof EntityPlayer) { + if (this instanceof EntityPlayer) {
@ -612,9 +612,9 @@
+ itemstack = this.activeItem.a(this.world, this); + itemstack = this.activeItem.a(this.world, this);
+ } + }
+ +
+ this.a(this.cF(), itemstack); + this.a(this.cH(), itemstack);
+ // CraftBukkit end + // CraftBukkit end
this.cL(); this.cN();
} }
@@ -2151,10 +2456,18 @@ @@ -2151,10 +2456,18 @@

Datei anzeigen

@ -53,7 +53,7 @@
+ // CraftBukkit end + // CraftBukkit end
this.e(-this.u()); this.e(-this.u());
this.d(10); this.d(10);
this.av(); this.ax();
@@ -108,6 +141,15 @@ @@ -108,6 +141,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
@ -93,7 +93,7 @@
+ if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled + if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled
if (!this.isPassenger() && this.al++ >= i) { if (!this.isPassenger() && this.al++ >= i) {
this.al = i; this.al = i;
this.portalCooldown = this.aK(); this.portalCooldown = this.aM();
@@ -266,6 +316,18 @@ @@ -266,6 +316,18 @@
} }

Datei anzeigen

@ -175,7 +175,7 @@
this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag)); this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag));
- if (flag) { - if (flag) {
- ScoreboardTeamBase scoreboardteambase = this.aW(); - ScoreboardTeamBase scoreboardteambase = this.aY();
+ // CraftBukkit start - fire PlayerDeathEvent + // CraftBukkit start - fire PlayerDeathEvent
+ if (this.dead) { + if (this.dead) {
+ return; + return;
@ -205,7 +205,7 @@
+ +
+ if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override? + if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override?
+ if (deathMessage.equals(deathmessage)) { + if (deathMessage.equals(deathmessage)) {
+ ScoreboardTeamBase scoreboardteambase = this.aW(); + ScoreboardTeamBase scoreboardteambase = this.aY();
+ +
+ if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) { + if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) {
+ if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) { + if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) {
@ -224,7 +224,7 @@
this.releaseShoulderEntities(); this.releaseShoulderEntities();
- if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) { - if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) {
- this.cT(); - this.cV();
- this.inventory.o(); - this.inventory.o();
+ // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. + // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
+ if (!event.getKeepInventory()) { + if (!event.getKeepInventory()) {
@ -287,7 +287,7 @@
- private Collection<ScoreboardObjective> E(Entity entity) { - private Collection<ScoreboardObjective> E(Entity entity) {
+ private Collection<ScoreboardScore> E(Entity entity) { // CraftBukkit + private Collection<ScoreboardScore> E(Entity entity) { // CraftBukkit
String s = entity instanceof EntityHuman ? entity.getName() : entity.bl(); String s = entity instanceof EntityHuman ? entity.getName() : entity.bn();
ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName()); ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName());
@@ -420,7 +539,10 @@ @@ -420,7 +539,10 @@

Datei anzeigen

@ -14,8 +14,8 @@
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -192,13 +198,38 @@ @@ -192,13 +198,38 @@
if (this.dk() > 0) { if (this.dm() > 0) {
i = this.dk() - 1; i = this.dm() - 1;
if (i <= 0) { if (i <= 0) {
- this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing")); - this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing"));
- this.world.a(1023, new BlockPosition(this), 0); - this.world.a(1023, new BlockPosition(this), 0);

Datei anzeigen

@ -11,7 +11,7 @@
@@ -60,6 +61,11 @@ @@ -60,6 +61,11 @@
public void B_() { public void B_() {
if (!this.world.isClientSide && this.isConverting()) { if (!this.world.isClientSide && this.isConverting()) {
int i = this.ds(); int i = this.du();
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion + // CraftBukkit start - Use wall time instead of ticks for villager conversion
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick; + int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ this.lastTick = MinecraftServer.currentTick; + this.lastTick = MinecraftServer.currentTick;

Datei anzeigen

@ -64,7 +64,7 @@
this.a(f); this.a(f);
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }
} else if (flag && this.foodLevel >= 18 && entityhuman.dh()) { } else if (flag && this.foodLevel >= 18 && entityhuman.dj()) {
++this.foodTickTimer; ++this.foodTickTimer;
if (this.foodTickTimer >= 80) { if (this.foodTickTimer >= 80) {
- entityhuman.heal(1.0F); - entityhuman.heal(1.0F);

Datei anzeigen

@ -57,8 +57,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.b() > 333) { if (packethandshakinginsetprotocol.b() > 335) {
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12-pre6"}); chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12"});
this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatmessage); this.b.close(chatmessage);

Datei anzeigen

@ -53,8 +53,8 @@
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
+ // CraftBukkit end + // CraftBukkit end
} }
} else if ((this != MobEffects.HEAL || entityliving.ca()) && (this != MobEffects.HARM || !entityliving.ca())) { } else if ((this != MobEffects.HEAL || entityliving.cc()) && (this != MobEffects.HARM || !entityliving.cc())) {
if (this == MobEffects.HARM && !entityliving.ca() || this == MobEffects.HEAL && entityliving.ca()) { if (this == MobEffects.HARM && !entityliving.cc() || this == MobEffects.HEAL && entityliving.cc()) {
entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i)); entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i));
} }
} else { } else {

Datei anzeigen

@ -18,15 +18,7 @@
this.n = ichatbasecomponent; this.n = ichatbasecomponent;
} }
@@ -306,14 +306,14 @@ @@ -313,7 +313,7 @@
if (this.j() != null) {
this.i().a(this.j());
} else if (this.i() != null) {
- this.i().a(new ChatMessage("multiplayer.disconnect.banned", new Object[0]));
+ this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0]));
}
}
} }
} }

Datei anzeigen

@ -18,7 +18,7 @@
} }
@@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@
entityhorseskeleton.cU(); entityhorseskeleton.cW();
entityhorseskeleton.setTamed(true); entityhorseskeleton.setTamed(true);
entityhorseskeleton.setAgeRaw(0); entityhorseskeleton.setAgeRaw(0);
- entityhorseskeleton.world.addEntity(entityhorseskeleton); - entityhorseskeleton.world.addEntity(entityhorseskeleton);

Datei anzeigen

@ -7,7 +7,7 @@
- this.e.setGoalTarget(this.e.getLastDamager()); - this.e.setGoalTarget(this.e.getLastDamager());
+ this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason + this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
this.g = this.e.getGoalTarget(); this.g = this.e.getGoalTarget();
this.b = this.e.bR(); this.b = this.e.bT();
this.h = 300; this.h = 300;
@@ -66,6 +66,6 @@ @@ -66,6 +66,6 @@
} }

Datei anzeigen

@ -11,7 +11,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} else if (this.f == 1 && iblockdata.getMaterial() == Material.AIR) { } else if (this.f == 1 && iblockdata.getMaterial() == Material.AIR) {
InventorySubcontainer inventorysubcontainer = this.c.do_(); InventorySubcontainer inventorysubcontainer = this.c.dq();
@@ -49,19 +53,28 @@ @@ -49,19 +53,28 @@
boolean flag = false; boolean flag = false;

Datei anzeigen

@ -339,8 +339,8 @@
+ speed = player.abilities.walkSpeed * 10f; + speed = player.abilities.walkSpeed * 10f;
+ } + }
+ +
if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cN())) { if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cP())) {
float f2 = this.player.cN() ? 300.0F : 100.0F; float f2 = this.player.cP() ? 300.0F : 100.0F;
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) { - if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) { + if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
@ -417,7 +417,7 @@
+ +
this.B = d12 >= -0.03125D; this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly; this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cN() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cP() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -394,10 +675,76 @@ @@ -394,10 +675,76 @@
} }
@ -701,7 +701,6 @@
} }
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
- PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent);
+ // CraftBukkit start - Rarely it would send a disconnect line twice + // CraftBukkit start - Rarely it would send a disconnect line twice
+ if (this.processedDisconnect) { + if (this.processedDisconnect) {
+ return; + return;
@ -709,7 +708,7 @@
+ this.processedDisconnect = true; + this.processedDisconnect = true;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent.toPlainText()); // CraftBukkit - Don't toString(). PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent.toPlainText());
+ // CraftBukkit start - Replace vanilla quit message handling with our own. + // CraftBukkit start - Replace vanilla quit message handling with our own.
+ /* + /*
this.minecraftServer.aD(); this.minecraftServer.aD();

Datei anzeigen

@ -374,7 +374,7 @@
+ for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { + for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) {
+ entity = (Entity) this.entityList.get(this.tickPosition); + entity = (Entity) this.entityList.get(this.tickPosition);
+ // CraftBukkit end + // CraftBukkit end
Entity entity1 = entity.bH(); Entity entity1 = entity.bJ();
if (entity1 != null) { if (entity1 != null) {
@@ -1128,7 +1360,7 @@ @@ -1128,7 +1360,7 @@
@ -471,7 +471,7 @@
entity.M = entity.locX; entity.M = entity.locX;
entity.N = entity.locY; entity.N = entity.locY;
@@ -1265,6 +1512,7 @@ @@ -1265,6 +1512,7 @@
entity.aC(); entity.aE();
} else { } else {
entity.B_(); entity.B_();
+ entity.postTick(); // CraftBukkit + entity.postTick(); // CraftBukkit

Datei anzeigen

@ -1,7 +1,7 @@
--- a/net/minecraft/server/WorldGenRegistration.java --- a/net/minecraft/server/WorldGenRegistration.java
+++ b/net/minecraft/server/WorldGenRegistration.java +++ b/net/minecraft/server/WorldGenRegistration.java
@@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
entitywitch.cU(); entitywitch.cW();
entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F); entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
entitywitch.prepare(world.D(new BlockPosition(i, j, k)), (GroupDataEntity) null); entitywitch.prepare(world.D(new BlockPosition(i, j, k)), (GroupDataEntity) null);
- world.addEntity(entitywitch); - world.addEntity(entitywitch);

Datei anzeigen

@ -29,7 +29,7 @@
@@ -1672,14 +1672,14 @@ @@ -1672,14 +1672,14 @@
entityzombievillager.prepare(world.D(new BlockPosition(entityzombievillager)), (GroupDataEntity) null); entityzombievillager.prepare(world.D(new BlockPosition(entityzombievillager)), (GroupDataEntity) null);
entityzombievillager.setProfession(this.c(i1, 0)); entityzombievillager.setProfession(this.c(i1, 0));
entityzombievillager.cU(); entityzombievillager.cW();
- world.addEntity(entityzombievillager); - world.addEntity(entityzombievillager);
+ world.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason + world.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
} else { } else {

Datei anzeigen

@ -4,14 +4,14 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.12-pre6-SNAPSHOT</version> <version>1.12-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.12-pre6</minecraft.version> <minecraft.version>1.12</minecraft.version>
<minecraft_version>1_12_R1</minecraft_version> <minecraft_version>1_12_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>
@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId> <artifactId>sqlite-jdbc</artifactId>
<version>3.16.1</version> <version>3.18.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

Datei anzeigen

@ -553,6 +553,9 @@ public enum CraftSound {
RECORD_WAIT("record.wait"), RECORD_WAIT("record.wait"),
RECORD_WARD("record.ward"), RECORD_WARD("record.ward"),
UI_BUTTON_CLICK("ui.button.click"), UI_BUTTON_CLICK("ui.button.click"),
UI_TOAST_CHALLENGE_COMPLETE("ui.toast.challenge_complete"),
UI_TOAST_IN("ui.toast.in"),
UI_TOAST_OUT("ui.toast.out"),
WEATHER_RAIN("weather.rain"), WEATHER_RAIN("weather.rain"),
WEATHER_RAIN_ABOVE("weather.rain.above"); WEATHER_RAIN_ABOVE("weather.rain.above");
private final String minecraftKey; private final String minecraftKey;

Datei anzeigen

@ -76,7 +76,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
public ChatColor getColor() throws IllegalStateException { public ChatColor getColor() throws IllegalStateException {
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
return CraftChatMessage.getColor(team.getColor()); // PAIL: rename return CraftChatMessage.getColor(team.getColor());
} }
@Override @Override
@ -84,7 +84,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
Validate.notNull(color, "Color cannot be null"); Validate.notNull(color, "Color cannot be null");
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
team.setColor(CraftChatMessage.getColor(color)); // PAIL: rename team.setColor(CraftChatMessage.getColor(color));
} }
public boolean allowFriendlyFire() throws IllegalStateException { public boolean allowFriendlyFire() throws IllegalStateException {