9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00

apply minecraft sources

This commit is contained in:
NONPLAYT
2025-04-21 18:29:21 +03:00
parent 58ef06d87a
commit 9f8678ca4d
22 changed files with 24 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -994,6 +_,13 @@
@@ -986,6 +_,13 @@
if (this.hasStopped) return;
this.hasStopped = true;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -2266,6 +_,7 @@
@@ -2190,6 +_,7 @@
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, gameMode.getId()));
if (gameMode == GameType.SPECTATOR) {
this.removeEntitiesOnShoulder();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -733,8 +_,14 @@
@@ -725,8 +_,14 @@
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) {

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -716,7 +_,6 @@
return this.respawn(player, keepInventory, reason, eventReason, null);
@@ -715,7 +_,6 @@
}
public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, org.bukkit.Location location) {
public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, @Nullable org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, @Nullable org.bukkit.Location location) {
- player.stopRiding(); // CraftBukkit
this.players.remove(player);
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/stats/ServerStatsCounter.java
+++ b/net/minecraft/stats/ServerStatsCounter.java
@@ -81,12 +_,6 @@
@@ -100,12 +_,6 @@
this.dirty.add(stat);
}
@@ -13,7 +13,7 @@
public void parseLocal(DataFixer fixerUpper, String json) {
try {
try (JsonReader jsonReader = new JsonReader(new StringReader(json))) {
@@ -190,9 +_,11 @@
@@ -144,9 +_,11 @@
public void sendStats(ServerPlayer player) {
Object2IntMap<Stat<?>> map = new Object2IntOpenHashMap<>();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -1385,7 +_,7 @@
@@ -1393,7 +_,7 @@
player.setRealHealth(health);
}
@@ -9,7 +9,7 @@
return;
}
// CraftBukkit end
@@ -2673,6 +_,7 @@
@@ -2730,6 +_,7 @@
}
protected void updateSwingTime() {
@@ -17,7 +17,7 @@
int currentSwingDuration = this.getCurrentSwingDuration();
if (this.swinging) {
this.swingTime++;
@@ -3157,7 +_,13 @@
@@ -3212,7 +_,13 @@
}
protected float getFlyingSpeed() {
@@ -32,7 +32,7 @@
}
public float getSpeed() {
@@ -3642,6 +_,7 @@
@@ -3657,6 +_,7 @@
protected void updateFallFlying() {
this.checkSlowFallDistance();
if (!this.level().isClientSide) {

View File

@@ -5,6 +5,6 @@
protected void alertOther(Mob mob, LivingEntity target) {
+ if (mob == target) return; // DivineMC - Fix MC-110386
mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit - reason
mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY); // CraftBukkit - reason
}
}

View File

@@ -12,4 +12,4 @@
+ // DivineMC end - skip useless secondary poi sensor
// Purpur start - Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off
Brain<?> brain = entity.getBrain();
if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == net.minecraft.world.entity.npc.VillagerProfession.CLERIC) {
if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().profession().is(net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -319,6 +_,12 @@
@@ -293,6 +_,12 @@
if (!this.isSilent()) {
serverLevel.levelEvent(null, 1027, this.blockPosition(), 0);
level.levelEvent(null, 1027, this.blockPosition(), 0);
}
+
+ // DivineMC start - Fix MC-200418

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -1879,6 +_,11 @@
@@ -1806,6 +_,11 @@
}
public void causeFoodExhaustion(float exhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason reason) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/world/level/BaseCommandBlock.java
+++ b/net/minecraft/world/level/BaseCommandBlock.java
@@ -21,7 +_,7 @@
@@ -25,7 +_,7 @@
import net.minecraft.world.phys.Vec3;
public abstract class BaseCommandBlock implements CommandSource {
- private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss");
+ private static final ThreadLocal<SimpleDateFormat> TIME_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("HH:mm:ss")); // DivineMC - Make it thread safe
private static final Component DEFAULT_NAME = Component.literal("@");
private static final int NO_LAST_EXECUTION = -1;
private long lastExecution = -1L;
private boolean updateLastExecution = true;
@@ -168,7 +_,7 @@
@@ -156,7 +_,7 @@
public void sendSystemMessage(Component component) {
if (this.trackOutput) {
org.spigotmc.AsyncCatcher.catchOp("sendSystemMessage to a command block"); // Paper - Don't broadcast messages to command blocks

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/Blocks.java
+++ b/net/minecraft/world/level/block/Blocks.java
@@ -6632,6 +_,7 @@
@@ -6744,6 +_,7 @@
.mapColor(MapColor.COLOR_ORANGE)
.instrument(NoteBlockInstrument.BASEDRUM)
.requiresCorrectToolForDrops()

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/LeavesBlock.java
+++ b/net/minecraft/world/level/block/LeavesBlock.java
@@ -77,12 +_,29 @@
@@ -70,12 +_,29 @@
}
protected boolean decaying(BlockState state) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
@@ -267,11 +_,18 @@
@@ -270,11 +_,18 @@
public BlockState getBlockStateFinal(final int x, final int y, final int z) {
// Copied and modified from below
final int sectionIndex = this.getSectionIndex(y);
@@ -22,5 +22,5 @@
+ return section.states.get((y & 15) << 8 | (z & 15) << 4 | (x & 15));
+ // DivineMC end - optimize block state lookup
}
@Override
public BlockState getBlockState(BlockPos pos) {