mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 01:23:44 +01:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
			6.9.0
			...
			feature/v6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 70baca7145 | ||
|   | 2a90015037 | ||
|   | f17aa377b7 | ||
|   | e159fa054d | ||
|   | 058c65e34c | ||
|   | 8608604306 | ||
|   | 8d0cc68721 | ||
|   | 2a79c0a419 | ||
|   | 90d42b8b9f | 
							
								
								
									
										4
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							| @@ -27,12 +27,14 @@ body: | ||||
|       description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first. | ||||
|       multiple: false | ||||
|       options: | ||||
|         - '1.19' | ||||
|         - '1.18.2' | ||||
|         - '1.18.1' | ||||
|         - '1.18' | ||||
|         - '1.17.1' | ||||
|         - '1.16.5' | ||||
|         - '1.15.2' | ||||
|         - '1.14.4' | ||||
|         - '1.13.2' | ||||
|     validations: | ||||
|       required: true | ||||
|  | ||||
|   | ||||
| @@ -270,7 +270,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|  | ||||
|         final PlotSquared plotSquared = new PlotSquared(this, "Bukkit"); | ||||
|  | ||||
|         // FastAsyncWorldEdit | ||||
|         // FAWE | ||||
|         if (Settings.FAWE_Components.FAWE_HOOK) { | ||||
|             Plugin fawe = getServer().getPluginManager().getPlugin("FastAsyncWorldEdit"); | ||||
|             if (fawe != null) { | ||||
| @@ -278,7 +278,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|                     Class.forName("com.fastasyncworldedit.bukkit.regions.plotsquared.FaweQueueCoordinator"); | ||||
|                     faweHook = true; | ||||
|                 } catch (Exception ignored) { | ||||
|                     LOGGER.error("Incompatible version of FastAsyncWorldEdit to enable hook, please upgrade: https://ci.athion" + | ||||
|                     LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" + | ||||
|                             ".net/job/FastAsyncWorldEdit/"); | ||||
|                 } | ||||
|             } | ||||
| @@ -432,7 +432,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|  | ||||
|         plotSquared.startExpiryTasks(); | ||||
|  | ||||
|         // Once the server has loaded force updating all generators known to PlotSquared | ||||
|         // Once the server has loaded force updating all generators known to P2 | ||||
|         TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L)); | ||||
|  | ||||
|         // Services are accessed in order | ||||
|   | ||||
| @@ -46,7 +46,7 @@ final class BlockStatePopulator extends BlockPopulator { | ||||
|     private final IndependentPlotGenerator plotGenerator; | ||||
|  | ||||
|     /** | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     public BlockStatePopulator( | ||||
|             final @NonNull IndependentPlotGenerator plotGenerator | ||||
| @@ -57,7 +57,7 @@ final class BlockStatePopulator extends BlockPopulator { | ||||
|     /** | ||||
|      * @deprecated Use {@link BlockStatePopulator#BlockStatePopulator(IndependentPlotGenerator)} as plotAreManager is unused | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public BlockStatePopulator( | ||||
|             final @NonNull IndependentPlotGenerator plotGenerator, | ||||
|             final @NonNull PlotAreaManager plotAreaManager | ||||
|   | ||||
| @@ -116,7 +116,30 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap | ||||
|     @Override | ||||
|     public @NonNull List<BlockPopulator> getDefaultPopulators(@NonNull World world) { | ||||
|         try { | ||||
|             checkLoaded(world); | ||||
|             if (!this.loaded) { | ||||
|                 String name = world.getName(); | ||||
|                 PlotSquared.get().loadWorld(name, this); | ||||
|                 final Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(name); | ||||
|                 if (!areas.isEmpty()) { | ||||
|                     PlotArea area = areas.iterator().next(); | ||||
|                     if (!area.isMobSpawning()) { | ||||
|                         if (!area.isSpawnEggs()) { | ||||
|                             world.setSpawnFlags(false, false); | ||||
|                         } | ||||
|                         world.setAmbientSpawnLimit(0); | ||||
|                         world.setAnimalSpawnLimit(0); | ||||
|                         world.setMonsterSpawnLimit(0); | ||||
|                         world.setWaterAnimalSpawnLimit(0); | ||||
|                     } else { | ||||
|                         world.setSpawnFlags(true, true); | ||||
|                         world.setAmbientSpawnLimit(-1); | ||||
|                         world.setAnimalSpawnLimit(-1); | ||||
|                         world.setMonsterSpawnLimit(-1); | ||||
|                         world.setWaterAnimalSpawnLimit(-1); | ||||
|                     } | ||||
|                 } | ||||
|                 this.loaded = true; | ||||
|             } | ||||
|         } catch (Exception e) { | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
| @@ -135,39 +158,6 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap | ||||
|         return toAdd; | ||||
|     } | ||||
|  | ||||
|     private synchronized void checkLoaded(@NonNull World world) { | ||||
|         // Do not attempt to load configurations until WorldEdit has a platform ready. | ||||
|         if (!PlotSquared.get().isWeInitialised()) { | ||||
|             return; | ||||
|         } | ||||
|         if (!this.loaded) { | ||||
|             String name = world.getName(); | ||||
|             PlotSquared.get().loadWorld(name, this); | ||||
|             final Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(name); | ||||
|             if (!areas.isEmpty()) { | ||||
|                 PlotArea area = areas.iterator().next(); | ||||
|                 if (!area.isMobSpawning()) { | ||||
|                     if (!area.isSpawnEggs()) { | ||||
|                         world.setSpawnFlags(false, false); | ||||
|                     } | ||||
|                     setSpawnLimits(world, 0); | ||||
|                 } else { | ||||
|                     world.setSpawnFlags(true, true); | ||||
|                     setSpawnLimits(world, -1); | ||||
|                 } | ||||
|             } | ||||
|             this.loaded = true; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @SuppressWarnings("deprecation") | ||||
|     private void setSpawnLimits(@NonNull World world, int limit) { | ||||
|         world.setAmbientSpawnLimit(limit); | ||||
|         world.setAnimalSpawnLimit(limit); | ||||
|         world.setMonsterSpawnLimit(limit); | ||||
|         world.setWaterAnimalSpawnLimit(limit); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public @NonNull ChunkData generateChunkData( | ||||
|             @NonNull World world, @NonNull Random random, int x, int z, | ||||
| @@ -214,7 +204,9 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap | ||||
|     private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) { | ||||
|         // Load if improperly loaded | ||||
|         if (!this.loaded) { | ||||
|             checkLoaded(world); | ||||
|             String name = world.getName(); | ||||
|             PlotSquared.get().loadWorld(name, this); | ||||
|             this.loaded = true; | ||||
|         } | ||||
|         // Process the chunk | ||||
|         if (ChunkManager.preProcessChunk(loc, result)) { | ||||
|   | ||||
| @@ -49,7 +49,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator { | ||||
|     private final IndependentPlotGenerator plotGenerator; | ||||
|  | ||||
|     /** | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     public LegacyBlockStatePopulator( | ||||
|             final @NonNull IndependentPlotGenerator plotGenerator | ||||
|   | ||||
| @@ -965,12 +965,7 @@ public class BlockEventListener implements Listener { | ||||
|     public void onBlockDispense(BlockDispenseEvent event) { | ||||
|         Material type = event.getItem().getType(); | ||||
|         switch (type.toString()) { | ||||
|             case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX", | ||||
|                     "YELLOW_SHULKER_BOX", "LIME_SHULKER_BOX", "PINK_SHULKER_BOX", "GRAY_SHULKER_BOX", "LIGHT_GRAY_SHULKER_BOX", | ||||
|                     "CYAN_SHULKER_BOX", "PURPLE_SHULKER_BOX", "BLUE_SHULKER_BOX", "BROWN_SHULKER_BOX", "GREEN_SHULKER_BOX", | ||||
|                     "RED_SHULKER_BOX", "BLACK_SHULKER_BOX", "CARVED_PUMPKIN", "WITHER_SKELETON_SKULL", "FLINT_AND_STEEL", | ||||
|                     "BONE_MEAL", "SHEARS", "GLASS_BOTTLE", "GLOWSTONE", "COD_BUCKET", "PUFFERFISH_BUCKET", "SALMON_BUCKET", | ||||
|                     "TROPICAL_FISH_BUCKET", "AXOLOTL_BUCKET", "BUCKET", "WATER_BUCKET", "LAVA_BUCKET", "TADPOLE_BUCKET" -> { | ||||
|             case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX", "YELLOW_SHULKER_BOX", "LIME_SHULKER_BOX", "PINK_SHULKER_BOX", "GRAY_SHULKER_BOX", "LIGHT_GRAY_SHULKER_BOX", "CYAN_SHULKER_BOX", "PURPLE_SHULKER_BOX", "BLUE_SHULKER_BOX", "BROWN_SHULKER_BOX", "GREEN_SHULKER_BOX", "RED_SHULKER_BOX", "BLACK_SHULKER_BOX", "CARVED_PUMPKIN", "WITHER_SKELETON_SKULL", "FLINT_AND_STEEL", "BONE_MEAL", "SHEARS", "GLASS_BOTTLE", "GLOWSTONE", "COD_BUCKET", "PUFFERFISH_BUCKET", "SALMON_BUCKET", "TROPICAL_FISH_BUCKET", "AXOLOTL_BUCKET", "BUCKET", "WATER_BUCKET", "LAVA_BUCKET" -> { | ||||
|                 if (event.getBlock().getType() == Material.DROPPER) { | ||||
|                     return; | ||||
|                 } | ||||
|   | ||||
| @@ -208,7 +208,7 @@ public class EntityEventListener implements Listener { | ||||
|             } | ||||
|             return; | ||||
|         } | ||||
|         if (BukkitEntityUtil.checkEntity(entity, plot.getBasePlot(false))) { | ||||
|         if (BukkitEntityUtil.checkEntity(entity, plot)) { | ||||
|             event.setCancelled(true); | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -92,9 +92,9 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator { | ||||
|             @Assisted final @NonNull Collection<BlockVector2> requestedChunks, | ||||
|             @Assisted final @NonNull Runnable whenDone, | ||||
|             @Assisted final @NonNull Consumer<Throwable> throwableConsumer, | ||||
|             @Assisted("unloadAfter") final boolean unloadAfter, | ||||
|             @Assisted final boolean unloadAfter, | ||||
|             @Assisted final @NonNull Collection<ProgressSubscriber> progressSubscribers, | ||||
|             @Assisted("forceSync") final boolean forceSync | ||||
|             @Assisted final boolean forceSync | ||||
|     ) { | ||||
|         this.requestedChunks = new LinkedBlockingQueue<>(requestedChunks); | ||||
|         this.availableChunks = new LinkedBlockingQueue<>(); | ||||
|   | ||||
| @@ -235,7 +235,6 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { | ||||
|                         .withConsumer(consumer) | ||||
|                         .unloadAfter(isUnloadAfter()) | ||||
|                         .withProgressSubscribers(getProgressSubscribers()) | ||||
|                         .forceSync(isForceSync()) | ||||
|                         .build(); | ||||
|         return super.enqueue(); | ||||
|     } | ||||
|   | ||||
| @@ -110,7 +110,7 @@ public class GenChunk extends ScopedQueueCoordinator { | ||||
|     /** | ||||
|      * Set the world and XZ of the chunk being represented via {@link ChunkWrapper} | ||||
|      * | ||||
|      * @param wrap PlotSquared ChunkWrapper | ||||
|      * @param wrap P2 ChunkWrapper | ||||
|      */ | ||||
|     public void setChunk(@NonNull ChunkWrapper wrap) { | ||||
|         chunk = null; | ||||
|   | ||||
| @@ -44,7 +44,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
| /** | ||||
|  * Wraps a {@link LimitedRegion} inside a {@link com.plotsquared.core.queue.QueueCoordinator} so it can be written to. | ||||
|  * | ||||
|  * @since 6.9.0 | ||||
|  * @since TODO | ||||
|  */ | ||||
| public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator { | ||||
|  | ||||
| @@ -53,7 +53,7 @@ public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator { | ||||
|     private final LimitedRegion limitedRegion; | ||||
|  | ||||
|     /** | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     public LimitedRegionWrapperQueue(LimitedRegion limitedRegion) { | ||||
|         super(null); | ||||
|   | ||||
| @@ -63,7 +63,7 @@ public class StateWrapper { | ||||
|      * @deprecated in favour of using WE methods for obtaining NBT, specifically by obtaining a | ||||
|      *         {@link com.sk89q.worldedit.world.block.BaseBlock} and then using {@link com.sk89q.worldedit.world.block.BaseBlock#getNbtData()} | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public StateWrapper(org.bukkit.block.BlockState state) { | ||||
|         this.state = state; | ||||
|     } | ||||
| @@ -267,7 +267,7 @@ public class StateWrapper { | ||||
|      * @deprecated in favour of using WorldEdit methods for obtaining NBT, specifically by obtaining a | ||||
|      *         {@link com.sk89q.worldedit.world.block.BaseBlock} and then using {@link com.sk89q.worldedit.world.block.BaseBlock#getNbtData()} | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public CompoundTag getTag() { | ||||
|         if (this.tag != null) { | ||||
|             return this.tag; | ||||
|   | ||||
| @@ -359,9 +359,9 @@ public interface PlotPlatform<P> extends LocaleHolder { | ||||
|     @NonNull String toLegacyPlatformString(@NonNull Component component); | ||||
|  | ||||
|     /** | ||||
|      * Returns if the FastAsyncWorldEdit-PlotSquared hook is active/enabled | ||||
|      * Returns if the FAWE-P2 hook is active/enabled | ||||
|      * | ||||
|      * @return status of FastAsyncWorldEdit-PlotSquared hook | ||||
|      * @return status of FAWE-P2 hook | ||||
|      */ | ||||
|     default boolean isFaweHooking() { | ||||
|         return false; | ||||
|   | ||||
| @@ -72,10 +72,7 @@ import com.plotsquared.core.util.ReflectionUtils; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import com.plotsquared.core.uuid.UUIDPipeline; | ||||
| import com.sk89q.worldedit.WorldEdit; | ||||
| import com.sk89q.worldedit.event.platform.PlatformReadyEvent; | ||||
| import com.sk89q.worldedit.math.BlockVector2; | ||||
| import com.sk89q.worldedit.util.eventbus.EventHandler; | ||||
| import com.sk89q.worldedit.util.eventbus.Subscribe; | ||||
| import org.apache.logging.log4j.LogManager; | ||||
| import org.apache.logging.log4j.Logger; | ||||
| import org.checkerframework.checker.nullness.qual.MonotonicNonNull; | ||||
| @@ -156,8 +153,6 @@ public class PlotSquared { | ||||
|     private EventDispatcher eventDispatcher; | ||||
|     private PlotListener plotListener; | ||||
|  | ||||
|     private boolean weInitialised; | ||||
|  | ||||
|     /** | ||||
|      * Initialize PlotSquared with the desired Implementation class. | ||||
|      * | ||||
| @@ -228,7 +223,6 @@ public class PlotSquared { | ||||
|             } | ||||
|  | ||||
|             this.worldedit = WorldEdit.getInstance(); | ||||
|             WorldEdit.getInstance().getEventBus().register(new WEPlatformReadyListener()); | ||||
|  | ||||
|             // Create Event utility class | ||||
|             this.eventDispatcher = new EventDispatcher(this.worldedit); | ||||
| @@ -1580,13 +1574,6 @@ public class PlotSquared { | ||||
|         return this.plotListener; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get if the {@link PlatformReadyEvent} has been sent by WorldEdit. There is no way to query this within WorldEdit itself. | ||||
|      */ | ||||
|     public boolean isWeInitialised() { | ||||
|         return weInitialised; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Different ways of sorting {@link Plot plots} | ||||
|      */ | ||||
| @@ -1609,15 +1596,4 @@ public class PlotSquared { | ||||
|         DISTANCE_FROM_ORIGIN | ||||
|     } | ||||
|  | ||||
|     private final class WEPlatformReadyListener { | ||||
|  | ||||
|         @SuppressWarnings("unused") | ||||
|         @Subscribe(priority = EventHandler.Priority.VERY_EARLY) | ||||
|         public void onPlatformReady(PlatformReadyEvent event) { | ||||
|             weInitialised = true; | ||||
|             WorldEdit.getInstance().getEventBus().unregister(WEPlatformReadyListener.this); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -62,7 +62,7 @@ public class Music extends SubCommand { | ||||
|             .asList("music_disc_13", "music_disc_cat", "music_disc_blocks", "music_disc_chirp", | ||||
|                     "music_disc_far", "music_disc_mall", "music_disc_mellohi", "music_disc_stal", | ||||
|                     "music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait", "music_disc_otherside", | ||||
|                     "music_disc_pigstep", "music_disc_5" | ||||
|                     "music_disc_pigstep" | ||||
|             ); | ||||
|  | ||||
|     private final InventoryUtil inventoryUtil; | ||||
|   | ||||
| @@ -44,7 +44,7 @@ public class Settings extends Config { | ||||
|  | ||||
|     @Comment("This value is not configurable. It shows the platform you are using.") // This is a comment | ||||
|     @Final | ||||
|     public static String PLATFORM; // These values are set from PlotSquared before loading | ||||
|     public static String PLATFORM; // These values are set from P2 before loading | ||||
|  | ||||
|     @Comment({"Show additional information in console. It helps us at IntellectualSites to find out more about an issue.", | ||||
|             "Leave it off if you don't need it, it can spam your console."}) | ||||
| @@ -634,10 +634,10 @@ public class Settings extends Config { | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Comment("Enable or disable all of or parts of the FastAsyncWorldEdit-PlotSquared hook") | ||||
|     @Comment("Enable or disable all of or parts of the FAWE-P2 hook") | ||||
|     public static final class FAWE_Components { | ||||
|  | ||||
|         @Comment("Use FastAsyncWorldEdit for queue handling.") | ||||
|         @Comment("Use FAWE for queue handling.") | ||||
|         public static boolean FAWE_HOOK = true; | ||||
|         public static boolean CUBOIDS = true; | ||||
|         public static boolean CLEAR = true; | ||||
|   | ||||
| @@ -388,7 +388,7 @@ public class HybridGen extends IndependentPlotGenerator { | ||||
|      * Wrapper to allow a WorldEdit {@link Entity} to effectively have a mutable location as the location in its NBT should be changed | ||||
|      * when set to the world. | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     private static final class PopulatingEntity implements Entity { | ||||
|  | ||||
| @@ -396,7 +396,7 @@ public class HybridGen extends IndependentPlotGenerator { | ||||
|         private com.sk89q.worldedit.util.Location location; | ||||
|  | ||||
|         /** | ||||
|          * @since 6.9.0 | ||||
|          * @since TODO | ||||
|          */ | ||||
|         private PopulatingEntity(Entity parent, com.sk89q.worldedit.util.Location location) { | ||||
|             this.parent = parent; | ||||
|   | ||||
| @@ -75,7 +75,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|     private static final AffineTransform transform = new AffineTransform().rotateY(90); | ||||
|     public boolean ROAD_SCHEMATIC_ENABLED; | ||||
|     public boolean PLOT_SCHEMATIC = false; | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public int PLOT_SCHEMATIC_HEIGHT = -1; | ||||
|     public short PATH_WIDTH_LOWER; | ||||
|     public short PATH_WIDTH_UPPER; | ||||
| @@ -108,7 +108,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|         PlotSquared.platform().injector().injectMembers(this); | ||||
|     } | ||||
|  | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public static byte wrap(byte data, int start) { | ||||
|         if ((data >= start) && (data < (start + 4))) { | ||||
|             data = (byte) ((((data - start) + 2) & 3) + start); | ||||
| @@ -116,7 +116,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|         return data; | ||||
|     } | ||||
|  | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public static byte wrap2(byte data, int start) { | ||||
|         if ((data >= start) && (data < (start + 2))) { | ||||
|             data = (byte) ((((data - start) + 1) & 1) + start); | ||||
| @@ -493,7 +493,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|     /** | ||||
|      * Get the entities contained within the plot schematic for generation. Intended for internal use only. | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") | ||||
|     public @Nullable List<Entity> getPlotSchematicEntities() { | ||||
| @@ -503,7 +503,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|     /** | ||||
|      * Get the minimum point of the plot schematic for generation. Intended for internal use only. | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") | ||||
|     public @Nullable BlockVector3 getPlotSchematicMinPoint() { | ||||
| @@ -513,7 +513,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|     /** | ||||
|      * Get if post-generation population of chunks with tiles/entities is needed for this world. Not for public API use. | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") | ||||
|     public boolean populationNeeded() { | ||||
| @@ -523,7 +523,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|     /** | ||||
|      * @deprecated in favour of {@link HybridPlotWorld#getSchematicRoot()} | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public File getRoot() { | ||||
|         return this.root; | ||||
|     } | ||||
| @@ -532,7 +532,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|      * Get the root folder for this world's generation schematics. May be null if schematics not initialised via | ||||
|      * {@link HybridPlotWorld#setupSchematics()} | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     public @Nullable File getSchematicRoot() { | ||||
|         return this.root; | ||||
|   | ||||
| @@ -53,7 +53,7 @@ public abstract class IndependentPlotGenerator { | ||||
|      * @param settings PlotArea (settings) | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public abstract void generateChunk(ScopedQueueCoordinator result, PlotArea settings); | ||||
|  | ||||
|     /** | ||||
| @@ -64,7 +64,7 @@ public abstract class IndependentPlotGenerator { | ||||
|      * @return True if any population occurred | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public boolean populateChunk(ScopedQueueCoordinator result, PlotArea settings) { | ||||
|         return false; | ||||
|     } | ||||
|   | ||||
| @@ -25,7 +25,6 @@ | ||||
|  */ | ||||
| package com.plotsquared.core.inject.factory; | ||||
|  | ||||
| import com.google.inject.assistedinject.Assisted; | ||||
| import com.plotsquared.core.queue.ChunkCoordinator; | ||||
| import com.plotsquared.core.queue.subscriber.ProgressSubscriber; | ||||
| import com.sk89q.worldedit.math.BlockVector2; | ||||
| @@ -45,9 +44,8 @@ public interface ChunkCoordinatorFactory { | ||||
|             final @NonNull Collection<BlockVector2> requestedChunks, | ||||
|             final @NonNull Runnable whenDone, | ||||
|             final @NonNull Consumer<Throwable> throwableConsumer, | ||||
|             @Assisted("unloadAfter") final boolean unloadAfter, | ||||
|             final @NonNull Collection<ProgressSubscriber> progressSubscribers, | ||||
|             @Assisted("forceSync") final boolean forceSync | ||||
|             final boolean unloadAfter, | ||||
|             final @NonNull Collection<ProgressSubscriber> progressSubscribers | ||||
|     ); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -49,7 +49,7 @@ public sealed class Location extends BlockLoc implements Comparable<Location> pe | ||||
|     private final World<?> world; | ||||
|  | ||||
|     /** | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     protected Location( | ||||
|             final @NonNull World<?> world, final @NonNull BlockVector3 blockVector3, | ||||
|   | ||||
| @@ -33,7 +33,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  * Used internally for generation to reference locations in worlds that "don't exist yet". There is no guarantee that the world | ||||
|  * name provided by {@link UncheckedWorldLocation#getWorldName()} exists on the server. | ||||
|  * | ||||
|  * @since 6.9.0 | ||||
|  * @since TODO | ||||
|  */ | ||||
| @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") | ||||
| public final class UncheckedWorldLocation extends Location { | ||||
| @@ -41,7 +41,7 @@ public final class UncheckedWorldLocation extends Location { | ||||
|     private final String worldName; | ||||
|  | ||||
|     /** | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     private UncheckedWorldLocation( | ||||
|             final @NonNull String worldName, final int x, final int y, final int z | ||||
| @@ -59,7 +59,7 @@ public final class UncheckedWorldLocation extends Location { | ||||
|      * @param z     Z coordinate | ||||
|      * @return New location | ||||
|      * | ||||
|      * @since 6.9.0 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") | ||||
|     public static @NonNull UncheckedWorldLocation at( | ||||
|   | ||||
| @@ -65,6 +65,7 @@ import com.sk89q.worldedit.world.biome.BiomeType; | ||||
| import com.sk89q.worldedit.world.biome.BiomeTypes; | ||||
| import com.sk89q.worldedit.world.gamemode.GameMode; | ||||
| import com.sk89q.worldedit.world.gamemode.GameModes; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.kyori.adventure.text.minimessage.MiniMessage; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| import org.apache.logging.log4j.LogManager; | ||||
| @@ -964,31 +965,7 @@ public abstract class PlotArea { | ||||
|         return this.plots.remove(id) != null; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Merge a list of plots together. This is non-blocking for the world-changes that will be made. To run a task when the | ||||
|      * world changes are complete, use {@link PlotArea#mergePlots(List, boolean, Runnable)}; | ||||
|      * | ||||
|      * @param plotIds     List of plot IDs to merge | ||||
|      * @param removeRoads If the roads between plots should be removed | ||||
|      * @return if merges were completed successfully. | ||||
|      */ | ||||
|     public boolean mergePlots(final @NonNull List<PlotId> plotIds, final boolean removeRoads) { | ||||
|         return mergePlots(plotIds, removeRoads, null); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Merge a list of plots together. This is non-blocking for the world-changes that will be made. | ||||
|      * | ||||
|      * @param plotIds     List of plot IDs to merge | ||||
|      * @param removeRoads If the roads between plots should be removed | ||||
|      * @param whenDone  Task to run when any merge world changes are complete. Also runs if no changes were made. Does not | ||||
|      *                    run if there was an error or if too few plots IDs were supplied. | ||||
|      * @return if merges were completed successfully. | ||||
|      * @since 6.9.0 | ||||
|      */ | ||||
|     public boolean mergePlots( | ||||
|             final @NonNull List<PlotId> plotIds, final boolean removeRoads, final @Nullable Runnable whenDone | ||||
|     ) { | ||||
|         if (plotIds.size() < 2) { | ||||
|             return false; | ||||
|         } | ||||
| @@ -1051,9 +1028,6 @@ public abstract class PlotArea { | ||||
|             } | ||||
|         } | ||||
|         manager.finishPlotMerge(plotIds, queue); | ||||
|         if (whenDone != null) { | ||||
|             queue.setCompleteTask(whenDone); | ||||
|         } | ||||
|         queue.enqueue(); | ||||
|         return true; | ||||
|     } | ||||
| @@ -1405,7 +1379,7 @@ public abstract class PlotArea { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the min height from which PlotSquared will generate blocks. Inclusive. | ||||
|      * Get the min height from which P2 will generate blocks. Inclusive. | ||||
|      * | ||||
|      * @since 6.6.0 | ||||
|      */ | ||||
| @@ -1414,7 +1388,7 @@ public abstract class PlotArea { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the max height to which PlotSquared will generate blocks. Inclusive. | ||||
|      * Get the max height to which P2 will generate blocks. Inclusive. | ||||
|      * | ||||
|      * @since 6.6.0 | ||||
|      */ | ||||
|   | ||||
| @@ -44,7 +44,7 @@ public enum PlotAreaTerrainType { | ||||
|     ORE, | ||||
|  | ||||
|     /** | ||||
|      * Generate everything using the vanilla generator but with PlotSquared roads. | ||||
|      * Generate everything using the vanilla generator but with PS roads. | ||||
|      */ | ||||
|     ROAD, | ||||
|  | ||||
|   | ||||
| @@ -43,7 +43,7 @@ public abstract class ListFlag<V, F extends PlotFlag<List<V>, F>> extends PlotFl | ||||
|     @Override | ||||
|     public F merge(@NonNull List<V> newValue) { | ||||
|         final List<V> mergedList = new ArrayList<>(); | ||||
|         // If a server already used PlotSquared before this fix, we remove all present duplicates on an eventual merge | ||||
|         // If a server already used PS before this fix, we remove all present duplicates on an eventual merge | ||||
|         for (final V v : getValue()) { | ||||
|             if (!mergedList.contains(v)) { | ||||
|                 mergedList.add(v); | ||||
|   | ||||
| @@ -58,7 +58,6 @@ public class ChunkCoordinatorBuilder { | ||||
|     private long maxIterationTime = Settings.QUEUE.MAX_ITERATION_TIME; // A little over 1 tick; | ||||
|     private int initialBatchSize = Settings.QUEUE.INITIAL_BATCH_SIZE; | ||||
|     private boolean unloadAfter = true; | ||||
|     private boolean forceSync = false; | ||||
|  | ||||
|     @Inject | ||||
|     public ChunkCoordinatorBuilder(@NonNull ChunkCoordinatorFactory chunkCoordinatorFactory) { | ||||
| @@ -198,18 +197,6 @@ public class ChunkCoordinatorBuilder { | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set whether the chunks coordinator should be forced to be synchronous. This is not necessarily synchronous to the server, | ||||
|      * and simply effectively makes {@link ChunkCoordinator#start()} ()} a blocking operation. | ||||
|      * | ||||
|      * @param forceSync force sync or not | ||||
|      * @since 6.9.0 | ||||
|      */ | ||||
|     public @NonNull ChunkCoordinatorBuilder forceSync(final boolean forceSync) { | ||||
|         this.forceSync = forceSync; | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     public @NonNull ChunkCoordinatorBuilder withProgressSubscriber(ProgressSubscriber progressSubscriber) { | ||||
|         this.progressSubscribers.add(progressSubscriber); | ||||
|         return this; | ||||
| @@ -240,8 +227,7 @@ public class ChunkCoordinatorBuilder { | ||||
|                         this.whenDone, | ||||
|                         this.throwableConsumer, | ||||
|                         this.unloadAfter, | ||||
|                         this.progressSubscribers, | ||||
|                         this.forceSync | ||||
|                         this.progressSubscribers | ||||
|                 ); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -39,7 +39,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; | ||||
|  * Queue that is limited to a single chunk. It does not allow a delegate queue and should be treated as a cache for changes to | ||||
|  * be set to. Does not support tile entities or entities. | ||||
|  * | ||||
|  * @deprecated This class is poorly designed and will no longer be used in PlotSquared | ||||
|  * @deprecated This class is poorly designed and will no longer be used in P2 | ||||
|  */ | ||||
| @Deprecated(forRemoval = true, since = "6.8.0") | ||||
| public class ChunkQueueCoordinator extends ScopedQueueCoordinator { | ||||
|   | ||||
| @@ -40,12 +40,14 @@ import com.sk89q.worldedit.world.World; | ||||
| import com.sk89q.worldedit.world.biome.BiomeType; | ||||
| import com.sk89q.worldedit.world.block.BaseBlock; | ||||
| import com.sk89q.worldedit.world.block.BlockState; | ||||
|  | ||||
| import java.util.concurrent.atomic.AtomicBoolean; | ||||
|  | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
| import org.checkerframework.checker.nullness.qual.Nullable; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Set; | ||||
| import java.util.concurrent.atomic.AtomicBoolean; | ||||
| import java.util.function.Consumer; | ||||
|  | ||||
| public abstract class QueueCoordinator { | ||||
| @@ -93,7 +95,7 @@ public abstract class QueueCoordinator { | ||||
|      * @since 6.6.0 | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public ScopedQueueCoordinator getForChunk(int x, int z, int minY, int maxY) { | ||||
|         int bx = x << 4; | ||||
|         int bz = z << 4; | ||||
| @@ -117,8 +119,7 @@ public abstract class QueueCoordinator { | ||||
|     public abstract void setModified(long modified); | ||||
|  | ||||
|     /** | ||||
|      * Returns true if the queue should be forced to be synchronous when enqueued. This is not necessarily synchronous to the | ||||
|      * server, and simply effectively makes {@link QueueCoordinator#enqueue()} a blocking operation. | ||||
|      * Returns true if the queue should be forced to be synchronous when enqueued. | ||||
|      * | ||||
|      * @return is force sync | ||||
|      */ | ||||
| @@ -127,8 +128,7 @@ public abstract class QueueCoordinator { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set whether the queue should be forced to be synchronous. This is not necessarily synchronous to the server, and simply | ||||
|      * effectively makes {@link QueueCoordinator#enqueue()} a blocking operation. | ||||
|      * Set whether the queue should be forced to be synchronous | ||||
|      * | ||||
|      * @param forceSync force sync or not | ||||
|      */ | ||||
|   | ||||
| @@ -45,7 +45,7 @@ public abstract class ChunkManager { | ||||
|     /** | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public static void setChunkInPlotArea( | ||||
|             RunnableVal<ScopedQueueCoordinator> force, | ||||
|             RunnableVal<ScopedQueueCoordinator> add, | ||||
| @@ -86,7 +86,7 @@ public abstract class ChunkManager { | ||||
|     /** | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public static boolean preProcessChunk(BlockVector2 loc, ScopedQueueCoordinator queue) { | ||||
|         final RunnableVal<ScopedQueueCoordinator> forceChunk = forceChunks.get(loc); | ||||
|         if (forceChunk != null) { | ||||
| @@ -100,7 +100,7 @@ public abstract class ChunkManager { | ||||
|     /** | ||||
|      * @deprecated {@link ScopedQueueCoordinator} will be renamed in v7. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.0") | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public static boolean postProcessChunk(BlockVector2 loc, ScopedQueueCoordinator queue) { | ||||
|         final RunnableVal<ScopedQueueCoordinator> addChunk = forceChunks.get(loc); | ||||
|         if (addChunk != null) { | ||||
|   | ||||
| @@ -174,7 +174,7 @@ public abstract class RegionManager { | ||||
|      * @param whenDone task to run when complete | ||||
|      * @param manager  plot manager | ||||
|      * @param actor    the player running the clear | ||||
|      * @return {@code true} if the clear worked. {@code false} if someone went wrong so PlotSquared can then handle the clear | ||||
|      * @return {@code true} if the clear worked. {@code false} if someone went wrong so P2 can then handle the clear | ||||
|      */ | ||||
|     public abstract boolean handleClear( | ||||
|             @NonNull Plot plot, | ||||
|   | ||||
| @@ -109,7 +109,7 @@ public class RegionUtil { | ||||
|         return new Rectangle2D.Double(min.getX(), min.getZ(), max.getX(), max.getZ()); | ||||
|     } | ||||
|  | ||||
|     // Because WorldEdit (not FastAsyncWorldEdit) lack this for CuboidRegion | ||||
|     // Because WE (not fawe) lack this for CuboidRegion | ||||
|     public static boolean intersects(CuboidRegion region, CuboidRegion other) { | ||||
|         BlockVector3 regionMin = region.getMinimumPoint(); | ||||
|         BlockVector3 regionMax = region.getMaximumPoint(); | ||||
|   | ||||
| @@ -167,7 +167,7 @@ public final class TabCompletions { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get a list of completions corresponding to WorldEdit(/FastAsyncWorldEdit) patterns. This uses | ||||
|      * Get a list of completions corresponding to WorldEdit(/FAWE) patterns. This uses | ||||
|      * WorldEdit's pattern completer internally. | ||||
|      * | ||||
|      * @param input Command input | ||||
|   | ||||
							
								
								
									
										29
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | ||||
| <p align="center"> | ||||
|     <img src="https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.svg" width="250"> | ||||
|     <img src="https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.svg" width="300"> | ||||
| </p> | ||||
|  | ||||
| --- | ||||
| @@ -41,20 +41,15 @@ is to provide a lag-free and smooth experience. | ||||
| * [Plot2Dynmap](http://www.spigotmc.org/resources/plot2dynmap.1292/) | ||||
| * [HoloPlots](https://www.spigotmc.org/resources/holoplots.4880/) | ||||
| * [PlotHider](https://www.spigotmc.org/resources/plot-hider.20701/) | ||||
| ### Unmaintained or integrated into PlotSquared   | ||||
| * [AdvPlots](http://www.spigotmc.org/resources/advplots-%CE%B2.1500/) | ||||
| * [PlotRankup](http://www.spigotmc.org/resources/plotrankup.1571/) | ||||
| * [PlotZSux](https://www.spigotmc.org/resources/plotzsux.9563/) | ||||
| * [IslandPlots](https://www.spigotmc.org/resources/islandplots.9421/) | ||||
| * [BiomeGenerator](https://www.spigotmc.org/resources/biomegenerator.1663/) | ||||
| * [PlotSquaredMG](https://www.spigotmc.org/resources/plotsquaredmg.8025/) | ||||
| * [BasicPlots](https://www.spigotmc.org/resources/basicplots.6901/) | ||||
|  | ||||
| ### Edit The Code | ||||
|  | ||||
| Want to add new features to PlotSquared or fix bugs yourself? You can get the game running, with PlotSquared, from the code here: | ||||
|  | ||||
| For additional information about compiling PlotSquared, see [CONTRIBUTING.md](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md) | ||||
|  | ||||
| ### Submitting Your Changes | ||||
| PlotSquared is open source (specifically licensed under GPL v3), so note that your contributions will also be open source. The best way to submit a change is to create a fork on GitHub, put your changes there, and then create a "pull request" on our PlotSquared repository. | ||||
|  | ||||
| <a href="https://yourkit.com/"> | ||||
|     <img src="https://www.yourkit.com/images/yklogo.png"> | ||||
| </a> | ||||
|  | ||||
| Thank you to YourKit for supporting our product by providing us with their innovative and intelligent tools | ||||
| for monitoring and profiling Java and .NET applications. | ||||
| YourKit is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/), [YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/), and [YourKit YouMonitor](https://www.yourkit.com/youmonitor/). | ||||
| # Sponsors | ||||
| Our official sponsor list can be found [here](https://intellectualsites.github.io/download/sponsors.html). <br> | ||||
| If you are interested and want to be listed here, [contact us](https://intellectualsites.github.io/download/contact.html). | ||||
|   | ||||
| @@ -18,7 +18,7 @@ plugins { | ||||
|     idea | ||||
| } | ||||
|  | ||||
| version = "6.9.0" | ||||
| version = "6.8.2-SNAPSHOT" | ||||
|  | ||||
| allprojects { | ||||
|     group = "com.plotsquared" | ||||
|   | ||||
| @@ -13,7 +13,7 @@ | ||||
|   ], | ||||
|   "timezone": "Europe/Berlin", | ||||
|   "schedule": [ | ||||
|     "every monday" | ||||
|     "on monday after 9am" | ||||
|   ], | ||||
|   "labels": ["Renovate"], | ||||
|   "commitMessagePrefix": "build: ", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user