├── .github ├── FUNDING.yml ├── codecov.yml ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── config.yml │ └── feature_request.yml └── workflows │ ├── stale.yml │ └── gradle.yml ├── verification └── src │ └── changes │ ├── accepted-fabric-public-api-changes.json │ ├── accepted-neoforge-public-api-changes.json │ ├── accepted-sponge-public-api-changes.json │ ├── accepted-cli-public-api-changes.json │ ├── accepted-bukkit-public-api-changes.json │ └── accepted-core-public-api-changes.json ├── worldedit-libs ├── cli │ └── build.gradle.kts ├── fabric │ └── build.gradle.kts ├── sponge │ └── build.gradle.kts ├── neoforge │ └── build.gradle.kts ├── build.gradle.kts ├── bukkit │ └── build.gradle.kts ├── core │ ├── ap │ │ └── build.gradle.kts │ └── build.gradle.kts └── README.md ├── worldedit-logo.png ├── gradle ├── gradle-daemon-jvm.properties └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .git-blame-ignore-revs ├── worldedit-fabric └── src │ └── main │ ├── resources │ ├── pack.mcmeta │ ├── assets │ │ └── worldedit │ │ │ └── icon.png │ ├── worldedit-fabric.mixins.json │ ├── worldedit.accesswidener │ └── fabric.mod.json │ └── java │ └── com │ └── sk89q │ └── worldedit │ └── fabric │ └── internal │ └── ExtendedMinecraftServer.java ├── worldedit-neoforge └── src │ └── main │ ├── resources │ ├── pack.mcmeta │ ├── worldedit-icon.png │ ├── worldedit-neoforge.mixins.json │ └── META-INF │ │ ├── accesstransformer.cfg │ │ └── neoforge.mods.toml │ └── java │ └── com │ └── sk89q │ └── worldedit │ └── neoforge │ ├── mixin │ └── AccessorServerPlayerGameMode.java │ └── NeoForgeWatchdog.java ├── worldedit-core ├── src │ ├── test │ │ ├── resources │ │ │ ├── world_region.mca.gzip │ │ │ └── junit-platform.properties │ │ └── java │ │ │ └── com │ │ │ └── sk89q │ │ │ └── worldedit │ │ │ └── util │ │ │ └── test │ │ │ ├── ResourceLockKeys.java │ │ │ └── VariedVectorPair.java │ └── main │ │ └── java │ │ └── com │ │ └── sk89q │ │ ├── worldedit │ │ ├── command │ │ │ ├── argument │ │ │ │ ├── package-info.java │ │ │ │ ├── SelectorChoiceOrList.java │ │ │ │ ├── SelectorChoiceList.java │ │ │ │ └── Arguments.java │ │ │ ├── util │ │ │ │ └── HookMode.java │ │ │ ├── InsufficientArgumentsException.java │ │ │ └── tool │ │ │ │ └── Tool.java │ │ ├── util │ │ │ ├── HandSide.java │ │ │ ├── io │ │ │ │ ├── file │ │ │ │ │ ├── AttributeTarget.java │ │ │ │ │ ├── ArchiveDir.java │ │ │ │ │ ├── FileSelectionAbortedException.java │ │ │ │ │ ├── InvalidFilenameException.java │ │ │ │ │ └── ArchiveNioSupport.java │ │ │ │ └── WorldEditResourceLoader.java │ │ │ ├── report │ │ │ │ ├── Report.java │ │ │ │ ├── ConfigReport.java │ │ │ │ ├── HierarchyObjectReport.java │ │ │ │ └── Unreported.java │ │ │ ├── paste │ │ │ │ ├── PasteMetadata.java │ │ │ │ └── Paster.java │ │ │ ├── lifecycle │ │ │ │ └── Token.java │ │ │ ├── Identifiable.java │ │ │ ├── task │ │ │ │ ├── progress │ │ │ │ │ └── ProgressObservable.java │ │ │ │ ├── TaskStateComparator.java │ │ │ │ └── Supervisor.java │ │ │ ├── GuavaUtil.java │ │ │ ├── formatting │ │ │ │ └── component │ │ │ │ │ └── InvalidComponentException.java │ │ │ └── function │ │ │ │ └── IORunnable.java │ │ ├── world │ │ │ ├── snapshot │ │ │ │ ├── InvalidSnapshotException.java │ │ │ │ ├── experimental │ │ │ │ │ ├── SnapshotComparator.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── ModificationTimerParser.java │ │ │ │ └── SnapshotDateParser.java │ │ │ ├── registry │ │ │ │ ├── SimpleItemMaterial.java │ │ │ │ ├── ItemCategoryRegistry.java │ │ │ │ ├── BlockCategoryRegistry.java │ │ │ │ ├── NullItemCategoryRegistry.java │ │ │ │ ├── NullBlockCategoryRegistry.java │ │ │ │ ├── NullEntityRegistry.java │ │ │ │ └── EntityRegistry.java │ │ │ ├── storage │ │ │ │ ├── InvalidFormatException.java │ │ │ │ └── ChunkStoreException.java │ │ │ ├── DataException.java │ │ │ ├── generation │ │ │ │ ├── StructureType.java │ │ │ │ └── ConfiguredFeatureType.java │ │ │ ├── WorldUnloadedException.java │ │ │ └── chunk │ │ │ │ └── Chunk.java │ │ ├── event │ │ │ ├── Event.java │ │ │ ├── platform │ │ │ │ ├── InputType.java │ │ │ │ ├── PlatformsRegisteredEvent.java │ │ │ │ ├── PlatformInitializeEvent.java │ │ │ │ ├── Interaction.java │ │ │ │ ├── PlatformReadyEvent.java │ │ │ │ ├── PlatformUnreadyEvent.java │ │ │ │ └── PlatformEvent.java │ │ │ ├── AbstractCancellable.java │ │ │ └── Cancellable.java │ │ ├── function │ │ │ ├── Contextual.java │ │ │ ├── mask │ │ │ │ ├── AbstractMask.java │ │ │ │ ├── AbstractMask2D.java │ │ │ │ └── Mask2D.java │ │ │ ├── pattern │ │ │ │ ├── AbstractPattern.java │ │ │ │ ├── ExtentPattern.java │ │ │ │ └── AbstractExtentPattern.java │ │ │ ├── operation │ │ │ │ └── RunContext.java │ │ │ ├── EntityFunction.java │ │ │ └── RegionFunction.java │ │ ├── internal │ │ │ ├── cui │ │ │ │ ├── CUIEvent.java │ │ │ │ └── SelectionShapeEvent.java │ │ │ ├── expression │ │ │ │ ├── invoke │ │ │ │ │ └── ExecNode.java │ │ │ │ ├── CompiledExpression.java │ │ │ │ ├── ExpressionTimeoutException.java │ │ │ │ ├── ExpressionFunction.java │ │ │ │ ├── LexerErrorListener.java │ │ │ │ └── ParserErrorListener.java │ │ │ ├── wna │ │ │ │ └── package-info.java │ │ │ ├── command │ │ │ │ └── exception │ │ │ │ │ └── ExceptionMatch.java │ │ │ └── annotation │ │ │ │ ├── VertHeight.java │ │ │ │ └── Selection.java │ │ ├── EmptyClipboardException.java │ │ ├── IncompleteRegionException.java │ │ ├── MaxBrushRadiusException.java │ │ ├── extent │ │ │ ├── inventory │ │ │ │ ├── BlockBagException.java │ │ │ │ ├── OutOfBlocksException.java │ │ │ │ └── UnplaceableBlockException.java │ │ │ ├── clipboard │ │ │ │ └── io │ │ │ │ │ ├── sponge │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── share │ │ │ │ │ ├── ClipboardShareMetadata.java │ │ │ │ │ └── ShareOutputProvider.java │ │ │ │ │ └── ClipboardWriter.java │ │ │ └── reorder │ │ │ │ └── ReorderingExtent.java │ │ ├── extension │ │ │ └── platform │ │ │ │ ├── Watchdog.java │ │ │ │ ├── permission │ │ │ │ └── OverridePermissions.java │ │ │ │ ├── MultiUserPlatform.java │ │ │ │ └── Annotations.java │ │ ├── MaxRadiusException.java │ │ ├── regions │ │ │ ├── factory │ │ │ │ ├── RegionFactory.java │ │ │ │ ├── CuboidRegionFactory.java │ │ │ │ └── SphereRegionFactory.java │ │ │ ├── RegionOperationException.java │ │ │ └── AbstractFlatRegion.java │ │ ├── InvalidItemException.java │ │ ├── session │ │ │ ├── SessionOwner.java │ │ │ ├── storage │ │ │ │ └── VoidStore.java │ │ │ └── MissingSessionException.java │ │ ├── scripting │ │ │ ├── CraftScriptEngine.java │ │ │ └── MinecraftHidingClassShutter.java │ │ ├── MissingWorldException.java │ │ ├── math │ │ │ └── RegionOptimizedComparator.java │ │ └── blocks │ │ │ └── TileEntityBlock.java │ │ ├── minecraft │ │ └── util │ │ │ └── commands │ │ │ ├── UnhandledCommandException.java │ │ │ ├── package-info.java │ │ │ ├── CommandPermissionsException.java │ │ │ ├── WrappedCommandException.java │ │ │ ├── MissingNestedCommandException.java │ │ │ ├── Console.java │ │ │ ├── CommandUsageException.java │ │ │ └── CommandPermissions.java │ │ ├── util │ │ └── yaml │ │ │ ├── YAMLProcessorException.java │ │ │ └── YAMLFormat.java │ │ └── jnbt │ │ └── EndTag.java └── doctools │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── sk89q │ └── worldedit │ └── internal │ └── util │ └── DocumentationConfiguration.kt ├── worldedit-mod └── README.md ├── worldedit-bukkit ├── src │ ├── main │ │ ├── resources │ │ │ └── plugin.yml │ │ └── java │ │ │ └── com │ │ │ └── sk89q │ │ │ ├── wepif │ │ │ ├── PermissionsResolver.java │ │ │ └── WEPIFRuntimeException.java │ │ │ ├── bukkit │ │ │ └── util │ │ │ │ └── CommandInspector.java │ │ │ └── worldedit │ │ │ └── bukkit │ │ │ ├── adapter │ │ │ ├── UnsupportedVersionEditException.java │ │ │ └── AdapterLoadException.java │ │ │ └── BukkitWatchdog.java │ └── test │ │ └── java │ │ └── com │ │ └── sk89q │ │ └── worldedit │ │ └── bukkit │ │ └── BukkitWorldTest.java └── adapters │ ├── adapter-1.21.3 │ └── build.gradle.kts │ └── adapter-1.21.4 │ └── build.gradle.kts ├── gradle.properties ├── .gitignore ├── contrib └── craftscripts │ ├── SUBMITTING.md │ └── README.md ├── SECURITY.md ├── HEADER.txt ├── worldedit-cli ├── src │ └── main │ │ ├── resources │ │ └── log4j2.xml │ │ └── java │ │ └── com │ │ └── sk89q │ │ └── worldedit │ │ └── cli │ │ ├── CLIWorld.java │ │ └── CLIConfiguration.java └── build.gradle.kts ├── .gitattributes ├── config └── checkstyle │ └── checkstyle-suppression.xml ├── crowdin-distributor.sh └── worldedit-sponge └── src └── main └── java └── com └── sk89q └── worldedit └── sponge ├── Constants.java └── internal └── LocaleResolver.java /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: enginehub 2 | -------------------------------------------------------------------------------- /verification/src/changes/accepted-fabric-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /verification/src/changes/accepted-neoforge-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /verification/src/changes/accepted-sponge-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: off 4 | patch: off 5 | -------------------------------------------------------------------------------- /worldedit-libs/cli/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | -------------------------------------------------------------------------------- /worldedit-libs/fabric/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | -------------------------------------------------------------------------------- /worldedit-libs/sponge/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | -------------------------------------------------------------------------------- /worldedit-libs/neoforge/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # All files are owned by the WorldEdit team. 2 | * @EngineHub/worldedit 3 | -------------------------------------------------------------------------------- /worldedit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elenakozlova28/WorldEdit/HEAD/worldedit-logo.png -------------------------------------------------------------------------------- /gradle/gradle-daemon-jvm.properties: -------------------------------------------------------------------------------- 1 | #This file is generated by updateDaemonJvm 2 | toolchainVersion=21 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elenakozlova28/WorldEdit/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /worldedit-libs/build.gradle.kts: -------------------------------------------------------------------------------- 1 | tasks.register("build") { 2 | dependsOn(subprojects.map { it.tasks.named("build") }) 3 | } 4 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # CRLF -> LF 2 | 59ccc0a5af93d4b3d97df2bd6b946bba5a6d5c5c 3 | # Checkstyle 4 | eb52afa296fffc4397e2f4014c7eb8094f50240e 5 | -------------------------------------------------------------------------------- /worldedit-fabric/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "WorldEdit Resources", 4 | "pack_format": 8 5 | } 6 | } -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "WorldEdit Resources", 4 | "pack_format": 8 5 | } 6 | } -------------------------------------------------------------------------------- /worldedit-libs/bukkit/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | 5 | dependencies { 6 | "shade"(libs.kyoriText.adapter.bukkit) 7 | } 8 | -------------------------------------------------------------------------------- /worldedit-core/src/test/resources/world_region.mca.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elenakozlova28/WorldEdit/HEAD/worldedit-core/src/test/resources/world_region.mca.gzip -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/resources/worldedit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elenakozlova28/WorldEdit/HEAD/worldedit-neoforge/src/main/resources/worldedit-icon.png -------------------------------------------------------------------------------- /worldedit-fabric/src/main/resources/assets/worldedit/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elenakozlova28/WorldEdit/HEAD/worldedit-fabric/src/main/resources/assets/worldedit/icon.png -------------------------------------------------------------------------------- /worldedit-mod/README.md: -------------------------------------------------------------------------------- 1 | This folder is for the merged output of Fabric and Forge jars. This allows us to distribute 2 | both variants of the mod in a single file to avoid end-user confusion. 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: EngineHub Discord 4 | url: https://discord.gg/EngineHub 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: WorldEdit 2 | main: com.sk89q.worldedit.bukkit.WorldEditPlugin 3 | version: "${internalVersion}" 4 | load: STARTUP 5 | api-version: 1.21.3 6 | softdepend: [Vault] 7 | author: EngineHub 8 | website: https://enginehub.org/worldedit -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | group=com.sk89q.worldedit 2 | version=7.3.11-SNAPSHOT 3 | 4 | org.gradle.jvmargs=-Xmx1500M 5 | org.gradle.parallel=true 6 | 7 | loom_fabric_repository=https://maven.enginehub.org/artifactory/fabricmc/ 8 | loom_libraries_base=https://maven.enginehub.org/artifactory/minecraft/ 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /worldedit-libs/core/ap/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | 5 | dependencies { 6 | // These are here because they use net.kyori:text-api -- so they need to be relocated too 7 | "shade"(libs.piston.coreAp.annotations) 8 | "shade"(libs.piston.coreAp.processor) 9 | } 10 | -------------------------------------------------------------------------------- /worldedit-core/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | junit.jupiter.execution.parallel.enabled=true 2 | junit.jupiter.execution.parallel.mode.default=concurrent 3 | junit.jupiter.execution.parallel.mode.classes.default=same_thread 4 | junit.jupiter.execution.parallel.config.strategy=dynamic 5 | junit.jupiter.execution.parallel.config.dynamic.factor=4 6 | 7 | jqwik.tries.default = 10000 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings 4 | eclipse 5 | .idea 6 | *.iml 7 | *.ipr 8 | *.iws 9 | 10 | bin 11 | build 12 | target 13 | .gradle 14 | forge-download 15 | out 16 | run 17 | runs 18 | .jqwik-database 19 | 20 | /dependency-reduced-pom.xml 21 | *-private.sh 22 | 23 | # i18n 24 | worldedit-core/src/main/resources/lang/* 25 | !worldedit-core/src/main/resources/lang/strings.json 26 | -------------------------------------------------------------------------------- /worldedit-bukkit/adapters/adapter-1.21.3/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension 2 | 3 | plugins { 4 | id("buildlogic.adapter") 5 | } 6 | 7 | dependencies { 8 | // https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/ 9 | the().paperDevBundle("1.21.3-R0.1-20241025.163321-1") 10 | } 11 | -------------------------------------------------------------------------------- /worldedit-bukkit/adapters/adapter-1.21.4/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension 2 | 3 | plugins { 4 | id("buildlogic.adapter") 5 | } 6 | 7 | dependencies { 8 | // https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/ 9 | the().paperDevBundle("1.21.4-R0.1-20241205.222346-7") 10 | } 11 | -------------------------------------------------------------------------------- /contrib/craftscripts/SUBMITTING.md: -------------------------------------------------------------------------------- 1 | Write a cool script? You can submit a pull request to [our GitHub Repository](https://github.com/EngineHub/WorldEdit). 2 | We will consider your script for inclusion in the WorldEdit repository. CraftScripts in the WorldEdit repository are 3 | licensed under GPLv3, like the rest of WorldEdit. 4 | 5 | You can also post your scripts on [our Discord](https://discord.gg/enginehub) in the `#showcase` channel 6 | -------------------------------------------------------------------------------- /verification/src/changes/accepted-cli-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Incorrect removal detection due to problems with classpath": [ 3 | { 4 | "type": "com.sk89q.worldedit.cli.schematic.ClipboardWorld", 5 | "member": "Method com.sk89q.worldedit.cli.schematic.ClipboardWorld.getId()", 6 | "changes": [ 7 | "METHOD_REMOVED" 8 | ] 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /worldedit-libs/README.md: -------------------------------------------------------------------------------- 1 | This project shades _API_ libraries, i.e. those libraries 2 | whose classes are publicly referenced from `-core` classes. 3 | 4 | This project _does not_ shade implementation libraries, i.e. 5 | those libraries whose classes are internally depended on. 6 | 7 | This is because the main reason for shading those libraries is for 8 | their internal usage in each platform, not because we need them available to 9 | dependents of `-core` to compile and work with WorldEdit's API. 10 | -------------------------------------------------------------------------------- /worldedit-fabric/src/main/resources/worldedit-fabric.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.sk89q.worldedit.fabric.mixin", 4 | "compatibilityLevel": "JAVA_8", 5 | "mixins": [ 6 | "MixinLevelChunkSetBlockHook", 7 | "MixinMinecraftServer", 8 | "MixinServerGamePacketListenerImpl" 9 | ], 10 | "plugin": "com.sk89q.worldedit.fabric.internal.MixinConfigPlugin", 11 | "server": [ 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/resources/worldedit-neoforge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.sk89q.worldedit.neoforge.mixin", 4 | "compatibilityLevel": "JAVA_17", 5 | "mixins": [ 6 | "AccessorServerPlayerGameMode", 7 | "MixinLevelChunkSetBlockHook", 8 | "MixinServerGamePacketListenerImpl" 9 | ], 10 | "server": [ 11 | ], 12 | "injectors": { 13 | "defaultRequire": 1 14 | }, 15 | "refmap": "worldedit-neoforge.mixins.refmap.json" 16 | } 17 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | We only support the latest release of Minecraft, and the latest release of our software. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Vulnerabilities should be reported to our security email, `security@enginehub.org`. 10 | 11 | WorldEdit is designed to be an admin tool. We do not consider users being able to break limits or cause lag security vulnerabilities _if they are given permission to run the commands_. Only performance issues resulting from players without permissions are considered security vulnerabilities. 12 | -------------------------------------------------------------------------------- /worldedit-core/doctools/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") version "1.9.23" 3 | application 4 | id("buildlogic.common") 5 | } 6 | 7 | application.mainClass.set("com.sk89q.worldedit.internal.util.DocumentationPrinter") 8 | tasks.named("run") { 9 | workingDir = rootProject.projectDir 10 | } 11 | 12 | dependencies { 13 | "implementation"(project(":worldedit-libs:core:ap")) 14 | "implementation"(project(":worldedit-core")) 15 | "implementation"(kotlin("stdlib-jdk8")) 16 | "implementation"(kotlin("reflect")) 17 | "implementation"(libs.guava) 18 | } 19 | -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.server.MinecraftServer nextTickTimeNanos 2 | 3 | # For regen 4 | public net.minecraft.server.MinecraftServer storageSource 5 | public net.minecraft.server.level.ServerChunkCache mainThreadProcessor 6 | 7 | public net.minecraft.world.level.chunk.ChunkBiomeContainer biomes 8 | public-f net.minecraft.world.level.storage.PrimaryLevelData worldOptions 9 | 10 | public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket (Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/entity/BlockEntityType;Lnet/minecraft/nbt/CompoundTag;)V 11 | -------------------------------------------------------------------------------- /contrib/craftscripts/README.md: -------------------------------------------------------------------------------- 1 | CraftScripts are script files for WorldEdit that let you write world 2 | editing scripts with JavaScript easily. 3 | 4 | Example usage: 5 | /cs maze.js glowstone 10 10 6 | 7 | You may or may not install these scripts -- it is optional. If you are, however, 8 | place the entire `craftscripts/` folder into the respective directory for the platform 9 | that you have installed WorldEdit. 10 | 11 | In order to be able to use CraftScripts, you must install the Rhino JavaScript library. 12 | The installation page linked above has information about that. More information 13 | about scripts in general can be found [on our docs](https://worldedit.enginehub.org/en/latest/usage/other/craftscripts/) 14 | -------------------------------------------------------------------------------- /worldedit-libs/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("buildlogic.libs") 3 | } 4 | 5 | dependencies { 6 | "shade"(libs.kyoriText.api) 7 | "shade"(libs.kyoriText.serializer.gson) 8 | "shade"(libs.kyoriText.serializer.legacy) 9 | "shade"(libs.kyoriText.serializer.plain) 10 | // These are here because they use net.kyori:text-api -- so they need to be relocated too 11 | "shade"(libs.piston.core) 12 | "shade"(libs.piston.coreAp.runtime) 13 | "shade"(libs.piston.defaultImpl) 14 | // Linbus 15 | "shade"(platform(libs.linBus.bom)) 16 | "shade"(libs.linBus.common) 17 | "shade"(libs.linBus.stream) 18 | "shade"(libs.linBus.tree) 19 | "shade"(libs.linBus.format.snbt) 20 | } 21 | -------------------------------------------------------------------------------- /HEADER.txt: -------------------------------------------------------------------------------- 1 | WorldEdit, a Minecraft world manipulation toolkit 2 | Copyright (C) sk89q 3 | Copyright (C) WorldEdit team and contributors 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /worldedit-cli/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: 'Handle stale issues' 2 | on: 3 | workflow_dispatch: 4 | issues: # Run the bot on issue activity for faster response to changes 5 | issue_comment: # Run the bot on issue comment activity for faster response to changes 6 | schedule: 7 | - cron: '42 1 * * *' 8 | 9 | concurrency: 10 | group: stale 11 | 12 | jobs: 13 | stale: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/stale@v9 17 | with: 18 | only-labels: 'status:pending,type:bug' 19 | stale-issue-label: 'status:stale' 20 | stale-issue-message: > 21 | This issue has been automatically marked as stale because it has not been fully confirmed. 22 | It will be closed if no further activity occurs. Thank you for your contributions. 23 | days-before-stale: 30 24 | days-before-close: 7 25 | days-before-pr-stale: -1 26 | days-before-pr-close: -1 27 | -------------------------------------------------------------------------------- /verification/src/changes/accepted-bukkit-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Incorrect removal detection due to problems with classpath": [ 3 | { 4 | "type": "com.sk89q.worldedit.bukkit.BukkitWorld", 5 | "member": "Method com.sk89q.worldedit.bukkit.BukkitWorld.fullySupports3DBiomes()", 6 | "changes": [ 7 | "METHOD_REMOVED" 8 | ] 9 | }, 10 | { 11 | "type": "com.sk89q.worldedit.bukkit.BukkitServerInterface", 12 | "member": "Method com.sk89q.worldedit.bukkit.BukkitServerInterface.getId()", 13 | "changes": [ 14 | "METHOD_REMOVED" 15 | ] 16 | }, 17 | { 18 | "type": "com.sk89q.worldedit.bukkit.BukkitWorld", 19 | "member": "Method com.sk89q.worldedit.bukkit.BukkitWorld.getId()", 20 | "changes": [ 21 | "METHOD_REMOVED" 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | # Force Batch files to CRLF 3 | *.bat eol=crlf -text 4 | 5 | # Java sources 6 | *.java text diff=java 7 | *.kt text diff=java 8 | *.gradle text diff=java 9 | *.gradle.kts text diff=java 10 | 11 | # These files are text and should be normalized (Convert crlf => lf) 12 | *.css text diff=css 13 | *.df text 14 | *.htm text diff=html 15 | *.html text diff=html 16 | *.js text 17 | *.jsp text 18 | *.jspf text 19 | *.jspx text 20 | *.properties text 21 | *.tld text 22 | *.tag text 23 | *.tagx text 24 | *.xml text 25 | 26 | # These files are binary and should be left untouched 27 | # (binary is a macro for -text -diff) 28 | *.class binary 29 | *.dll binary 30 | *.ear binary 31 | *.jar binary 32 | *.so binary 33 | *.war binary 34 | *.jks binary 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | @org.enginehub.piston.util.NonnullByDefault 21 | package com.sk89q.worldedit.command.argument; 22 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/HandSide.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util; 21 | 22 | public enum HandSide { 23 | MAIN_HAND, 24 | OFF_HAND 25 | } 26 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/util/HookMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command.util; 21 | 22 | public enum HookMode { 23 | ACTIVE, INACTIVE 24 | } 25 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/file/AttributeTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io.file; 21 | 22 | public enum AttributeTarget { 23 | FILE, DIRECTORY 24 | } 25 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/report/Report.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.report; 21 | 22 | public interface Report { 23 | 24 | String getTitle(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /config/checkstyle/checkstyle-suppression.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "[3,)" 3 | issueTrackerURL = "https://discord.gg/enginehub" 4 | license = "GPLv3" 5 | 6 | [[mods]] 7 | modId = "worldedit" 8 | version = "${version}" 9 | displayName = "WorldEdit" 10 | displayURL = "https://enginehub.org/worldedit/" 11 | description = ''' 12 | WorldEdit is an easy-to-use in-game world editor for Minecraft, supporting both single- and multi-player. 13 | ''' 14 | authors = "EngineHub" 15 | logoFile = "worldedit-icon.png" 16 | displayTest = "IGNORE_SERVER_VERSION" 17 | 18 | [[mixins]] 19 | config = "worldedit-neoforge.mixins.json" 20 | 21 | [[accessTransformers]] 22 | file = "META-INF/accesstransformer.cfg" 23 | 24 | [[dependencies.worldedit]] 25 | modId = "minecraft" 26 | type = "required" 27 | versionRange = "[${minecraftVersion},${nextMajorMinecraftVersion})" 28 | ordering = "NONE" 29 | side = "BOTH" 30 | 31 | [[dependencies.worldedit]] 32 | modId = "neoforge" 33 | type = "required" 34 | versionRange = "[${neoVersion},)" 35 | ordering = "NONE" 36 | side = "BOTH" 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/InvalidSnapshotException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.snapshot; 21 | 22 | public class InvalidSnapshotException extends Exception { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event; 21 | 22 | /** 23 | * An abstract base class for all WorldEdit events. 24 | */ 25 | public abstract class Event { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/Contextual.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function; 21 | 22 | public interface Contextual { 23 | 24 | T createFromContext(EditContext context); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.cui; 21 | 22 | public interface CUIEvent { 23 | 24 | String getTypeId(); 25 | 26 | String[] getParameters(); 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/SimpleItemMaterial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | public record SimpleItemMaterial(int maxStackSize, int maxDamage) implements ItemMaterial { 23 | } 24 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/UnhandledCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | @Deprecated 23 | public class UnhandledCommandException extends CommandException { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/SelectorChoiceOrList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command.argument; 21 | 22 | public sealed interface SelectorChoiceOrList permits SelectorChoice, SelectorChoiceList { 23 | } 24 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.wepif; 21 | 22 | public interface PermissionsResolver extends PermissionsProvider { 23 | void load(); 24 | 25 | String getDetectionMessage(); 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/EmptyClipboardException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | /** 23 | * Thrown when there is no clipboard set. 24 | */ 25 | public class EmptyClipboardException extends WorldEditException { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/PasteMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.paste; 21 | 22 | public class PasteMetadata { 23 | public String name; 24 | public String extension; 25 | public String author; 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/IncompleteRegionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | /** 23 | * Raised when a region is not fully defined. 24 | */ 25 | public class IncompleteRegionException extends WorldEditException { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/invoke/ExecNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression.invoke; 21 | 22 | import java.lang.invoke.MethodHandle; 23 | 24 | record ExecNode(int positionInLine, MethodHandle handle) { 25 | } 26 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/MaxBrushRadiusException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | /** 23 | * Thrown when a maximum radius for a brush is reached. 24 | */ 25 | public class MaxBrushRadiusException extends MaxRadiusException { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.inventory; 21 | 22 | /** 23 | * Thrown when a block bag detects a problem. 24 | */ 25 | public class BlockBagException extends Exception { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-fabric/src/main/resources/worldedit.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | 3 | accessible class net/minecraft/server/level/ServerChunkCache$MainThreadExecutor 4 | accessible field net/minecraft/server/level/ServerChunkCache mainThreadProcessor Lnet/minecraft/server/level/ServerChunkCache$MainThreadExecutor; 5 | 6 | accessible field net/minecraft/commands/CommandSourceStack source Lnet/minecraft/commands/CommandSource; 7 | 8 | accessible field net/minecraft/server/level/ServerPlayerGameMode isDestroyingBlock Z 9 | 10 | accessible field net/minecraft/world/level/storage/DerivedLevelData wrapped Lnet/minecraft/world/level/storage/ServerLevelData; 11 | 12 | accessible field net/minecraft/world/level/storage/PrimaryLevelData worldOptions Lnet/minecraft/world/level/levelgen/WorldOptions; 13 | mutable field net/minecraft/world/level/storage/PrimaryLevelData worldOptions Lnet/minecraft/world/level/levelgen/WorldOptions; 14 | 15 | accessible method net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket (Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/entity/BlockEntityType;Lnet/minecraft/nbt/CompoundTag;)V 16 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/wepif/WEPIFRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.wepif; 21 | 22 | public class WEPIFRuntimeException extends RuntimeException { 23 | 24 | public WEPIFRuntimeException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /** 21 | * This package contains the old command system. It is no longer in use. Please switch 22 | * to Piston, Intake, ACF, or similar systems. 23 | */ 24 | package com.sk89q.minecraft.util.commands; 25 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/OutOfBlocksException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.inventory; 21 | 22 | /** 23 | * Thrown when there are no more blocks left. 24 | */ 25 | public class OutOfBlocksException extends BlockBagException { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.mask; 21 | 22 | /** 23 | * A base class of {@link Mask} that all masks should inherit from. 24 | */ 25 | public abstract class AbstractMask implements Mask { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.pattern; 21 | 22 | /** 23 | * An abstract implementation for {@link Pattern}s. 24 | */ 25 | public abstract class AbstractPattern implements Pattern { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Watchdog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extension.platform; 21 | 22 | /** 23 | * Interface to a {@link Platform}'s watchdog service. 24 | */ 25 | public interface Watchdog { 26 | 27 | void tick(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask2D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.mask; 21 | 22 | /** 23 | * A base class of {@link Mask2D} that all masks should inherit from. 24 | */ 25 | public abstract class AbstractMask2D implements Mask2D { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/wna/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /** 21 | * "WNA", or WorldEdit Native Access. 22 | * 23 | *

