Compile issues 1

This commit is contained in:
Bjarne Koll 2024-10-25 13:19:23 +02:00
parent f37c1be91e
commit 4c984f6e46
5 changed files with 7 additions and 7 deletions

View file

@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> { + case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> {
+ Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class, "Game Event namespace must have GameEvent type"); + Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class, "Game Event namespace must have GameEvent type");
+ TagKey<net.minecraft.world.level.gameevent.GameEvent> gameEventTagKey = TagKey.create(net.minecraft.core.registries.Registries.GAME_EVENT, key); + TagKey<net.minecraft.world.level.gameevent.GameEvent> gameEventTagKey = TagKey.create(net.minecraft.core.registries.Registries.GAME_EVENT, key);
+ if (net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.getTag(gameEventTagKey).isPresent()) { + if (net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.get(gameEventTagKey).isPresent()) {
+ return (org.bukkit.Tag<T>) new io.papermc.paper.CraftGameEventTag(net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT, gameEventTagKey); + return (org.bukkit.Tag<T>) new io.papermc.paper.CraftGameEventTag(net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT, gameEventTagKey);
+ } + }
+ } + }
@ -73,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> { + case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> {
+ Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class); + Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class);
+ net.minecraft.core.Registry<net.minecraft.world.level.gameevent.GameEvent> gameEvents = net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT; + net.minecraft.core.Registry<net.minecraft.world.level.gameevent.GameEvent> gameEvents = net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT;
+ return gameEvents.getTags().map(pair -> (org.bukkit.Tag<T>) new io.papermc.paper.CraftGameEventTag(gameEvents, pair.getFirst())).collect(ImmutableList.toImmutableList()); + return gameEvents.getTags().map(pair -> (org.bukkit.Tag<T>) new io.papermc.paper.CraftGameEventTag(gameEvents, pair.key())).collect(ImmutableList.toImmutableList());
+ } + }
+ // Paper end + // Paper end
default -> throw new IllegalArgumentException(); default -> throw new IllegalArgumentException();

View file

@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @Override + @Override
+ public void fluidTick() { + public void fluidTick() {
+ this.getNMSFluid().tick(this.world.getMinecraftWorld(), this.position); + this.getNMSFluid().tick(this.world.getMinecraftWorld(), this.position, this.getNMS());
+ } + }
+ +
+ @Override + @Override

View file

@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ PrimaryLevelData worldData = level.serverLevelData; + PrimaryLevelData worldData = level.serverLevelData;
+ if (forceUpdate || !worldData.isDifficultyLocked()) { + if (forceUpdate || !worldData.isDifficultyLocked()) {
+ worldData.setDifficulty(worldData.isHardcore() ? Difficulty.HARD : difficulty); + worldData.setDifficulty(worldData.isHardcore() ? Difficulty.HARD : difficulty);
+ level.setSpawnSettings(worldData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); + level.setSpawnSettings(worldData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters);
+ // this.getPlayerList().getPlayers().forEach(this::sendDifficultyUpdate); + // this.getPlayerList().getPlayers().forEach(this::sendDifficultyUpdate);
+ // Paper end - per level difficulty + // Paper end - per level difficulty
} }

View file

@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @Override + @Override
+ public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) { + public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {
+ getHandle().gameEvent(sourceEntity != null ? ((CraftEntity) sourceEntity).getHandle(): null, net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.getHolder(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(gameEvent.getKey())).orElseThrow(), org.bukkit.craftbukkit.util.CraftVector.toBlockPos(position)); + getHandle().gameEvent(sourceEntity != null ? ((CraftEntity) sourceEntity).getHandle(): null, net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.get(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(gameEvent.getKey())).orElseThrow(), org.bukkit.craftbukkit.util.CraftVector.toBlockPos(position));
+ } + }
+ // Paper end + // Paper end
+ +

View file

@ -13,8 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ // Paper start - Prevent "softlocked" exit portal generation + // Paper start - Prevent "softlocked" exit portal generation
+ if (this.portalLocation.getY() <= this.level.getMinBuildHeight()) { + if (this.portalLocation.getY() <= this.level.getMinY()) {
+ this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1); + this.portalLocation = this.portalLocation.atY(this.level.getMinY() + 1);
+ } + }
+ // Paper end - Prevent "softlocked" exit portal generation + // Paper end - Prevent "softlocked" exit portal generation
if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) { if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) {