mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 22:52:13 -07:00
@@ -703,6 +703,15 @@
|
|||||||
ServerPlayer entityplayer = (ServerPlayer) this;
|
ServerPlayer entityplayer = (ServerPlayer) this;
|
||||||
|
|
||||||
entityplayer.awardStat(Stats.ITEM_USED.get(itemstack.getItem()));
|
entityplayer.awardStat(Stats.ITEM_USED.get(itemstack.getItem()));
|
||||||
|
@@ -1477,7 +1742,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.level().isClientSide && this.hasCustomName()) {
|
||||||
|
- LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString());
|
||||||
|
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dead = true;
|
||||||
@@ -1512,14 +1777,22 @@
|
@@ -1512,14 +1777,22 @@
|
||||||
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||||
|
|
||||||
@@ -894,7 +903,7 @@
|
|||||||
+ };
|
+ };
|
||||||
+ float freezingModifier = freezing.apply((double) f).floatValue();
|
+ float freezingModifier = freezing.apply((double) f).floatValue();
|
||||||
+ f += freezingModifier;
|
+ f += freezingModifier;
|
||||||
+
|
|
||||||
+ com.google.common.base.Function<Double, Double> hardHat = new com.google.common.base.Function<Double, Double>() {
|
+ com.google.common.base.Function<Double, Double> hardHat = new com.google.common.base.Function<Double, Double>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public Double apply(Double f) {
|
+ public Double apply(Double f) {
|
||||||
@@ -924,7 +933,7 @@
|
|||||||
+ };
|
+ };
|
||||||
+ float armorModifier = armor.apply((double) f).floatValue();
|
+ float armorModifier = armor.apply((double) f).floatValue();
|
||||||
+ f += armorModifier;
|
+ f += armorModifier;
|
||||||
|
+
|
||||||
+ com.google.common.base.Function<Double, Double> resistance = new com.google.common.base.Function<Double, Double>() {
|
+ com.google.common.base.Function<Double, Double> resistance = new com.google.common.base.Function<Double, Double>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public Double apply(Double f) {
|
+ public Double apply(Double f) {
|
||||||
@@ -1103,19 +1112,19 @@
|
|||||||
this.setHealth(0.0F);
|
this.setHealth(0.0F);
|
||||||
this.die(this.damageSources().generic());
|
this.die(this.damageSources().generic());
|
||||||
}
|
}
|
||||||
@@ -2181,6 +2672,12 @@
|
@@ -2182,6 +2673,12 @@
|
||||||
public abstract Iterable<ItemStack> getArmorSlots();
|
|
||||||
|
|
||||||
public abstract ItemStack getItemBySlot(EquipmentSlot slot);
|
public abstract ItemStack getItemBySlot(EquipmentSlot slot);
|
||||||
+
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public void setItemSlot(EquipmentSlot enumitemslot, ItemStack itemstack, boolean silent) {
|
+ public void setItemSlot(EquipmentSlot enumitemslot, ItemStack itemstack, boolean silent) {
|
||||||
+ this.setItemSlot(enumitemslot, itemstack);
|
+ this.setItemSlot(enumitemslot, itemstack);
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
public abstract void setItemSlot(EquipmentSlot slot, ItemStack stack);
|
public abstract void setItemSlot(EquipmentSlot slot, ItemStack stack);
|
||||||
|
|
||||||
|
public Iterable<ItemStack> getHandSlots() {
|
||||||
@@ -2494,7 +2991,7 @@
|
@@ -2494,7 +2991,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1301,7 +1310,7 @@
|
|||||||
+ org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(enumhand);
|
+ org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(enumhand);
|
||||||
+ PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem, hand);
|
+ PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem, hand);
|
||||||
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
+
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ // Update client
|
+ // Update client
|
||||||
+ Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
|
+ Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
|
||||||
@@ -1312,7 +1321,7 @@
|
|||||||
+ entityPlayer.getBukkitEntity().updateScaledHealth();
|
+ entityPlayer.getBukkitEntity().updateScaledHealth();
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ itemstack = (craftItem.equals(event.getItem())) ? this.useItem.finishUsingItem(this.level(), this) : CraftItemStack.asNMSCopy(event.getItem()).finishUsingItem(this.level(), this);
|
+ itemstack = (craftItem.equals(event.getItem())) ? this.useItem.finishUsingItem(this.level(), this) : CraftItemStack.asNMSCopy(event.getItem()).finishUsingItem(this.level(), this);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ itemstack = this.useItem.finishUsingItem(this.level(), this);
|
+ itemstack = this.useItem.finishUsingItem(this.level(), this);
|
||||||
|
@@ -24,25 +24,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -216,7 +224,18 @@
|
@@ -214,7 +222,18 @@
|
||||||
return this.assignProfessionWhenSpawned;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public boolean assignProfessionWhenSpawned() {
|
||||||
|
return this.assignProfessionWhenSpawned;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ // Spigot Start
|
+ // Spigot Start
|
||||||
@Override
|
+ @Override
|
||||||
+ public void inactiveTick() {
|
+ public void inactiveTick() {
|
||||||
+ // SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
|
+ // SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
|
||||||
+ if (this.level().spigotConfig.tickInactiveVillagers && this.isEffectiveAi()) {
|
+ if (this.level().spigotConfig.tickInactiveVillagers && this.isEffectiveAi()) {
|
||||||
+ this.customServerAiStep((ServerLevel) this.level());
|
+ this.customServerAiStep((ServerLevel) this.level());
|
||||||
+ }
|
+ }
|
||||||
+ super.inactiveTick();
|
+ super.inactiveTick();
|
||||||
+ }
|
}
|
||||||
+ // Spigot End
|
+ // Spigot End
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
protected void customServerAiStep(ServerLevel world) {
|
|
||||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void customServerAiStep(ServerLevel world) {
|
||||||
@@ -235,7 +254,7 @@
|
@@ -235,7 +254,7 @@
|
||||||
this.increaseProfessionLevelOnUpdate = false;
|
this.increaseProfessionLevelOnUpdate = false;
|
||||||
}
|
}
|
||||||
@@ -100,6 +100,15 @@
|
|||||||
Logger logger = Villager.LOGGER;
|
Logger logger = Villager.LOGGER;
|
||||||
|
|
||||||
Objects.requireNonNull(logger);
|
Objects.requireNonNull(logger);
|
||||||
|
@@ -618,7 +649,7 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void die(DamageSource damageSource) {
|
||||||
|
- Villager.LOGGER.info("Villager {} died, message: '{}'", this, damageSource.getLocalizedDeathMessage(this).getString());
|
||||||
|
+ if (org.spigotmc.SpigotConfig.logVillagerDeaths) Villager.LOGGER.info("Villager {} died, message: '{}'", this, damageSource.getLocalizedDeathMessage(this).getString()); // Spigot
|
||||||
|
Entity entity = damageSource.getEntity();
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
@@ -808,7 +839,7 @@
|
@@ -808,7 +839,7 @@
|
||||||
entitywitch1.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch1.blockPosition()), EntitySpawnReason.CONVERSION, (SpawnGroupData) null);
|
entitywitch1.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch1.blockPosition()), EntitySpawnReason.CONVERSION, (SpawnGroupData) null);
|
||||||
entitywitch1.setPersistenceRequired();
|
entitywitch1.setPersistenceRequired();
|
||||||
|
@@ -389,4 +389,11 @@ public class SpigotConfig
|
|||||||
SpigotConfig.disableAdvancementSaving = SpigotConfig.getBoolean("advancements.disable-saving", false);
|
SpigotConfig.disableAdvancementSaving = SpigotConfig.getBoolean("advancements.disable-saving", false);
|
||||||
SpigotConfig.disabledAdvancements = SpigotConfig.getList("advancements.disabled", Arrays.asList(new String[]{"minecraft:story/disabled"}));
|
SpigotConfig.disabledAdvancements = SpigotConfig.getList("advancements.disabled", Arrays.asList(new String[]{"minecraft:story/disabled"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean logVillagerDeaths;
|
||||||
|
public static boolean logNamedDeaths;
|
||||||
|
private static void logDeaths() {
|
||||||
|
SpigotConfig.logVillagerDeaths = SpigotConfig.getBoolean("settings.log-villager-deaths", true);
|
||||||
|
SpigotConfig.logNamedDeaths = SpigotConfig.getBoolean("settings.log-named-deaths", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user