24 | * Contains internal helper functions for sharing code between platforms. 25 | *

26 | */ 27 | package com.sk89q.worldedit.internal.wna; 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/UnplaceableBlockException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.inventory; 21 | 22 | /** 23 | * Thrown when a block that can't be placed is used. 24 | */ 25 | public class UnplaceableBlockException extends BlockBagException { 26 | } 27 | -------------------------------------------------------------------------------- /worldedit-core/src/test/java/com/sk89q/worldedit/util/test/ResourceLockKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.test; 21 | 22 | public class ResourceLockKeys { 23 | public static final String WORLDEDIT_PLATFORM = "WORLDEDIT_PLATFORM"; 24 | 25 | private ResourceLockKeys() { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crowdin-distributor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # For snapshots, please specify the full version (with date and time) 5 | cdist_version="0.1.0-20240706.110724-10" 6 | cdist_path_version="$cdist_version" 7 | 8 | if [ -n "${cdist_version#*-}" ]; then 9 | cdist_path_version="${cdist_version%%-*}-SNAPSHOT" 10 | fi 11 | url="https://maven.enginehub.org/repo/org/enginehub/crowdin/crowdin-distributor/$cdist_path_version/crowdin-distributor-$cdist_version-bundle.zip" 12 | [ -d ./build ] || mkdir ./build 13 | curl "$url" >./build/cdist.zip 14 | (cd ./build && unzip -o cdist.zip) 15 | 16 | # CROWDIN_DISTRIBUTOR_TOKEN is set by CI 17 | export CROWDIN_DISTRIBUTOR_ON_CHANGE="true" 18 | export CROWDIN_DISTRIBUTOR_PROJECT_ID="360697" 19 | export CROWDIN_DISTRIBUTOR_MODULE="worldedit-lang" 20 | ## Full path to the source file, will be uploaded to crowdin, must already have uploaded at least once (will not create a new file) 21 | export CROWDIN_DISTRIBUTOR_SOURCE_FILE="./worldedit-core/src/main/resources/lang/strings.json" 22 | # Artifactory & Build Number is set by CI 23 | export CROWDIN_DISTRIBUTOR_OPTS="" 24 | "./build/crowdin-distributor-$cdist_path_version/bin/crowdin-distributor" 25 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/MaxRadiusException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | /** 23 | * Thrown when a maximum radius is reached, such as, for example, 24 | * in the case of a sphere command. 25 | */ 26 | public class MaxRadiusException extends WorldEditException { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /worldedit-core/doctools/src/main/kotlin/com/sk89q/worldedit/internal/util/DocumentationConfiguration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.util 21 | 22 | import com.sk89q.worldedit.LocalConfiguration 23 | 24 | object DocumentationConfiguration : LocalConfiguration() { 25 | override fun load() { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissionsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | /** 23 | * Thrown when not enough permissions are satisfied. 24 | */ 25 | @Deprecated 26 | public class CommandPermissionsException extends CommandException { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/CompiledExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression; 21 | 22 | /** 23 | * Represents a "compiled" expression. 24 | */ 25 | public interface CompiledExpression { 26 | 27 | Double execute(ExecutionData executionData); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/WrappedCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | @Deprecated 23 | public class WrappedCommandException extends CommandException { 24 | 25 | public WrappedCommandException(Throwable t) { 26 | super(t); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Gradle Build 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | name: Build WorldEdit on ${{ matrix.os }} 7 | runs-on: ${{ matrix.os }} 8 | strategy: 9 | fail-fast: false 10 | matrix: 11 | os: [ubuntu-latest, windows-latest] 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Set up JDK 17 | uses: actions/setup-java@v4 18 | with: 19 | java-version: 21 20 | distribution: 'temurin' 21 | 22 | - name: Setup Gradle 23 | uses: gradle/actions/setup-gradle@v3 24 | with: 25 | cache-read-only: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/version/')) }} 26 | 27 | - name: Execute Gradle build 28 | run: ./gradlew build -s 29 | 30 | - uses: actions/upload-artifact@v4 31 | name: Archive Reports 32 | if: always() 33 | with: 34 | name: reports for ${{ matrix.os }} 35 | path: '**/build/reports/**' 36 | 37 | - uses: actions/upload-artifact@v4 38 | name: Archive Logs 39 | if: always() 40 | with: 41 | name: logs for ${{ matrix.os }} 42 | path: '**/*.log' 43 | 44 | -------------------------------------------------------------------------------- /worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/internal/ExtendedMinecraftServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.fabric.internal; 21 | 22 | import net.minecraft.world.level.Level; 23 | 24 | import java.nio.file.Path; 25 | 26 | public interface ExtendedMinecraftServer { 27 | 28 | Path getStoragePath(Level world); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/ItemCategoryRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.world.item.ItemType; 23 | 24 | /** 25 | * A registry for ItemType categories. 26 | */ 27 | public interface ItemCategoryRegistry extends CategoryRegistry { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockCategoryRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.world.block.BlockType; 23 | 24 | /** 25 | * A registry for BlockType categories. 26 | */ 27 | public interface BlockCategoryRegistry extends CategoryRegistry { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/regions/factory/RegionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.regions.factory; 21 | 22 | import com.sk89q.worldedit.math.BlockVector3; 23 | import com.sk89q.worldedit.regions.Region; 24 | 25 | public interface RegionFactory { 26 | 27 | Region createCenteredAt(BlockVector3 position, double size); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/SelectorChoiceList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command.argument; 21 | 22 | public final class SelectorChoiceList implements SelectorChoiceOrList { 23 | public static final SelectorChoiceList INSTANCE = new SelectorChoiceList(); 24 | 25 | private SelectorChoiceList() { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/InputType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | /** 23 | * The type of input sent. 24 | */ 25 | public enum InputType { 26 | 27 | /** 28 | * Left click. 29 | */ 30 | PRIMARY, 31 | 32 | /** 33 | * Right click. 34 | */ 35 | SECONDARY 36 | 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlatformsRegisteredEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | import com.sk89q.worldedit.event.Event; 23 | 24 | /** 25 | * Fired by a platform when it believes all available platforms should be registered. 26 | */ 27 | public class PlatformsRegisteredEvent extends Event { 28 | } 29 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/InvalidFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.storage; 21 | 22 | import com.sk89q.worldedit.world.DataException; 23 | 24 | public class InvalidFormatException extends DataException { 25 | 26 | public InvalidFormatException(String msg) { 27 | super(msg); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/Arguments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command.argument; 21 | 22 | 23 | import org.enginehub.piston.inject.InjectedValueAccess; 24 | 25 | /** 26 | * Key-interface for {@link InjectedValueAccess} for the String arguments. 27 | */ 28 | public interface Arguments { 29 | 30 | String get(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | @Deprecated 23 | public class MissingNestedCommandException extends CommandUsageException { 24 | 25 | public MissingNestedCommandException(String message, String usage) { 26 | super(message, usage); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /verification/src/changes/accepted-core-public-api-changes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Removing useless Authorizer classes": [ 3 | { 4 | "type": "com.sk89q.worldedit.util.auth.Authorizer", 5 | "member": "Class com.sk89q.worldedit.util.auth.Authorizer", 6 | "changes": [ 7 | "CLASS_REMOVED" 8 | ] 9 | }, 10 | { 11 | "type": "com.sk89q.worldedit.util.auth.Authorizer", 12 | "member": "Method com.sk89q.worldedit.util.auth.Authorizer.testPermission(com.sk89q.minecraft.util.commands.CommandLocals,java.lang.String)", 13 | "changes": [ 14 | "METHOD_REMOVED" 15 | ] 16 | }, 17 | { 18 | "type": "com.sk89q.worldedit.util.auth.NullAuthorizer", 19 | "member": "Class com.sk89q.worldedit.util.auth.NullAuthorizer", 20 | "changes": [ 21 | "CLASS_REMOVED" 22 | ] 23 | }, 24 | { 25 | "type": "com.sk89q.worldedit.util.auth.NullAuthorizer", 26 | "member": "Constructor com.sk89q.worldedit.util.auth.NullAuthorizer()", 27 | "changes": [ 28 | "CONSTRUCTOR_REMOVED" 29 | ] 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/InvalidItemException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | /** 23 | * Thrown when an invalid item is specified. 24 | */ 25 | @Deprecated 26 | public class InvalidItemException extends DisallowedItemException { 27 | 28 | public InvalidItemException(String type, String message) { 29 | super(type, message); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/lifecycle/Token.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.lifecycle; 21 | 22 | /** 23 | * Used to create a new strong reference to an object that can be separately dropped. 24 | * 25 | * @param the inner object 26 | */ 27 | class Token { 28 | final T inner; 29 | 30 | Token(T inner) { 31 | this.inner = inner; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-fabric/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "worldedit", 4 | "version": "${version}", 5 | 6 | "name": "WorldEdit", 7 | "description": "WorldEdit is an easy-to-use in-game world editor for Minecraft, supporting both single- and multi-player.", 8 | "authors": [ 9 | "EngineHub" 10 | ], 11 | "contact": { 12 | "homepage": "https://enginehub.org/worldedit/", 13 | "sources": "https://github.com/EngineHub/WorldEdit" 14 | }, 15 | 16 | "license": "GPL3", 17 | "icon": "assets/worldedit/icon.png", 18 | 19 | "environment": "*", 20 | "entrypoints": { 21 | "main": [ 22 | "com.sk89q.worldedit.fabric.FabricWorldEdit" 23 | ] 24 | }, 25 | 26 | "depends": { 27 | "fabricloader": ">=0.4.0", 28 | "fabric-api-base": "*", 29 | "fabric-command-api-v2": "*", 30 | "fabric-lifecycle-events-v1": "*", 31 | "fabric-events-interaction-v0": "*", 32 | "fabric-networking-api-v1": "*" 33 | }, 34 | "suggests": { 35 | "fabric-permissions-api-v0": "*" 36 | }, 37 | "mixins": [ 38 | "worldedit-fabric.mixins.json" 39 | ], 40 | "accessWidener" : "worldedit.accesswidener" 41 | } 42 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.util.yaml; 21 | 22 | /** 23 | * YAMLProcessor exception. 24 | */ 25 | public class YAMLProcessorException extends Exception { 26 | 27 | public YAMLProcessorException() { 28 | super(); 29 | } 30 | 31 | public YAMLProcessorException(String msg) { 32 | super(msg); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/ExpressionTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression; 21 | 22 | /** 23 | * Thrown when an evaluation exceeds the timeout time. 24 | */ 25 | public class ExpressionTimeoutException extends EvaluationException { 26 | public ExpressionTimeoutException(String message) { 27 | super(-1, message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/Identifiable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util; 21 | 22 | import java.util.UUID; 23 | 24 | /** 25 | * Represents an object that can be identified by a UUID. 26 | */ 27 | public interface Identifiable { 28 | 29 | /** 30 | * Get the UUID for this object. 31 | * 32 | * @return the UUID 33 | */ 34 | UUID getUniqueId(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Console.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | /** 26 | * This annotation indicates that a command can be used from the console. 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Deprecated 30 | public @interface Console { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/file/ArchiveDir.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io.file; 21 | 22 | import java.io.Closeable; 23 | import java.nio.file.Path; 24 | 25 | /** 26 | * Represents an archive opened as a directory. This must be closed after work on the Path is 27 | * done. 28 | */ 29 | public interface ArchiveDir extends Closeable { 30 | 31 | Path getPath(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/DataException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world; 21 | 22 | /** 23 | * Thrown when there is an exception related to data handling. 24 | */ 25 | public class DataException extends Exception { 26 | 27 | public DataException(String msg) { 28 | super(msg); 29 | } 30 | 31 | public DataException() { 32 | super(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlatformInitializeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | import com.sk89q.worldedit.event.Event; 23 | 24 | /** 25 | * Fired when configuration has been loaded and the platform is in the 26 | * intialization stage. 27 | * 28 | *

This event is fired once.

29 | */ 30 | public class PlatformInitializeEvent extends Event { 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/permission/OverridePermissions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extension.platform.permission; 21 | 22 | /** 23 | * Standard override permissions. 24 | */ 25 | public final class OverridePermissions { 26 | 27 | public static final String NO_LIMITS = "worldedit.limit.unrestricted"; 28 | 29 | private OverridePermissions() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ExtentPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.pattern; 21 | 22 | import com.sk89q.worldedit.extent.Extent; 23 | 24 | public interface ExtentPattern extends Pattern { 25 | 26 | /** 27 | * Get the extent associated with this pattern. 28 | * 29 | * @return the extent for this pattern 30 | */ 31 | Extent getExtent(); 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandInspector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.bukkit.util; 21 | 22 | import org.bukkit.command.Command; 23 | import org.bukkit.command.CommandSender; 24 | 25 | public interface CommandInspector { 26 | 27 | String getShortText(Command command); 28 | 29 | String getFullText(Command command); 30 | 31 | boolean testPermission(CommandSender sender, Command command); 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/Interaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | /** 23 | * The type of interaction. 24 | */ 25 | public enum Interaction { 26 | 27 | /** 28 | * Refers to primary input usage (left click). 29 | */ 30 | HIT, 31 | 32 | /** 33 | * Refers to secondary input usage (right click). 34 | */ 35 | OPEN 36 | 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/Paster.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.paste; 21 | 22 | import java.net.URL; 23 | import java.util.concurrent.Callable; 24 | 25 | public interface Paster { 26 | 27 | default Callable paste(String content) { 28 | return paste(content, new PasteMetadata()); 29 | } 30 | 31 | Callable paste(String content, PasteMetadata metadata); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStoreException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.storage; 21 | 22 | import com.sk89q.worldedit.world.DataException; 23 | 24 | public class ChunkStoreException extends DataException { 25 | 26 | public ChunkStoreException(String msg) { 27 | super(msg); 28 | } 29 | 30 | public ChunkStoreException() { 31 | super(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/task/progress/ProgressObservable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.task.progress; 21 | 22 | /** 23 | * An object that is able to report on its progress. 24 | */ 25 | public interface ProgressObservable { 26 | 27 | /** 28 | * Get the current percentage of completion. 29 | * 30 | * @return a progress object 31 | */ 32 | Progress getProgress(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlatformReadyEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | import com.sk89q.worldedit.extension.platform.Platform; 23 | 24 | /** 25 | * Raised when a platform has finished loading its data. 26 | */ 27 | public class PlatformReadyEvent extends PlatformEvent { 28 | public PlatformReadyEvent(Platform platform) { 29 | super(platform); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/ExpressionFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.METHOD) 29 | public @interface ExpressionFunction { 30 | } 31 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionOwner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.session; 21 | 22 | import com.sk89q.worldedit.util.auth.Subject; 23 | 24 | /** 25 | * An object that owns a session. 26 | */ 27 | public interface SessionOwner extends Subject { 28 | 29 | /** 30 | * Get an object describing this session. 31 | * 32 | * @return the status object 33 | */ 34 | SessionKey getSessionKey(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/report/ConfigReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.report; 21 | 22 | import com.sk89q.worldedit.WorldEdit; 23 | 24 | public class ConfigReport extends DataReport { 25 | 26 | public ConfigReport() { 27 | super("WorldEdit Configuration"); 28 | 29 | append("Configuration", new HierarchyObjectReport("Configuration", WorldEdit.getInstance().getConfiguration())); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.scripting; 21 | 22 | import java.util.Map; 23 | import javax.script.ScriptException; 24 | 25 | public interface CraftScriptEngine { 26 | void setTimeLimit(int milliseconds); 27 | 28 | int getTimeLimit(); 29 | 30 | Object evaluate(String script, String filename, Map args) 31 | throws ScriptException, Throwable; 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/test/java/com/sk89q/worldedit/util/test/VariedVectorPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.test; 21 | 22 | import com.sk89q.worldedit.math.BlockVector3; 23 | 24 | public class VariedVectorPair { 25 | public final BlockVector3 first; 26 | public final BlockVector3 second; 27 | 28 | public VariedVectorPair(BlockVector3 first, BlockVector3 second) { 29 | this.first = first; 30 | this.second = second; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/MissingWorldException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit; 21 | 22 | import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; 23 | 24 | /** 25 | * Raised when a world is missing but is required. 26 | */ 27 | public class MissingWorldException extends WorldEditException { 28 | 29 | public MissingWorldException() { 30 | super(TranslatableComponent.of("worldedit.error.missing-world")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.util.yaml; 21 | 22 | import org.yaml.snakeyaml.DumperOptions.FlowStyle; 23 | 24 | public enum YAMLFormat { 25 | EXTENDED(FlowStyle.BLOCK), 26 | COMPACT(FlowStyle.AUTO); 27 | 28 | private final FlowStyle style; 29 | 30 | YAMLFormat(FlowStyle style) { 31 | this.style = style; 32 | } 33 | 34 | public FlowStyle getStyle() { 35 | return style; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlatformUnreadyEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | import com.sk89q.worldedit.extension.platform.Platform; 23 | 24 | /** 25 | * Raised when a platform needs to retract all registered data, e.g. due to a reload. 26 | */ 27 | public class PlatformUnreadyEvent extends PlatformEvent { 28 | public PlatformUnreadyEvent(Platform platform) { 29 | super(platform); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util; 21 | 22 | import javax.annotation.Nullable; 23 | 24 | import static com.google.common.base.Preconditions.checkNotNull; 25 | 26 | public final class GuavaUtil { 27 | 28 | private GuavaUtil() { 29 | } 30 | 31 | public static T firstNonNull(@Nullable T first, @Nullable T second) { 32 | return first != null ? first : checkNotNull(second); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandUsageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | @Deprecated 23 | public class CommandUsageException extends CommandException { 24 | 25 | protected String usage; 26 | 27 | public CommandUsageException(String message, String usage) { 28 | super(message); 29 | this.usage = usage; 30 | } 31 | 32 | public String getUsage() { 33 | return usage; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/sponge/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /** 21 | * This package is internal, containing implementation details of the Sponge Schematic 22 | * Specification. Use the {@link com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats} or 23 | * {@link com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat} classes to 24 | * acquire readers and writers instead. 25 | */ 26 | package com.sk89q.worldedit.extent.clipboard.io.sponge; 27 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/report/HierarchyObjectReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.report; 21 | 22 | public class HierarchyObjectReport extends ShallowObjectReport { 23 | 24 | public HierarchyObjectReport(String title, Object object) { 25 | super(title, object); 26 | 27 | Class type = object.getClass(); 28 | while ((type = type.getSuperclass()) != null) { 29 | scanClass(object, type); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullItemCategoryRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.world.item.ItemType; 23 | 24 | import java.util.Collections; 25 | import java.util.Set; 26 | 27 | public class NullItemCategoryRegistry implements ItemCategoryRegistry { 28 | 29 | @Override 30 | public Set getCategorisedByName(String category) { 31 | return Collections.emptySet(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/java/com/sk89q/worldedit/neoforge/mixin/AccessorServerPlayerGameMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.neoforge.mixin; 21 | 22 | import net.minecraft.server.level.ServerPlayerGameMode; 23 | import org.spongepowered.asm.mixin.Mixin; 24 | import org.spongepowered.asm.mixin.gen.Accessor; 25 | 26 | @Mixin(ServerPlayerGameMode.class) 27 | public interface AccessorServerPlayerGameMode { 28 | 29 | @Accessor("isDestroyingBlock") 30 | boolean isDestroyingBlock(); 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBlockCategoryRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.world.block.BlockType; 23 | 24 | import java.util.Collections; 25 | import java.util.Set; 26 | 27 | public class NullBlockCategoryRegistry implements BlockCategoryRegistry { 28 | 29 | @Override 30 | public Set getCategorisedByName(String category) { 31 | return Collections.emptySet(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/MultiUserPlatform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extension.platform; 21 | 22 | import java.util.Collection; 23 | 24 | /** 25 | * Implements a platform with multiple connected users. 26 | */ 27 | public interface MultiUserPlatform extends Platform { 28 | 29 | /** 30 | * Get a list of connected users. 31 | * 32 | * @return a list of connected users 33 | */ 34 | Collection getConnectedUsers(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/scripting/MinecraftHidingClassShutter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.scripting; 21 | 22 | import org.mozilla.javascript.ClassShutter; 23 | 24 | /** 25 | * Hides Minecraft's obfuscated names from scripts. 26 | */ 27 | class MinecraftHidingClassShutter implements ClassShutter { 28 | @Override 29 | public boolean visibleToScripts(String fullClassName) { 30 | return fullClassName.contains(".") || fullClassName.length() >= 4; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/report/Unreported.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.report; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Annotates properties that should not be exposed in the report. 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.FIELD) 32 | public @interface Unreported { 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/jnbt/EndTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.jnbt; 21 | 22 | import org.enginehub.linbus.tree.LinEndTag; 23 | 24 | /** 25 | * The {@code TAG_End} tag. 26 | * 27 | * @deprecated Use {@link LinEndTag}. 28 | */ 29 | @Deprecated 30 | public final class EndTag extends Tag { 31 | public EndTag() { 32 | super(LinEndTag.instance()); 33 | } 34 | 35 | @Override 36 | public Object getValue() { 37 | return super.getValue(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/UnsupportedVersionEditException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.bukkit.adapter; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; 24 | 25 | public class UnsupportedVersionEditException extends WorldEditException { 26 | public UnsupportedVersionEditException() { 27 | super(TranslatableComponent.of("worldedit.bukkit.no-edit-without-adapter")); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Mask2D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.mask; 21 | 22 | import com.sk89q.worldedit.math.BlockVector2; 23 | 24 | /** 25 | * Tests whether a given vector meets a criteria. 26 | */ 27 | public interface Mask2D { 28 | 29 | /** 30 | * Returns true if the criteria is met. 31 | * 32 | * @param vector the vector to test 33 | * @return true if the criteria is met 34 | */ 35 | boolean test(BlockVector2 vector); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/ExceptionMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.command.exception; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Denotes a match of an exception. 29 | */ 30 | @Target(ElementType.METHOD) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface ExceptionMatch { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/StructureType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.generation; 21 | 22 | import com.sk89q.worldedit.registry.Keyed; 23 | import com.sk89q.worldedit.registry.NamespacedRegistry; 24 | 25 | public record StructureType(String id) implements Keyed { 26 | public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("structure type"); 27 | 28 | @Override 29 | public String toString() { 30 | return this.id; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullEntityRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.entity.BaseEntity; 23 | 24 | import javax.annotation.Nullable; 25 | 26 | /** 27 | * An implementation of an entity registry that knows nothing. 28 | */ 29 | public class NullEntityRegistry implements EntityRegistry { 30 | 31 | @Nullable 32 | @Override 33 | public BaseEntity createFromId(String id) { 34 | return null; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/experimental/SnapshotComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.snapshot.experimental; 21 | 22 | import java.util.Comparator; 23 | 24 | public class SnapshotComparator { 25 | 26 | private static final Comparator COMPARATOR = 27 | Comparator.comparing(Snapshot::getInfo); 28 | 29 | public static Comparator getInstance() { 30 | return COMPARATOR; 31 | } 32 | 33 | private SnapshotComparator() { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for WorldEdit 3 | labels: ['type:feature-request', 'status:pending'] 4 | 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: > 9 | Please note: we are currently not accepting feature requests designed to make it 10 | easier to give WorldEdit to all players on a server. WorldEdit is intended for 11 | admin use only. 12 | 13 | - type: textarea 14 | attributes: 15 | label: The Problem 16 | description: > 17 | What is making your WorldEdit experience sub-optimal? This should be something that 18 | cannot be easily solved by existing WorldEdit features. 19 | placeholder: It's hard to ... ; I'm unable to ... 20 | validations: 21 | required: true 22 | 23 | - type: textarea 24 | attributes: 25 | label: A Solution 26 | description: What is your proposed solution to the above problem? 27 | validations: 28 | required: true 29 | 30 | - type: textarea 31 | attributes: 32 | label: Alternatives 33 | description: | 34 | Alternative solutions or workarounds to the problem. 35 | You should also describe why these are not preferable to the given solution. 36 | validations: 37 | required: false 38 | 39 | - type: textarea 40 | attributes: 41 | label: Anything Else? 42 | description: Add any additional context you can provide below. 43 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Annotations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extension.platform; 21 | 22 | import com.google.auto.value.AutoAnnotation; 23 | import com.sk89q.worldedit.internal.annotation.Radii; 24 | 25 | /** 26 | * Holder for generated annotation classes. 27 | */ 28 | class Annotations { 29 | 30 | @AutoAnnotation 31 | static Radii radii(int value) { 32 | return new AutoAnnotation_Annotations_radii(value); 33 | } 34 | 35 | private Annotations() { 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/math/RegionOptimizedComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.math; 21 | 22 | import java.util.Comparator; 23 | 24 | /** 25 | * Sort block positions by region, chunk, and finally Y-Z-X. 26 | */ 27 | public class RegionOptimizedComparator { 28 | 29 | public static final Comparator INSTANCE 30 | = RegionOptimizedChunkComparator.INSTANCE 31 | .thenComparing(BlockVector3.sortByCoordsYzx()); 32 | 33 | private RegionOptimizedComparator() { 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionOperationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.regions; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.util.formatting.text.Component; 24 | 25 | public class RegionOperationException extends WorldEditException { 26 | 27 | @Deprecated 28 | public RegionOperationException(String msg) { 29 | super(msg); 30 | } 31 | 32 | public RegionOperationException(Component msg) { 33 | super(msg); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/ModificationTimerParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.snapshot; 21 | 22 | import java.io.File; 23 | import java.util.Calendar; 24 | import java.util.GregorianCalendar; 25 | 26 | public class ModificationTimerParser implements SnapshotDateParser { 27 | 28 | @Override 29 | public Calendar detectDate(File file) { 30 | Calendar cal = new GregorianCalendar(); 31 | cal.setTimeInMillis(file.lastModified()); 32 | return cal; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/regions/factory/CuboidRegionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.regions.factory; 21 | 22 | import com.sk89q.worldedit.math.BlockVector3; 23 | import com.sk89q.worldedit.regions.CuboidRegion; 24 | import com.sk89q.worldedit.regions.Region; 25 | 26 | public class CuboidRegionFactory implements RegionFactory { 27 | 28 | @Override 29 | public Region createCenteredAt(BlockVector3 position, double size) { 30 | return CuboidRegion.fromCenter(position, (int) size); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/share/ClipboardShareMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.clipboard.io.share; 21 | 22 | import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; 23 | 24 | /** 25 | * Items of metadata about shared clipboards. 26 | * 27 | * @param format the format of the clipboard 28 | * @param name the name of the clipboard 29 | * @param author the author of the clipboard 30 | */ 31 | public record ClipboardShareMetadata(ClipboardFormat format, String name, String author) { 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.sponge; 21 | 22 | import org.spongepowered.api.data.persistence.DataQuery; 23 | 24 | /** 25 | * Kinda mirrors Sponge Common's Constants class. 26 | * 27 | *

Internal. Do not use.

28 | */ 29 | public class Constants { 30 | public static class Sponge { 31 | public static final DataQuery UNSAFE_NBT = DataQuery.of("UnsafeData"); 32 | 33 | private Sponge() { 34 | } 35 | } 36 | 37 | private Constants() { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/RunContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.operation; 21 | 22 | /** 23 | * Describes the current run. 24 | */ 25 | public class RunContext { 26 | 27 | /** 28 | * Return whether the current operation should still continue running. 29 | * 30 | *

This method can be called frequently.

31 | * 32 | * @return true if the operation should continue running 33 | */ 34 | public boolean shouldContinue() { 35 | return true; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/task/TaskStateComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.task; 21 | 22 | import java.util.Comparator; 23 | 24 | /** 25 | * Compares task states according to the order of the {@link Task.State} 26 | * enumeration. 27 | */ 28 | public class TaskStateComparator implements Comparator> { 29 | 30 | @Override 31 | public int compare(com.sk89q.worldedit.util.task.Task o1, Task o2) { 32 | return Integer.compare(o1.getState().ordinal(), o2.getState().ordinal()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/ConfiguredFeatureType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.generation; 21 | 22 | import com.sk89q.worldedit.registry.Keyed; 23 | import com.sk89q.worldedit.registry.NamespacedRegistry; 24 | 25 | public record ConfiguredFeatureType(String id) implements Keyed { 26 | public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("configured feature type"); 27 | 28 | @Override 29 | public String toString() { 30 | return this.id; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWatchdog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.bukkit; 21 | 22 | import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; 23 | import com.sk89q.worldedit.extension.platform.Watchdog; 24 | 25 | class BukkitWatchdog implements Watchdog { 26 | 27 | private final BukkitImplAdapter adapter; 28 | 29 | BukkitWatchdog(BukkitImplAdapter adapter) { 30 | this.adapter = adapter; 31 | } 32 | 33 | @Override 34 | public void tick() { 35 | adapter.tickWatchdog(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/InsufficientArgumentsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.util.formatting.text.Component; 24 | 25 | public class InsufficientArgumentsException extends WorldEditException { 26 | 27 | @Deprecated 28 | public InsufficientArgumentsException(String error) { 29 | super(error); 30 | } 31 | 32 | public InsufficientArgumentsException(Component error) { 33 | super(error); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/ReorderingExtent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.reorder; 21 | 22 | import com.sk89q.worldedit.extent.Extent; 23 | 24 | /** 25 | * An interface for {@link Extent}s that are meant to reorder changes so 26 | * that they are more successful. 27 | * 28 | *

For example, torches in Minecraft need to be placed on a block. A smart 29 | * reordering implementation might place the torch after the block has 30 | * been placed.

31 | */ 32 | public interface ReorderingExtent extends Extent { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/SelectionShapeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.cui; 21 | 22 | public class SelectionShapeEvent implements CUIEvent { 23 | 24 | protected final String shapeName; 25 | 26 | public SelectionShapeEvent(String shapeName) { 27 | this.shapeName = shapeName; 28 | } 29 | 30 | @Override 31 | public String getTypeId() { 32 | return "s"; 33 | } 34 | 35 | @Override 36 | public String[] getParameters() { 37 | return new String[] { shapeName }; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-cli/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | plugins { 4 | `java-library` 5 | id("buildlogic.platform") 6 | } 7 | 8 | platform { 9 | kind = buildlogic.WorldEditKind.Standalone("com.sk89q.worldedit.cli.CLIWorldEdit") 10 | extraAttributes = mapOf( 11 | // We don't have any multi-release stuff, but Log4J does. 12 | "Multi-Release" to "true", 13 | ) 14 | } 15 | 16 | dependencies { 17 | "compileOnly"(project(":worldedit-libs:core:ap")) 18 | "annotationProcessor"(project(":worldedit-libs:core:ap")) 19 | "annotationProcessor"(libs.guava) 20 | "api"(project(":worldedit-core")) 21 | "implementation"(platform(libs.log4j.bom)) 22 | "implementation"(libs.log4j.api) 23 | "implementation"(libs.log4j.core) 24 | "implementation"(libs.commonsCli) 25 | "implementation"(libs.guava) 26 | "implementation"(libs.gson) 27 | } 28 | 29 | tasks.named("shadowJar") { 30 | dependencies { 31 | include { true } 32 | } 33 | minimize { 34 | exclude(dependency("org.apache.logging.log4j:log4j-core")) 35 | } 36 | } 37 | 38 | tasks.named("assemble").configure { 39 | dependsOn("shadowJar") 40 | } 41 | 42 | configure { 43 | publications.named("maven") { 44 | artifactId = the().archivesName.get() 45 | from(components["java"]) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/WorldUnloadedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; 24 | 25 | /** 26 | * Thrown if the world has been unloaded. 27 | */ 28 | public class WorldUnloadedException extends WorldEditException { 29 | 30 | /** 31 | * Create a new instance. 32 | */ 33 | public WorldUnloadedException() { 34 | super(TranslatableComponent.of("worldedit.error.world-unloaded")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/experimental/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /** 21 | * Experimental, in-testing, snapshot API. Do NOT rely on this API in plugin releases, as it will 22 | * move to the existing snapshot package when testing is complete. 23 | * 24 | *

25 | * The existing snapshot API will be removed when this API is made official. It aims to have 100% 26 | * compatibility with old snapshot storage, bar some odd date formats. 27 | *

28 | */ 29 | package com.sk89q.worldedit.world.snapshot.experimental; 30 | // TODO Un-experimentalize when ready. 31 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/InvalidComponentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.formatting.component; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.util.formatting.text.Component; 24 | 25 | public class InvalidComponentException extends WorldEditException { 26 | 27 | @Deprecated 28 | public InvalidComponentException(String message) { 29 | super(message); 30 | } 31 | 32 | public InvalidComponentException(Component message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/test/java/com/sk89q/worldedit/bukkit/BukkitWorldTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.bukkit; 21 | 22 | import com.sk89q.worldedit.util.TreeGenerator; 23 | import org.junit.jupiter.api.Test; 24 | 25 | import static org.junit.jupiter.api.Assertions.assertNotNull; 26 | 27 | public class BukkitWorldTest { 28 | 29 | @Test 30 | public void testTreeTypeMapping() { 31 | for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { 32 | assertNotNull(BukkitWorld.toBukkitTreeType(type), "No mapping for: " + type); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractFlatRegion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.regions; 21 | 22 | import com.sk89q.worldedit.world.World; 23 | 24 | public abstract class AbstractFlatRegion extends AbstractRegion implements FlatRegion { 25 | 26 | protected AbstractFlatRegion(World world) { 27 | super(world); 28 | } 29 | 30 | @Override 31 | public int getMinimumY() { 32 | return getMinimumPoint().y(); 33 | } 34 | 35 | @Override 36 | public int getMaximumY() { 37 | return getMaximumPoint().y(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/EntityRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.registry; 21 | 22 | import com.sk89q.worldedit.entity.BaseEntity; 23 | 24 | import javax.annotation.Nullable; 25 | 26 | /** 27 | * Provides information on entities. 28 | */ 29 | public interface EntityRegistry { 30 | 31 | /** 32 | * Create a new entity using its ID. 33 | * 34 | * @param id the id 35 | * @return the entity, which may be null if the entity does not exist 36 | */ 37 | @Nullable 38 | BaseEntity createFromId(String id); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.snapshot; 21 | 22 | import java.io.File; 23 | import java.util.Calendar; 24 | import javax.annotation.Nullable; 25 | 26 | /** 27 | * A name parser attempts to make sense of a filename for a snapshot. 28 | */ 29 | public interface SnapshotDateParser { 30 | 31 | /** 32 | * Attempt to detect a date from a file. 33 | * 34 | * @param file the file 35 | * @return date or null 36 | */ 37 | @Nullable 38 | Calendar detectDate(File file); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/VertHeight.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.annotation; 21 | 22 | import org.enginehub.piston.inject.InjectAnnotation; 23 | 24 | import java.lang.annotation.ElementType; 25 | import java.lang.annotation.Retention; 26 | import java.lang.annotation.RetentionPolicy; 27 | import java.lang.annotation.Target; 28 | 29 | /** 30 | * Indicates that this value is for holding the vertical height. 31 | */ 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.PARAMETER) 34 | @InjectAnnotation 35 | public @interface VertHeight { 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/regions/factory/SphereRegionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.regions.factory; 21 | 22 | import com.sk89q.worldedit.math.BlockVector3; 23 | import com.sk89q.worldedit.math.Vector3; 24 | import com.sk89q.worldedit.regions.EllipsoidRegion; 25 | import com.sk89q.worldedit.regions.Region; 26 | 27 | public class SphereRegionFactory implements RegionFactory { 28 | 29 | @Override 30 | public Region createCenteredAt(BlockVector3 position, double size) { 31 | return new EllipsoidRegion(position, Vector3.at(size, size, size)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/AbstractCancellable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event; 21 | 22 | /** 23 | * An abstract implementation of {@link Cancellable} that has all 24 | * of {@link Cancellable}'s methods implemented. 25 | */ 26 | public abstract class AbstractCancellable implements Cancellable { 27 | 28 | private boolean cancelled; 29 | 30 | @Override 31 | public boolean isCancelled() { 32 | return cancelled; 33 | } 34 | 35 | @Override 36 | public void setCancelled(boolean cancelled) { 37 | this.cancelled = cancelled; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Selection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.annotation; 21 | 22 | import org.enginehub.piston.inject.InjectAnnotation; 23 | 24 | import java.lang.annotation.ElementType; 25 | import java.lang.annotation.Retention; 26 | import java.lang.annotation.RetentionPolicy; 27 | import java.lang.annotation.Target; 28 | 29 | /** 30 | * Indicates that this value should come from the current selection. 31 | */ 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.PARAMETER) 34 | @InjectAnnotation 35 | public @interface Selection { 36 | } 37 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/LexerErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression; 21 | 22 | import org.antlr.v4.runtime.BaseErrorListener; 23 | import org.antlr.v4.runtime.RecognitionException; 24 | import org.antlr.v4.runtime.Recognizer; 25 | 26 | class LexerErrorListener extends BaseErrorListener { 27 | @Override 28 | public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { 29 | throw new LexerException(charPositionInLine, msg); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/ParserErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.internal.expression; 21 | 22 | import org.antlr.v4.runtime.BaseErrorListener; 23 | import org.antlr.v4.runtime.RecognitionException; 24 | import org.antlr.v4.runtime.Recognizer; 25 | 26 | class ParserErrorListener extends BaseErrorListener { 27 | @Override 28 | public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { 29 | throw new ParserException(charPositionInLine, msg); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/WorldEditResourceLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io; 21 | 22 | import com.sk89q.worldedit.WorldEdit; 23 | 24 | import java.nio.file.Path; 25 | 26 | public class WorldEditResourceLoader implements ResourceLoader { 27 | 28 | private final WorldEdit worldEdit; 29 | 30 | public WorldEditResourceLoader(WorldEdit worldEdit) { 31 | this.worldEdit = worldEdit; 32 | } 33 | 34 | @Override 35 | public Path getLocalResource(String pathName) { 36 | return this.worldEdit.getWorkingDirectoryPath(pathName); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/file/FileSelectionAbortedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io.file; 21 | 22 | import com.sk89q.worldedit.util.formatting.text.Component; 23 | 24 | public class FileSelectionAbortedException extends FilenameException { 25 | 26 | public FileSelectionAbortedException() { 27 | super(""); 28 | } 29 | 30 | @Deprecated 31 | public FileSelectionAbortedException(String msg) { 32 | super("", msg); 33 | } 34 | 35 | public FileSelectionAbortedException(Component msg) { 36 | super("", msg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-neoforge/src/main/java/com/sk89q/worldedit/neoforge/NeoForgeWatchdog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.neoforge; 21 | 22 | import com.sk89q.worldedit.extension.platform.Watchdog; 23 | import net.minecraft.Util; 24 | import net.minecraft.server.dedicated.DedicatedServer; 25 | 26 | class NeoForgeWatchdog implements Watchdog { 27 | 28 | private final DedicatedServer server; 29 | 30 | NeoForgeWatchdog(DedicatedServer server) { 31 | this.server = server; 32 | } 33 | 34 | @Override 35 | public void tick() { 36 | server.nextTickTimeNanos = Util.getNanos(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.cli; 21 | 22 | public interface CLIWorld { 23 | 24 | /** 25 | * Saves this world back to file if dirty or forced. 26 | * 27 | * @param force Force a save 28 | */ 29 | void save(boolean force); 30 | 31 | /** 32 | * Gets whether the world is dirty. 33 | * 34 | * @return If it's dirty 35 | */ 36 | boolean isDirty(); 37 | 38 | /** 39 | * Set the world's dirty status. 40 | * 41 | * @param dirty if dirty 42 | */ 43 | void setDirty(boolean dirty); 44 | } 45 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/blocks/TileEntityBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.blocks; 21 | 22 | import com.sk89q.worldedit.world.NbtValued; 23 | 24 | /** 25 | * Indicates a block that contains extra data identified as an NBT structure. 26 | * Compared to a {@link NbtValued}, tile entity blocks also contain an ID. 27 | * 28 | * @see NbtValued 29 | */ 30 | public interface TileEntityBlock extends NbtValued { 31 | 32 | /** 33 | * Return the name of the title entity ID. 34 | * 35 | * @return tile entity ID, non-null string 36 | */ 37 | String getNbtId(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/EntityFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.entity.Entity; 24 | 25 | /** 26 | * Applies a function to entities. 27 | */ 28 | public interface EntityFunction { 29 | 30 | /** 31 | * Apply the function to the entity. 32 | * 33 | * @param entity the entity 34 | * @return true if something was changed 35 | * @throws WorldEditException thrown on an error 36 | */ 37 | boolean apply(Entity entity) throws WorldEditException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/task/Supervisor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.task; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * Manages running tasks and informs users of their progress, but does not 26 | * execute the task. 27 | */ 28 | public interface Supervisor { 29 | 30 | /** 31 | * Get a list of running or queued tasks. 32 | * 33 | * @return a list of tasks 34 | */ 35 | List> getTasks(); 36 | 37 | /** 38 | * Monitor the given task. 39 | * 40 | * @param task the task 41 | */ 42 | void monitor(Task task); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.cli; 21 | 22 | import com.sk89q.worldedit.util.PropertiesConfiguration; 23 | 24 | import java.nio.file.Path; 25 | 26 | public class CLIConfiguration extends PropertiesConfiguration { 27 | 28 | public CLIConfiguration(CLIWorldEdit app) { 29 | super(app.getWorkingDir().resolve("worldedit.properties")); 30 | } 31 | 32 | @Override 33 | protected void loadExtra() { 34 | } 35 | 36 | @Override 37 | public Path getWorkingDirectoryPath() { 38 | return CLIWorldEdit.inst.getWorkingDir(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/AdapterLoadException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.bukkit.adapter; 21 | 22 | /** 23 | * Thrown when no adapter can be found. 24 | */ 25 | public class AdapterLoadException extends Exception { 26 | 27 | public AdapterLoadException() { 28 | } 29 | 30 | public AdapterLoadException(String message) { 31 | super(message); 32 | } 33 | 34 | public AdapterLoadException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public AdapterLoadException(Throwable cause) { 39 | super(cause); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/Cancellable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event; 21 | 22 | /** 23 | * Marks an event that has a cancellable state. The meaning of cancellation 24 | * depends on the event. 25 | */ 26 | public interface Cancellable { 27 | 28 | /** 29 | * Returns whether the event has been cancelled. 30 | * 31 | * @return true if cancelled 32 | */ 33 | boolean isCancelled(); 34 | 35 | /** 36 | * Set whether the event has been cancelled. 37 | * 38 | * @param cancelled true if cancelled 39 | */ 40 | void setCancelled(boolean cancelled); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/VoidStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.session.storage; 21 | 22 | import com.sk89q.worldedit.LocalSession; 23 | 24 | import java.io.IOException; 25 | import java.util.UUID; 26 | 27 | /** 28 | * A session store that doesn't know how to store sessions. 29 | */ 30 | public class VoidStore implements SessionStore { 31 | 32 | @Override 33 | public LocalSession load(UUID id) throws IOException { 34 | return new LocalSession(); 35 | } 36 | 37 | @Override 38 | public void save(UUID id, LocalSession session) throws IOException { 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/session/MissingSessionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.session; 21 | 22 | /** 23 | * Raised when the session is missing. 24 | */ 25 | public class MissingSessionException extends Exception { 26 | 27 | public MissingSessionException() { 28 | } 29 | 30 | public MissingSessionException(String message) { 31 | super(message); 32 | } 33 | 34 | public MissingSessionException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public MissingSessionException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/internal/LocaleResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.sponge.internal; 21 | 22 | import com.sk89q.worldedit.WorldEdit; 23 | import net.kyori.adventure.audience.Audience; 24 | import org.spongepowered.api.util.locale.LocaleSource; 25 | 26 | import java.util.Locale; 27 | 28 | public class LocaleResolver { 29 | public static Locale resolveLocale(Audience audience) { 30 | if (audience instanceof LocaleSource) { 31 | return ((LocaleSource) audience).locale(); 32 | } 33 | return WorldEdit.getInstance().getConfiguration().defaultLocale; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/Tool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.command.tool; 21 | 22 | import com.sk89q.worldedit.extension.platform.Actor; 23 | 24 | /** 25 | * Represents a tool. This interface alone defines nothing. A tool also 26 | * has to implement {@code BlockTool} or {@code TraceTool}. 27 | */ 28 | public interface Tool { 29 | 30 | /** 31 | * Checks to see if the player can still be using this tool (considering 32 | * permissions and such). 33 | * 34 | * @param actor the actor 35 | * @return true if use is permitted 36 | */ 37 | boolean canUse(Actor actor); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlatformEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.event.platform; 21 | 22 | import com.sk89q.worldedit.event.Event; 23 | import com.sk89q.worldedit.extension.platform.Platform; 24 | 25 | public abstract class PlatformEvent extends Event { 26 | private final Platform platform; 27 | 28 | protected PlatformEvent(Platform platform) { 29 | this.platform = platform; 30 | } 31 | 32 | /** 33 | * Get the platform for this event. 34 | * 35 | * @return the platform 36 | */ 37 | public Platform getPlatform() { 38 | return platform; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.world.chunk; 21 | 22 | import com.sk89q.worldedit.math.BlockVector3; 23 | import com.sk89q.worldedit.world.DataException; 24 | import com.sk89q.worldedit.world.block.BaseBlock; 25 | 26 | /** 27 | * A 16 by 16 block chunk. 28 | */ 29 | public interface Chunk { 30 | 31 | /** 32 | * Get a block. 33 | * 34 | * @param position the position of the block 35 | * @return block the block 36 | * @throws DataException thrown on data error 37 | */ 38 | BaseBlock getBlock(BlockVector3 position) throws DataException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.minecraft.util.commands; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | /** 26 | * Indicates a list of permissions that should be checked. 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Deprecated 30 | public @interface CommandPermissions { 31 | 32 | /** 33 | * A list of permissions. Only one permission has to be met 34 | * for the command to be permitted. 35 | * 36 | * @return a list of permissions strings 37 | */ 38 | String[] value(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.clipboard.io; 21 | 22 | import com.sk89q.worldedit.extent.clipboard.Clipboard; 23 | 24 | import java.io.Closeable; 25 | import java.io.IOException; 26 | 27 | /** 28 | * Writes {@code Clipboard}s. 29 | * 30 | * @see Clipboard 31 | */ 32 | public interface ClipboardWriter extends Closeable { 33 | 34 | /** 35 | * Writes a clipboard. 36 | * 37 | * @param clipboard the clipboard 38 | * @throws IOException thrown on I/O error 39 | */ 40 | void write(Clipboard clipboard) throws IOException; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | import com.sk89q.worldedit.math.BlockVector3; 24 | 25 | /** 26 | * Performs a function on points in a region. 27 | */ 28 | public interface RegionFunction { 29 | 30 | /** 31 | * Apply the function to the given position. 32 | * 33 | * @param position the position 34 | * @return true if something was changed 35 | * @throws WorldEditException thrown on an error 36 | */ 37 | boolean apply(BlockVector3 position) throws WorldEditException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractExtentPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.function.pattern; 21 | 22 | import com.sk89q.worldedit.extent.Extent; 23 | 24 | import static com.google.common.base.Preconditions.checkNotNull; 25 | 26 | public abstract class AbstractExtentPattern extends AbstractPattern implements ExtentPattern { 27 | 28 | private final Extent extent; 29 | 30 | public AbstractExtentPattern(Extent extent) { 31 | this.extent = extent; 32 | checkNotNull(extent); 33 | } 34 | 35 | @Override 36 | public Extent getExtent() { 37 | return extent; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/function/IORunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.function; 21 | 22 | import java.io.IOException; 23 | import java.io.UncheckedIOException; 24 | 25 | /** 26 | * I/O runnable type. 27 | */ 28 | @FunctionalInterface 29 | public interface IORunnable { 30 | 31 | static Runnable unchecked(IORunnable runnable) { 32 | return () -> { 33 | try { 34 | runnable.run(); 35 | } catch (IOException e) { 36 | throw new UncheckedIOException(e); 37 | } 38 | }; 39 | } 40 | 41 | void run() throws IOException; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/file/InvalidFilenameException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io.file; 21 | 22 | import com.sk89q.worldedit.util.formatting.text.Component; 23 | 24 | public class InvalidFilenameException extends FilenameException { 25 | 26 | public InvalidFilenameException(String filename) { 27 | super(filename); 28 | } 29 | 30 | public InvalidFilenameException(String filename, Component msg) { 31 | super(filename, msg); 32 | } 33 | 34 | @Deprecated 35 | public InvalidFilenameException(String filename, String msg) { 36 | super(filename, msg); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/share/ShareOutputProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.extent.clipboard.io.share; 21 | 22 | import com.sk89q.worldedit.WorldEditException; 23 | 24 | import java.io.IOException; 25 | import java.io.OutputStream; 26 | 27 | @FunctionalInterface 28 | public interface ShareOutputProvider { 29 | 30 | /** 31 | * Provides the share output to {@code stream}. 32 | * 33 | * @throws IOException if it failed 34 | * @throws WorldEditException if WorldEdit failed to serialize to the stream 35 | */ 36 | void writeTo(OutputStream stream) throws IOException, WorldEditException; 37 | } 38 | -------------------------------------------------------------------------------- /worldedit-core/src/main/java/com/sk89q/worldedit/util/io/file/ArchiveNioSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WorldEdit, a Minecraft world manipulation toolkit 3 | * Copyright (C) sk89q 4 | * Copyright (C) WorldEdit team and contributors 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | package com.sk89q.worldedit.util.io.file; 21 | 22 | import java.io.IOException; 23 | import java.nio.file.Path; 24 | import java.util.Optional; 25 | 26 | /** 27 | * Something that can provide access to an archive file as a file system. 28 | */ 29 | public interface ArchiveNioSupport { 30 | 31 | /** 32 | * Try to open the given archive as a file system. 33 | * 34 | * @param archive the archive to open 35 | * @return the path for the root of the archive, if available 36 | */ 37 | Optional tryOpenAsDir(Path archive) throws IOException; 38 | 39 | } 40 | --------------------------------------------------------------------------------