mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 14:30:17 +01:00
Remove dead diff, some name/diff cleanup
This commit is contained in:
parent
6e0c8776e6
commit
42a2ccff55
9 changed files with 34 additions and 97 deletions
|
@ -8,7 +8,7 @@
|
|||
if (BuiltInRegistries.REGISTRY.keySet().isEmpty()) {
|
||||
throw new IllegalStateException("Unable to load registries");
|
||||
} else {
|
||||
@@ -54,11 +_,78 @@
|
||||
@@ -54,11 +_,80 @@
|
||||
EntitySelectorOptions.bootStrap();
|
||||
DispenseItemBehavior.bootStrap();
|
||||
CauldronInteraction.bootStrap();
|
||||
|
@ -22,7 +22,9 @@
|
|||
wrapStreams();
|
||||
bootstrapDuration.set(Duration.between(instant, Instant.now()).toMillis());
|
||||
}
|
||||
+ // CraftBukkit start - easier than fixing the decompile
|
||||
+ // CraftBukkit start
|
||||
+ // TODO Check what of this is needed, maybe report it to Mojira. if deemed relevant, move to the respective classes
|
||||
+ // Used in CraftLegacy
|
||||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1008, "{Name:'minecraft:oak_sign',Properties:{rotation:'0'}}", "{Name:'minecraft:standing_sign',Properties:{rotation:'0'}}");
|
||||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1009, "{Name:'minecraft:oak_sign',Properties:{rotation:'1'}}", "{Name:'minecraft:standing_sign',Properties:{rotation:'1'}}");
|
||||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1010, "{Name:'minecraft:oak_sign',Properties:{rotation:'2'}}", "{Name:'minecraft:standing_sign',Properties:{rotation:'2'}}");
|
||||
|
@ -41,7 +43,7 @@
|
|||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1023, "{Name:'minecraft:oak_sign',Properties:{rotation:'15'}}", "{Name:'minecraft:standing_sign',Properties:{rotation:'15'}}");
|
||||
+ net.minecraft.util.datafix.fixes.ItemIdFix.ITEM_NAMES.put(323, "minecraft:oak_sign");
|
||||
+
|
||||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1440, "{Name:\'minecraft:portal\',Properties:{axis:\'x\'}}", new String[]{"{Name:\'minecraft:portal\',Properties:{axis:\'x\'}}"});
|
||||
+ net.minecraft.util.datafix.fixes.BlockStateData.register(1440, "{Name:'minecraft:portal',Properties:{axis:'x'}}", "{Name:'minecraft:portal',Properties:{axis:'x'}}");
|
||||
+
|
||||
+ net.minecraft.util.datafix.fixes.ItemIdFix.ITEM_NAMES.put(409, "minecraft:prismarine_shard");
|
||||
+ net.minecraft.util.datafix.fixes.ItemIdFix.ITEM_NAMES.put(410, "minecraft:prismarine_crystals");
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
--- a/net/minecraft/server/ServerFunctionManager.java
|
||||
+++ b/net/minecraft/server/ServerFunctionManager.java
|
||||
@@ -34,7 +_,7 @@
|
||||
}
|
||||
|
||||
public CommandDispatcher<CommandSourceStack> getDispatcher() {
|
||||
- return this.server.getCommands().getDispatcher();
|
||||
+ return this.server.getCommands().getDispatcher(); // CraftBukkit // Paper - Don't override command dispatcher
|
||||
}
|
||||
|
||||
public void tick() {
|
|
@ -1,50 +0,0 @@
|
|||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -58,8 +_,14 @@
|
||||
}
|
||||
|
||||
public boolean stopSprinting() {
|
||||
+ // CraftBukkit start - add sendLog parameter
|
||||
+ return this.stopSprinting(true);
|
||||
+ }
|
||||
+
|
||||
+ public boolean stopSprinting(boolean sendLog) {
|
||||
+ // CraftBukkit end - add sendLog parameter
|
||||
if (this.remainingSprintTicks > 0L) {
|
||||
- this.finishTickSprint();
|
||||
+ this.finishTickSprint(sendLog); // CraftBukkit - add sendLog parameter
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -76,14 +_,20 @@
|
||||
return flag;
|
||||
}
|
||||
|
||||
- private void finishTickSprint() {
|
||||
+ private void finishTickSprint(boolean sendLog) { // CraftBukkit - add sendLog parameter
|
||||
long l = this.scheduledCurrentSprintTicks - this.remainingSprintTicks;
|
||||
double d = Math.max(1.0, (double)this.sprintTimeSpend) / TimeUtil.NANOSECONDS_PER_MILLISECOND;
|
||||
int i = (int)(TimeUtil.MILLISECONDS_PER_SECOND * l / d);
|
||||
String string = String.format("%.2f", l == 0L ? this.millisecondsPerTick() : d / l);
|
||||
this.scheduledCurrentSprintTicks = 0L;
|
||||
this.sprintTimeSpend = 0L;
|
||||
- this.server.createCommandSourceStack().sendSuccess(() -> Component.translatable("commands.tick.sprint.report", i, string), true);
|
||||
+ // CraftBukkit start - add sendLog parameter
|
||||
+ if (sendLog) {
|
||||
+ this.server.createCommandSourceStack().sendSuccess(() -> {
|
||||
+ return Component.translatable("commands.tick.sprint.report", i, string);
|
||||
+ }, true);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.remainingSprintTicks = 0L;
|
||||
this.setFrozen(this.previousIsFrozen);
|
||||
this.server.onTickRateChanged();
|
||||
@@ -97,7 +_,7 @@
|
||||
this.remainingSprintTicks--;
|
||||
return true;
|
||||
} else {
|
||||
- this.finishTickSprint();
|
||||
+ this.finishTickSprint(true); // CraftBukkit - add sendLog parameter
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -9,14 +9,12 @@
|
|||
this.eraseCache = eraseCache;
|
||||
this.dataFixer = dataFixer;
|
||||
this.levelStorage = levelStorage;
|
||||
@@ -357,9 +_,7 @@
|
||||
if (compoundTag != null) {
|
||||
@@ -358,7 +_,7 @@
|
||||
int version = ChunkStorage.getVersion(compoundTag);
|
||||
ChunkGenerator chunkGenerator = WorldUpgrader.this.dimensions.getValueOrThrow(Registries.levelToLevelStem(dimension)).generator();
|
||||
- CompoundTag compoundTag1 = chunkStorage.upgradeChunkTag(
|
||||
CompoundTag compoundTag1 = chunkStorage.upgradeChunkTag(
|
||||
- dimension, () -> WorldUpgrader.this.overworldDataStorage, compoundTag, chunkGenerator.getTypeNameForDataFixer()
|
||||
- );
|
||||
+ CompoundTag compoundTag1 = chunkStorage.upgradeChunkTag(Registries.levelToLevelStem(dimension), () -> WorldUpgrader.this.overworldDataStorage, compoundTag, chunkGenerator.getTypeNameForDataFixer(), chunkPos, null); // CraftBukkit
|
||||
+ Registries.levelToLevelStem(dimension), () -> WorldUpgrader.this.overworldDataStorage, compoundTag, chunkGenerator.getTypeNameForDataFixer(), chunkPos, null // CraftBukkit
|
||||
);
|
||||
ChunkPos chunkPos1 = new ChunkPos(compoundTag1.getInt("xPos"), compoundTag1.getInt("zPos"));
|
||||
if (!chunkPos1.equals(chunkPos)) {
|
||||
WorldUpgrader.LOGGER.warn("Chunk {} has invalid position {}", chunkPos, chunkPos1);
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
+ return this.badRespawnPointExplosion(position, null);
|
||||
+ }
|
||||
+
|
||||
+ public DamageSource badRespawnPointExplosion(Vec3 vec3d, org.bukkit.block.BlockState blockState) {
|
||||
+ return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d).directBlockState(blockState);
|
||||
+ public DamageSource badRespawnPointExplosion(Vec3 position, org.bukkit.block.BlockState blockState) {
|
||||
+ return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), position).directBlockState(blockState);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/effect/MobEffectUtil.java
|
||||
+++ b/net/minecraft/world/effect/MobEffectUtil.java
|
||||
@@ -47,18 +_,31 @@
|
||||
@@ -47,18 +_,38 @@
|
||||
public static List<ServerPlayer> addEffectToPlayersAround(
|
||||
ServerLevel level, @Nullable Entity source, Vec3 pos, double radius, MobEffectInstance effect, int duration
|
||||
) {
|
||||
|
@ -17,28 +17,31 @@
|
|||
+ // Paper end - Add ElderGuardianAppearanceEvent
|
||||
+ // CraftBukkit end
|
||||
Holder<MobEffect> effect1 = effect.getEffect();
|
||||
- List<ServerPlayer> players = level.getPlayers(
|
||||
List<ServerPlayer> players = level.getPlayers(
|
||||
- serverPlayer -> serverPlayer.gameMode.isSurvival()
|
||||
- && (source == null || !source.isAlliedTo(serverPlayer))
|
||||
- && pos.closerThan(serverPlayer.position(), radius)
|
||||
- && (
|
||||
+ // Paper start - Add ElderGuardianAppearanceEvent
|
||||
+ serverPlayer -> {
|
||||
+ final boolean condition = serverPlayer.gameMode.isSurvival()
|
||||
&& (source == null || !source.isAlliedTo(serverPlayer))
|
||||
&& pos.closerThan(serverPlayer.position(), radius)
|
||||
&& (
|
||||
- !serverPlayer.hasEffect(effect1)
|
||||
- || serverPlayer.getEffect(effect1).getAmplifier() < effect.getAmplifier()
|
||||
- || serverPlayer.getEffect(effect1).endsWithin(duration - 1)
|
||||
- )
|
||||
- );
|
||||
- players.forEach(serverPlayer -> serverPlayer.addEffect(new MobEffectInstance(effect), source));
|
||||
+ List<ServerPlayer> players = level.getPlayers((entityplayer) -> {
|
||||
+ // Paper start - Add ElderGuardianAppearanceEvent
|
||||
+ boolean condition = entityplayer.gameMode.isSurvival() && (source == null || !source.isAlliedTo((Entity) entityplayer)) && pos.closerThan(entityplayer.position(), radius) && (!entityplayer.hasEffect(effect1) || entityplayer.getEffect(effect1).getAmplifier() < effect.getAmplifier() || entityplayer.getEffect(effect1).endsWithin(duration - 1));
|
||||
+ !serverPlayer.hasEffect(effect1)
|
||||
+ || serverPlayer.getEffect(effect1).getAmplifier() < effect.getAmplifier()
|
||||
+ || serverPlayer.getEffect(effect1).endsWithin(duration - 1)
|
||||
+ );
|
||||
+ if (condition) {
|
||||
+ return playerPredicate == null || playerPredicate.test(entityplayer); // Only test the player AFTER it is true
|
||||
+ return playerPredicate == null || playerPredicate.test(serverPlayer); // Only test the player AFTER it is true
|
||||
+ } else {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Paper end - Add ElderGuardianAppearanceEvent
|
||||
+ });
|
||||
+
|
||||
+ // Paper end - Add ElderGuardianAppearanceEvent
|
||||
+ players.forEach(serverPlayer -> serverPlayer.addEffect(new MobEffectInstance(effect), source, cause)); // CraftBukkit
|
||||
return players;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
return false;
|
||||
} else {
|
||||
mutableLong.setValue(time + 20L + level.getRandom().nextInt(20));
|
||||
+ if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck
|
||||
+ if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option
|
||||
PoiManager poiManager = level.getPoiManager();
|
||||
map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time));
|
||||
Predicate<BlockPos> predicate1 = pos -> {
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
nearestVisibleLivingEntities -> nearestVisibleLivingEntities.findClosest(livingEntity -> this.ramTargeting.test(level, entity, livingEntity))
|
||||
)
|
||||
+ // CraftBukkit start
|
||||
+ .map((entityliving) -> {
|
||||
+ org.bukkit.event.entity.EntityTargetEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(entity, entityliving, (entityliving instanceof net.minecraft.server.level.ServerPlayer) ? org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER : org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_ENTITY);
|
||||
+ .map((livingEntity) -> {
|
||||
+ org.bukkit.event.entity.EntityTargetEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(entity, livingEntity, (livingEntity instanceof net.minecraft.server.level.ServerPlayer) ? org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER : org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_ENTITY);
|
||||
+ if (event.isCancelled() || event.getTarget() == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ entityliving = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
||||
+ return entityliving;
|
||||
+ livingEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
||||
+ return livingEntity;
|
||||
+ })
|
||||
+ // CraftBukkit end
|
||||
.ifPresent(entity1 -> this.chooseRamPosition(entity, entity1));
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
--- a/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
|
||||
+++ b/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
|
||||
@@ -69,9 +_,17 @@
|
||||
@@ -69,6 +_,12 @@
|
||||
super.dropEquipment(level);
|
||||
if (this.hasChest()) {
|
||||
this.spawnAtLocation(level, Blocks.CHEST);
|
||||
+ //this.setChest(false); // Paper - moved to post death logic
|
||||
+ // Paper start - moved to post death logic
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ protected void postDeathDropItems(org.bukkit.event.entity.EntityDeathEvent event) {
|
||||
+ if (this.hasChest() && (event == null || !event.isCancelled())) {
|
||||
+ if (this.hasChest() && !event.isCancelled()) {
|
||||
+ // Paper end - moved to post death logic
|
||||
this.setChest(false);
|
||||
}
|
||||
}
|
||||
+ // Paper end
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag compound) {
|
||||
|
|
Loading…
Reference in a new issue