mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
SPIGOT-1583: Fix scoreboard crash.
Might not function 100%, but doesn't crash!
This commit is contained in:
parent
ffacb6cf79
commit
a5d4a933bc
@ -65,13 +65,13 @@
|
||||
|
||||
if (f > 0.1F) {
|
||||
f = 0.1F;
|
||||
@@ -416,16 +440,20 @@
|
||||
@@ -416,28 +440,35 @@
|
||||
public void b(Entity entity, int i) {
|
||||
if (entity != this) {
|
||||
this.addScore(i);
|
||||
- Collection collection = this.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.f);
|
||||
+ // CraftBukkit - Get our scores instead
|
||||
+ Collection collection = this.world.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.f, this.getName(), new java.util.ArrayList<ScoreboardScore>());
|
||||
+ Collection<ScoreboardScore> collection = this.world.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.f, this.getName(), new java.util.ArrayList<ScoreboardScore>());
|
||||
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.b(StatisticList.D);
|
||||
@ -85,11 +85,22 @@
|
||||
}
|
||||
|
||||
- collection.addAll(this.d(entity));
|
||||
- Iterator iterator = collection.iterator();
|
||||
+ // collection.addAll(this.d(entity)); // PAIL
|
||||
Iterator iterator = collection.iterator();
|
||||
+ Iterator<ScoreboardScore> iterator = collection.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -438,6 +466,7 @@
|
||||
- ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next();
|
||||
- ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective);
|
||||
+ // CraftBukkit start
|
||||
+ // ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next();
|
||||
+ // ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective);
|
||||
|
||||
- scoreboardscore.incrementScore();
|
||||
+ iterator.next().incrementScore();
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +108,7 @@
|
||||
private Collection<ScoreboardObjective> d(Entity entity) {
|
||||
String s = entity instanceof EntityHuman ? entity.getName() : entity.getUniqueID().toString();
|
||||
ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName());
|
||||
@@ -471,6 +500,7 @@
|
||||
@@ -471,6 +502,7 @@
|
||||
}
|
||||
|
||||
public EntityItem a(boolean flag) {
|
||||
@ -105,7 +116,7 @@
|
||||
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && this.inventory.getItemInHand() != null ? this.inventory.getItemInHand().count : 1), false, true);
|
||||
}
|
||||
|
||||
@@ -513,6 +543,30 @@
|
||||
@@ -513,6 +545,30 @@
|
||||
entityitem.motZ += Math.sin((double) f1) * (double) f;
|
||||
}
|
||||
|
||||
@ -136,7 +147,7 @@
|
||||
ItemStack itemstack1 = this.a(entityitem);
|
||||
|
||||
if (flag1) {
|
||||
@@ -612,6 +666,13 @@
|
||||
@@ -612,6 +668,13 @@
|
||||
this.a(true, true, false);
|
||||
}
|
||||
|
||||
@ -150,7 +161,7 @@
|
||||
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
|
||||
this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
||||
this.f = nbttagcompound.getBoolean("SpawnForced");
|
||||
@@ -649,6 +710,12 @@
|
||||
@@ -649,6 +712,12 @@
|
||||
this.foodData.b(nbttagcompound);
|
||||
this.abilities.a(nbttagcompound);
|
||||
nbttagcompound.set("EnderItems", this.enderChest.h());
|
||||
@ -163,7 +174,7 @@
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
@@ -667,7 +734,7 @@
|
||||
@@ -667,7 +736,7 @@
|
||||
|
||||
if (damagesource.r()) {
|
||||
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||
@ -172,7 +183,7 @@
|
||||
}
|
||||
|
||||
if (this.world.getDifficulty() == EnumDifficulty.EASY) {
|
||||
@@ -679,7 +746,7 @@
|
||||
@@ -679,7 +748,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,7 +192,7 @@
|
||||
return false;
|
||||
} else {
|
||||
Entity entity = damagesource.getEntity();
|
||||
@@ -695,10 +762,29 @@
|
||||
@@ -695,10 +764,29 @@
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
@ -214,7 +225,7 @@
|
||||
}
|
||||
|
||||
protected void damageArmor(float f) {
|
||||
@@ -742,7 +828,12 @@
|
||||
@@ -742,7 +830,12 @@
|
||||
return (float) i / (float) this.inventory.armor.length;
|
||||
}
|
||||
|
||||
@ -228,7 +239,7 @@
|
||||
if (!this.isInvulnerable(damagesource)) {
|
||||
f = this.applyArmorModifier(damagesource, f);
|
||||
f = this.applyMagicModifier(damagesource, f);
|
||||
@@ -762,6 +853,7 @@
|
||||
@@ -762,6 +855,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
@ -236,7 +247,7 @@
|
||||
}
|
||||
|
||||
public void openSign(TileEntitySign tileentitysign) {}
|
||||
@@ -884,7 +976,15 @@
|
||||
@@ -884,7 +978,15 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
f3 = ((EntityLiving) entity).getHealth();
|
||||
if (j > 0 && !entity.isBurning()) {
|
||||
@ -253,7 +264,7 @@
|
||||
entity.setOnFire(1);
|
||||
}
|
||||
}
|
||||
@@ -925,11 +1025,28 @@
|
||||
@@ -925,11 +1027,28 @@
|
||||
}
|
||||
|
||||
if (entity instanceof EntityPlayer && entity.velocityChanged) {
|
||||
@ -282,7 +293,7 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -991,7 +1108,8 @@
|
||||
@@ -991,7 +1110,8 @@
|
||||
|
||||
if (itemstack3 != null && object instanceof EntityLiving) {
|
||||
itemstack3.a((EntityLiving) object, this);
|
||||
@ -292,7 +303,7 @@
|
||||
this.a(EnumHand.MAIN_HAND, (ItemStack) null);
|
||||
}
|
||||
}
|
||||
@@ -1001,7 +1119,14 @@
|
||||
@@ -1001,7 +1121,14 @@
|
||||
|
||||
this.a(StatisticList.y, Math.round(f5 * 10.0F));
|
||||
if (j > 0) {
|
||||
@ -308,7 +319,7 @@
|
||||
}
|
||||
|
||||
if (this.world instanceof WorldServer && f5 > 2.0F) {
|
||||
@@ -1090,6 +1215,20 @@
|
||||
@@ -1090,6 +1217,20 @@
|
||||
this.stopRiding();
|
||||
}
|
||||
|
||||
@ -329,7 +340,7 @@
|
||||
this.setSize(0.2F, 0.2F);
|
||||
if (this.world.isLoaded(blockposition)) {
|
||||
EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
|
||||
@@ -1172,6 +1311,23 @@
|
||||
@@ -1172,6 +1313,23 @@
|
||||
this.world.everyoneSleeping();
|
||||
}
|
||||
|
||||
@ -353,7 +364,7 @@
|
||||
this.sleepTicks = flag ? 0 : 100;
|
||||
if (flag2) {
|
||||
this.setRespawnPosition(this.bedPosition, false);
|
||||
@@ -1222,9 +1378,11 @@
|
||||
@@ -1222,9 +1380,11 @@
|
||||
if (blockposition != null) {
|
||||
this.e = blockposition;
|
||||
this.f = flag;
|
||||
|
Loading…
Reference in New Issue
Block a user