geforkt von Mirrors/Paper
Patches, patches, patches
Dieser Commit ist enthalten in:
Ursprung
8b9b485cab
Commit
951043246e
@ -59,23 +59,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@Nullable RemoteChatSession.Data chatSession
|
||||
) {
|
||||
Entry(ServerPlayer player) {
|
||||
+ // Paper start - Add Listing API for Player
|
||||
+ // Paper start - Add Listing API for Player
|
||||
+ this(player, true);
|
||||
+ }
|
||||
+ Entry(ServerPlayer player, boolean listed) {
|
||||
this(
|
||||
+ // Paper end - Add Listing API for Player
|
||||
player.getUUID(),
|
||||
player.getGameProfile(),
|
||||
- true,
|
||||
+ listed,
|
||||
+ listed, // Paper - Add Listing API for Player
|
||||
player.connection.latency(),
|
||||
player.gameMode.getGameModeForPlayer(),
|
||||
player.getTabListDisplayName(),
|
||||
@@ -0,0 +0,0 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
Optionull.map(player.getChatSession(), RemoteChatSession::asData)
|
||||
);
|
||||
}
|
||||
+ // Paper start - Add Listing API for Player
|
||||
+ Entry(UUID profileId, boolean listed) {
|
||||
+ this(profileId, null, listed, 0, GameType.DEFAULT_MODE, null, null);
|
||||
+ this(profileId, null, listed, 0, GameType.DEFAULT_MODE, null, 0, null);
|
||||
+ }
|
||||
+ // Paper end - Add Listing API for Player
|
||||
}
|
@ -17,13 +17,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
BlockState neighborState,
|
||||
RandomSource random
|
||||
) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return state; // Paper - add option to disable block updates
|
||||
if (!state.canSurvive(world, pos)) {
|
||||
world.scheduleTick(pos, this, 1);
|
||||
return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
tickView.scheduleTick(pos, this, 1);
|
||||
return super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
@@ -0,0 +0,0 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
@ -53,13 +53,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
BlockPos blockPos = ctx.getClickedPos();
|
||||
return this.defaultBlockState()
|
||||
@@ -0,0 +0,0 @@ public class HugeMushroomBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
BlockState neighborState,
|
||||
RandomSource random
|
||||
) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableMushroomBlockUpdates) return state; // Paper - add option to disable block updates
|
||||
return neighborState.is(this)
|
||||
? state.setValue(PROPERTY_BY_DIRECTION.get(direction), Boolean.valueOf(false))
|
||||
: super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
: super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
@@ -0,0 +0,0 @@ public class HugeMushroomBlock extends Block {
|
||||
|
||||
@Override
|
||||
@ -89,23 +89,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
|
||||
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
||||
|
||||
return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
@@ -0,0 +0,0 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
|
||||
boolean flag1 = world.hasNeighborSignal(pos);
|
||||
|
||||
if (flag1 != (Boolean) state.getValue(NoteBlock.POWERED)) {
|
||||
@@ -0,0 +0,0 @@ public class NoteBlock extends Block {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
@Override
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
if (!world.isClientSide) {
|
||||
- state = (BlockState) state.cycle(NoteBlock.NOTE);
|
||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
||||
world.setBlock(pos, state, 3);
|
||||
@ -126,9 +126,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
|
||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
}
|
||||
|
||||
@Override
|
@ -53,7 +53,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
@@ -0,0 +0,0 @@ populateFields(victim, event); // Paper - make cancellable
|
||||
}
|
||||
// Paper end
|
||||
|
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void onClientRemoval() {}
|
||||
public void onRemoval(Entity.RemovalReason reason) {}
|
||||
|
||||
public void setPose(net.minecraft.world.entity.Pose pose) {
|
||||
+ if (this.fixedPose) return; // Paper - Expand Pose API
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
public void kill(ServerLevel world) {
|
||||
+ // Paper start - Fire entity death event
|
||||
+ this.silentDeath = true;
|
||||
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, this.damageSources().genericKill());
|
||||
@ -20,7 +20,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - Fire entity death event
|
||||
+
|
||||
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
if (this.dragonFight != null) {
|
@ -12,7 +12,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/ma
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBoat extends CraftVehicle implements Boat {
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftBoat extends CraftVehicle implements Boat {
|
||||
|
||||
@Override
|
||||
public Status getStatus() {
|
@ -1153,7 +1153,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
||||
+ // Paper start - Folia scheduler API
|
||||
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@ -1170,15 +1170,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ });
|
||||
+ // Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
this.profiler.push("commandFunctions");
|
||||
gameprofilerfiller.push("commandFunctions");
|
||||
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
entityplayer.unRide();
|
||||
worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
||||
+ entityplayer.retireScheduler(); // Paper - Folia schedulers
|
||||
entityplayer.getAdvancements().stopListening();
|
||||
@ -1203,16 +1203,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
return this.bukkitEntity;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public CraftEntity getBukkitEntityRaw() {
|
||||
+ return this.bukkitEntity;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
|
||||
return this.getBukkitEntity();
|
||||
|
||||
// CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
public int getDefaultMaxAirSupply() {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
|
||||
CraftEventFactory.callEntityRemoveEvent(this, cause);
|
||||
@ -1222,9 +1220,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.removalReason = entity_removalreason;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
this.getPassengers().forEach(Entity::stopRiding);
|
||||
this.levelCallback.onRemove(entity_removalreason);
|
||||
this.onRemoval(entity_removalreason);
|
||||
+ // Paper start - Folia schedulers
|
||||
+ if (!(this instanceof ServerPlayer) && entity_removalreason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
|
||||
+ // Players need to be special cased, because they are regularly removed from the world
|
@ -23,13 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// Paper start - Prevent moving into unloaded chunks
|
||||
if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
|
||||
- this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
|
||||
- this.internalTeleport(PositionMoveRotation.of(this.player), Collections.emptySet());
|
||||
- return;
|
||||
+ // Paper start - Add fail move event
|
||||
+ io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_INTO_UNLOADED_CHUNK,
|
||||
+ toX, toY, toZ, toYaw, toPitch, false);
|
||||
+ if (!event.isAllowed()) {
|
||||
+ this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
|
||||
+ this.internalTeleport(PositionMoveRotation.of(this.player), Collections.emptySet());
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - Add fail move event
|
||||
@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2))) {
|
||||
// CraftBukkit end
|
||||
- ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
|
||||
- this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||
@ -88,7 +88,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ if (teleportBack) {
|
||||
+ // Paper end - Add fail move event
|
||||
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
this.internalTeleport(d3, d4, d5, f, f1); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
|
||||
} else {
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntit
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean isFacingFrontText(net.minecraft.world.entity.player.Player player) {
|
@ -16,6 +16,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
|
||||
}
|
||||
// Paper end - respect global sound events gamerule
|
||||
+ // Paper start - notify observers even if grow failed
|
||||
+ public void checkCapturedTreeStateForObserverNotify(final BlockPos pos, final org.bukkit.craftbukkit.block.CraftBlockState craftBlockState) {
|
||||
+ // notify observers if the block state is the same and the Y level equals the original y level (for mega trees)
|
||||
+ // blocks at the same Y level with the same state can be assumed to be saplings which trigger observers regardless of if the
|
||||
+ // tree grew or not
|
||||
+ if (craftBlockState.getPosition().getY() == pos.getY() && this.getBlockState(craftBlockState.getPosition()) == craftBlockState.getHandle()) {
|
||||
+ this.notifyAndUpdatePhysics(craftBlockState.getPosition(), null, craftBlockState.getHandle(), craftBlockState.getHandle(), craftBlockState.getHandle(), craftBlockState.getFlag(), 512);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - notify observers even if grow failed
|
||||
|
||||
@Override
|
||||
public CrashReportCategory fillReportDetails(CrashReport report) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@ -28,25 +49,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
|
||||
}
|
||||
// Paper end - respect global sound events gamerule
|
||||
+ // Paper start - notify observers even if grow failed
|
||||
+ public void checkCapturedTreeStateForObserverNotify(final BlockPos pos, final CraftBlockState craftBlockState) {
|
||||
+ // notify observers if the block state is the same and the Y level equals the original y level (for mega trees)
|
||||
+ // blocks at the same Y level with the same state can be assumed to be saplings which trigger observers regardless of if the
|
||||
+ // tree grew or not
|
||||
+ if (craftBlockState.getPosition().getY() == pos.getY() && this.getBlockState(craftBlockState.getPosition()) == craftBlockState.getHandle()) {
|
||||
+ this.notifyAndUpdatePhysics(craftBlockState.getPosition(), null, craftBlockState.getHandle(), craftBlockState.getHandle(), craftBlockState.getHandle(), craftBlockState.getFlag(), 512);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - notify observers even if grow failed
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
|
@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return false;
|
||||
}
|
||||
|
||||
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, MobSpawnType.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
||||
+ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, trader -> trader.setDespawnDelay(48000), blockposition2, MobSpawnType.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit // Paper - set despawnTimer before spawn events called
|
||||
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, EntitySpawnReason.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
||||
+ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, trader -> trader.setDespawnDelay(48000), blockposition2, EntitySpawnReason.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBu // Paper - set despawnTimer before spawn events calledkkit
|
||||
|
||||
if (entityvillagertrader != null) {
|
||||
for (int i = 0; i < 2; ++i) {
|
@ -39,9 +39,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ combine(combine(spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null), CLEAR_MOVE_IF_NOT_RANDOMIZED), (spawnData, experienceOrb) -> { if (!spawnData.randomizeData()) { experienceOrb.setYRot(0); } }) // Paper - respect randomizeData
|
||||
));
|
||||
register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), new net.minecraft.world.item.ItemStack(Items.EGG))));
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1)));
|
||||
net.minecraft.world.entity.projectile.ThrownPotion entity = new net.minecraft.world.entity.projectile.ThrownPotion(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), new net.minecraft.world.item.ItemStack(Items.SPLASH_POTION));
|
||||
return entity;
|
||||
}));
|
||||
- register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
@ -64,5 +64,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }));
|
||||
+ // Paper end - respect randomizeData
|
||||
register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null)));
|
||||
register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, createMinecart(net.minecraft.world.entity.EntityType.COMMAND_BLOCK_MINECART)));
|
||||
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, createMinecart(net.minecraft.world.entity.EntityType.MINECART)));
|
@ -15,5 +15,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- long j = BiomeManager.obfuscateSeed(creator.seed());
|
||||
+ long j = BiomeManager.obfuscateSeed(worlddata.worldGenOptions().seed()); // Paper - use world seed
|
||||
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
|
||||
LevelStem worlddimension = iregistry.get(actualDimension);
|
||||
LevelStem worlddimension = iregistry.getValue(actualDimension);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren