Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use plotsquared with Paper-Folia #4009

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

TheMeinerLP
Copy link
Member

Overview

Experimental folia support for plotsquared

Description

This PR implements a experimental version of plotsquared into folia

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@TheMeinerLP TheMeinerLP requested a review from a team as a code owner April 5, 2023 11:14
@github-actions github-actions bot added the Feature This PR proposes a new feature label Apr 5, 2023
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be tested properly until FAWE or WE supports Folia.

@@ -24,7 +24,7 @@ dependencies {
implementation("org.bstats:bstats-bukkit")

// Paper
compileOnly("io.papermc.paper:paper-api")
compileOnly("dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compileOnly("dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT")
compileOnly("dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT")

This doesn't look right to me. The bukkit module has to stick to Paper for compatibility and compiling reasons.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When i allow both. The the API support for folia will break in IJ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this breaks compatibility with Spigot and Paper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Let me check that how we can handle it

import com.google.inject.Singleton;
import com.google.inject.Stage;
import com.google.inject.TypeLiteral;
import com.google.inject.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use asterisk imports. Please configure your IDE to respect the .editorconfig file placed in the root directory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My ide dont respect the settings 😂 Idk why but all the default settings

Comment on lines +439 to +441
if (PlotSquared.platform().serverVersion()[1] <= 19) {
biomes.remove(Biome.CHERRY_GROVE);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that supposed to do? Does folia not support cherry groves?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some 1.19.4 servers tries to generate plots without 1.20 datapacks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the issue. CHERRY_GROVE exist in 1.19.4, what does Folia or 1.20 have to do with it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[13:21:06] [pool-13-thread-1/WARN]: [PlotSquared/BukkitPlatform] This message may also be a false positive and could be ignored.
[13:21:06] [Server thread/INFO]: [PlotSquared/BukkitPlatform] (UUID) 0 UUIDs will be cached
[13:21:06] [Server thread/INFO]: Preparing level "world"
[13:21:06] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:worldgen/biome]: ResourceKey[minecraft:worldgen/biome / minecraft:cherry_grove]
	at net.minecraft.core.Registry.getHolderOrThrow(Registry.java:162) ~[folia-1.19.4.jar:git-Folia-22]
	at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
	at net.minecraft.core.Registry.getHolderOrThrow(Registry.java:162) ~[folia-1.19.4.jar:git-Folia-22]
	at org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock.biomeToBiomeBase(CraftBlock.java:407) ~[folia-1.19.4.jar:git-Folia-22]
	at org.bukkit.craftbukkit.v1_19_R3.generator.CustomWorldChunkManager.biomeListToBiomeBaseList(CustomWorldChunkManager.java:28) ~[folia-1.19.4.jar:git-Folia-22]
	at org.bukkit.craftbukkit.v1_19_R3.generator.CustomWorldChunkManager.b(CustomWorldChunkManager.java:55) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.world.level.biome.BiomeSource.d(BiomeSource.java:29) ~[?:?]
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:183) ~[guava-31.1-jre.jar:?]
	at net.minecraft.world.level.biome.BiomeSource.possibleBiomes(BiomeSource.java:40) ~[?:?]
	at net.minecraft.world.level.chunk.ChunkGeneratorStructureState.hasBiomesForStructureSet(ChunkGeneratorStructureState.java:157) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.world.level.chunk.ChunkGeneratorStructureState.lambda$createForNormal$1(ChunkGeneratorStructureState.java:65) ~[folia-1.19.4.jar:git-Folia-22]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) ~[?:?]
	at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
	at net.minecraft.world.level.chunk.ChunkGeneratorStructureState.createForNormal(ChunkGeneratorStructureState.java:66) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.world.level.chunk.ChunkGenerator.createState(ChunkGenerator.java:106) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.level.ChunkMap.<init>(ChunkMap.java:305) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.level.ServerChunkCache.<init>(ServerChunkCache.java:276) ~[?:?]
	at net.minecraft.server.level.ServerLevel.<init>(ServerLevel.java:645) ~[?:?]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:616) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:465) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1191) ~[folia-1.19.4.jar:git-Folia-22]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:348) ~[folia-1.19.4.jar:git-Folia-22]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[13:21:07] [Server thread/ERROR]: This crash report has been saved to: /Users/pglanz/development/workspace/gitlab_themeinerlp_dev/onelitefeather/PlotSquared/run-folia/./crash-reports/crash-2023-04-05_13.21.07-server.txt
[13:21:07] [Region shutdown thread/INFO]: [RegionShutdownThread] Awaiting scheduler termination for 60s
[13:21:07] [Region shutdown thread/INFO]: [RegionShutdownThread] Scheduler halted
[13:21:07] [Region shutdown thread/INFO]: Stopping server

Thats the generic issue on the main branch of PS.
I prepared also already a non folia fix of it.

Comment on lines +52 to +58
if (!FoliaSupport.isFolia()) {
final WorldCreator wc = new WorldCreator(worldName);
wc.environment(World.Environment.NORMAL);
if (generator != null) {
wc.generator(generator);
wc.type(WorldType.FLAT);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue within the default branch preventing world generation atm, so this can't be tested and verified safely.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folia have not yet a API for create worlds. Before we run in issues, I removed that option for folia

return IS_FOLIA;
}

public static boolean isTickThread() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Currently

@@ -420,3 +420,4 @@ permissions:
plots.done: true
plots.continue: true
plots.middle: true
folia-supported: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format, please put this in a higher location.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change that

@TheMeinerLP
Copy link
Member Author

To testing it @NotMyFault download the FAWE jar from folia support branch PR IntellectualSites/FastAsyncWorldEdit#2171. I some issues still there. Thats very experimental

@roggy666
Copy link

Hello! Will there be further development for Folia?

@github-actions
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@WarSkyGod
Copy link

Hello, is there any new progress in folia?

@Panda260

This comment was marked as spam.

@Panda260
Copy link

hey when will this be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This PR proposes a new feature unresolved-merge-conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants