├── .github
├── FUNDING.yml
├── stale.yml
└── workflows
│ └── build.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docs
├── api
│ ├── index.md
│ ├── networking.md
│ └── version
│ │ ├── v10.md
│ │ ├── v7.md
│ │ ├── v8.md
│ │ └── v9.md
├── commands.md
├── config.md
├── css
│ └── extra.css
├── index.md
├── languages.md
├── permissions.md
└── tools-integrations.md
├── lang
├── de.yml
├── en.yml
├── es.yml
├── fr.yml
├── ja.yml
├── ko.yml
├── pl.yml
├── ru.yml
├── tr.yml
├── uk.yml
├── vi.yml
├── zh-cn.yml
└── zh-tw.yml
├── mkdocs.yml
├── pom.xml
├── requirements.txt
└── src
└── main
├── java
└── net
│ └── coreprotect
│ ├── CoreProtect.java
│ ├── CoreProtectAPI.java
│ ├── api
│ ├── BlockAPI.java
│ ├── QueueLookup.java
│ ├── SessionLookup.java
│ └── result
│ │ └── ParseResult.java
│ ├── bukkit
│ ├── BukkitAdapter.java
│ ├── BukkitInterface.java
│ ├── Bukkit_v1_17.java
│ ├── Bukkit_v1_18.java
│ ├── Bukkit_v1_19.java
│ ├── Bukkit_v1_20.java
│ └── Bukkit_v1_21.java
│ ├── command
│ ├── ApplyCommand.java
│ ├── CancelCommand.java
│ ├── CommandHandler.java
│ ├── CommandParser.java
│ ├── ConsumerCommand.java
│ ├── HelpCommand.java
│ ├── InspectCommand.java
│ ├── LookupCommand.java
│ ├── NetworkDebugCommand.java
│ ├── PurgeCommand.java
│ ├── ReloadCommand.java
│ ├── RollbackRestoreCommand.java
│ ├── StatusCommand.java
│ ├── TabHandler.java
│ ├── TeleportCommand.java
│ ├── UndoCommand.java
│ ├── WorldEditHandler.java
│ ├── lookup
│ │ ├── BlockLookupThread.java
│ │ ├── ChestTransactionLookupThread.java
│ │ └── StandardLookupThread.java
│ └── parser
│ │ ├── ActionParser.java
│ │ ├── LocationParser.java
│ │ ├── MaterialParser.java
│ │ ├── TimeParser.java
│ │ ├── UserParser.java
│ │ └── WorldParser.java
│ ├── config
│ ├── Config.java
│ ├── ConfigFile.java
│ └── ConfigHandler.java
│ ├── consumer
│ ├── Consumer.java
│ ├── Queue.java
│ └── process
│ │ ├── ArtInsertProcess.java
│ │ ├── BlockBreakProcess.java
│ │ ├── BlockDataInsertProcess.java
│ │ ├── BlockPlaceProcess.java
│ │ ├── ContainerBreakProcess.java
│ │ ├── ContainerTransactionProcess.java
│ │ ├── EntityInsertProcess.java
│ │ ├── EntityKillProcess.java
│ │ ├── EntitySpawnProcess.java
│ │ ├── ItemTransactionProcess.java
│ │ ├── MaterialInsertProcess.java
│ │ ├── NaturalBlockBreakProcess.java
│ │ ├── PlayerChatProcess.java
│ │ ├── PlayerCommandProcess.java
│ │ ├── PlayerInteractionProcess.java
│ │ ├── PlayerKillProcess.java
│ │ ├── PlayerLoginProcess.java
│ │ ├── PlayerLogoutProcess.java
│ │ ├── Process.java
│ │ ├── RollbackUpdateProcess.java
│ │ ├── SignTextProcess.java
│ │ ├── SignUpdateProcess.java
│ │ ├── SkullUpdateProcess.java
│ │ ├── StructureGrowthProcess.java
│ │ └── WorldInsertProcess.java
│ ├── database
│ ├── BlockLookup.java
│ ├── ContainerRollback.java
│ ├── Database.java
│ ├── Lookup.java
│ ├── LookupConverter.java
│ ├── LookupRaw.java
│ ├── logger
│ │ ├── BlockBreakLogger.java
│ │ ├── BlockPlaceLogger.java
│ │ ├── ChatLogger.java
│ │ ├── CommandLogger.java
│ │ ├── ContainerBreakLogger.java
│ │ ├── ContainerLogger.java
│ │ ├── EntityKillLogger.java
│ │ ├── ItemLogger.java
│ │ ├── PlayerInteractLogger.java
│ │ ├── PlayerKillLogger.java
│ │ ├── PlayerSessionLogger.java
│ │ ├── SignTextLogger.java
│ │ ├── SkullBreakLogger.java
│ │ ├── SkullPlaceLogger.java
│ │ └── UsernameLogger.java
│ ├── lookup
│ │ ├── BlockLookup.java
│ │ ├── ChestTransactionLookup.java
│ │ ├── InteractionLookup.java
│ │ ├── PlayerLookup.java
│ │ └── SignMessageLookup.java
│ ├── rollback
│ │ ├── Rollback.java
│ │ ├── RollbackBlockHandler.java
│ │ ├── RollbackComplete.java
│ │ ├── RollbackEntityHandler.java
│ │ ├── RollbackItemHandler.java
│ │ ├── RollbackProcessor.java
│ │ └── RollbackUtil.java
│ └── statement
│ │ ├── BlockStatement.java
│ │ ├── ChatStatement.java
│ │ ├── CommandStatement.java
│ │ ├── ContainerStatement.java
│ │ ├── EntityStatement.java
│ │ ├── ItemStatement.java
│ │ ├── MaterialStatement.java
│ │ ├── SessionStatement.java
│ │ ├── SignStatement.java
│ │ ├── SkullStatement.java
│ │ ├── UserStatement.java
│ │ └── WorldStatement.java
│ ├── event
│ └── CoreProtectPreLogEvent.java
│ ├── language
│ ├── Language.java
│ ├── Phrase.java
│ └── Selector.java
│ ├── listener
│ ├── ListenerHandler.java
│ ├── block
│ │ ├── BlockBreakListener.java
│ │ ├── BlockBurnListener.java
│ │ ├── BlockDispenseListener.java
│ │ ├── BlockExplodeListener.java
│ │ ├── BlockFadeListener.java
│ │ ├── BlockFertilizeListener.java
│ │ ├── BlockFormListener.java
│ │ ├── BlockFromToListener.java
│ │ ├── BlockIgniteListener.java
│ │ ├── BlockPistonListener.java
│ │ ├── BlockPlaceListener.java
│ │ ├── BlockSpreadListener.java
│ │ ├── BlockUtil.java
│ │ └── CampfireStartListener.java
│ ├── channel
│ │ ├── PluginChannelHandshakeListener.java
│ │ └── PluginChannelListener.java
│ ├── entity
│ │ ├── CreatureSpawnListener.java
│ │ ├── EntityBlockFormListener.java
│ │ ├── EntityChangeBlockListener.java
│ │ ├── EntityDamageByBlockListener.java
│ │ ├── EntityDamageByEntityListener.java
│ │ ├── EntityDeathListener.java
│ │ ├── EntityExplodeListener.java
│ │ ├── EntityInteractListener.java
│ │ ├── EntityPickupItemListener.java
│ │ ├── HangingBreakByEntityListener.java
│ │ ├── HangingBreakListener.java
│ │ └── HangingPlaceListener.java
│ ├── player
│ │ ├── ArmorStandManipulateListener.java
│ │ ├── CraftItemListener.java
│ │ ├── FoodLevelChangeListener.java
│ │ ├── HopperPullListener.java
│ │ ├── HopperPushListener.java
│ │ ├── InventoryChangeListener.java
│ │ ├── InventoryClickListener.java
│ │ ├── PlayerBucketEmptyListener.java
│ │ ├── PlayerBucketFillListener.java
│ │ ├── PlayerChatListener.java
│ │ ├── PlayerCommandListener.java
│ │ ├── PlayerDeathListener.java
│ │ ├── PlayerDropItemListener.java
│ │ ├── PlayerInteractEntityListener.java
│ │ ├── PlayerInteractListener.java
│ │ ├── PlayerInteractUtils.java
│ │ ├── PlayerItemBreakListener.java
│ │ ├── PlayerJoinListener.java
│ │ ├── PlayerPickupArrowListener.java
│ │ ├── PlayerQuitListener.java
│ │ ├── PlayerTakeLecternBookListener.java
│ │ ├── ProjectileLaunchListener.java
│ │ ├── SignChangeListener.java
│ │ └── inspector
│ │ │ ├── BaseInspector.java
│ │ │ ├── BlockInspector.java
│ │ │ ├── ContainerInspector.java
│ │ │ ├── InteractionInspector.java
│ │ │ └── SignInspector.java
│ └── world
│ │ ├── ChunkPopulateListener.java
│ │ ├── LeavesDecayListener.java
│ │ ├── PortalCreateListener.java
│ │ └── StructureGrowListener.java
│ ├── model
│ └── BlockGroup.java
│ ├── paper
│ ├── PaperAdapter.java
│ ├── PaperHandler.java
│ ├── PaperInterface.java
│ ├── Paper_v1_17.java
│ ├── Paper_v1_20.java
│ └── listener
│ │ ├── BlockPreDispenseListener.java
│ │ └── PaperChatListener.java
│ ├── patch
│ ├── Patch.java
│ └── script
│ │ ├── __2_10_0.java
│ │ ├── __2_11_0.java
│ │ ├── __2_15_0.java
│ │ ├── __2_16_0.java
│ │ ├── __2_17_0.java
│ │ ├── __2_18_0.java
│ │ ├── __2_18_1.java
│ │ ├── __2_19_0.java
│ │ ├── __2_20_0.java
│ │ ├── __2_21_0.java
│ │ ├── __2_22_0.java
│ │ ├── __2_23_0.java
│ │ ├── __2_23_1.java
│ │ ├── __2_5_0.java
│ │ └── __2_6_0.java
│ ├── services
│ ├── PluginInitializationService.java
│ ├── ShutdownService.java
│ └── VersionCheckService.java
│ ├── spigot
│ ├── SpigotAdapter.java
│ ├── SpigotHandler.java
│ └── SpigotInterface.java
│ ├── thread
│ ├── CacheHandler.java
│ ├── NetworkHandler.java
│ └── Scheduler.java
│ ├── utility
│ ├── BlockUtils.java
│ ├── Chat.java
│ ├── ChatMessage.java
│ ├── ChatUtils.java
│ ├── ChestTool.java
│ ├── Color.java
│ ├── DatabaseUtils.java
│ ├── EntityUtils.java
│ ├── Extensions.java
│ ├── ItemUtils.java
│ ├── MaterialUtils.java
│ ├── StringUtils.java
│ ├── SystemUtils.java
│ ├── Teleport.java
│ ├── Util.java
│ ├── Validate.java
│ ├── VersionUtils.java
│ ├── WorldUtils.java
│ ├── entity
│ │ ├── EntityUtil.java
│ │ └── HangingUtil.java
│ └── serialize
│ │ └── ItemMetaHandler.java
│ └── worldedit
│ ├── CoreProtectEditSessionEvent.java
│ ├── CoreProtectLogger.java
│ ├── WorldEditBlockState.java
│ └── WorldEditLogger.java
└── resources
└── plugin.yml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | patreon: coreprotect
2 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | daysUntilStale: 60
2 | daysUntilClose: 7
3 | exemptLabels:
4 | - 'accepted'
5 | - 'bug'
6 | - 'suggestion'
7 | - 'help wanted'
8 | staleLabel: stale
9 | markComment: >
10 | This issue has been automatically marked as stale because it has not had
11 | recent activity. It will be closed if no further activity occurs. Thank you
12 | for your contributions.
13 | closeComment: false
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 | types: [opened, synchronize, reopened]
8 | jobs:
9 | build:
10 | name: Build
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v4
14 | with:
15 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16 | - name: Set up JDK 21
17 | uses: actions/setup-java@v4
18 | with:
19 | java-version: '21'
20 | distribution: 'temurin'
21 | - name: Cache Maven packages
22 | uses: actions/cache@v4
23 | with:
24 | path: ~/.m2
25 | key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
26 | restore-keys: ${{ runner.os }}-m2
27 | - name: Build
28 | run: mvn -B verify
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [](LICENSE)
4 | [](https://github.com/PlayPro/CoreProtect/actions)
5 | [](https://app.netlify.com/sites/coreprotect/deploys)
6 | [](https://www.codefactor.io/repository/github/playpro/coreprotect)
7 | [](https://discord.gg/b4DZ4jy)
8 |
9 | CoreProtect
10 | ===========
11 |
12 | CoreProtect is a blazing fast data logging and anti-griefing tool for Minecraft servers.
13 |
14 | For a detailed description of the plugin, please visit [coreprotect.net](https://coreprotect.net).
15 |
16 | | Quick Links | |
17 | | --- | --- |
18 | | CoreProtect Discord: | [discord.gg/b4DZ4jy](https://discord.gg/b4DZ4jy) |
19 | | CoreProtect Patreon: | [patreon.com/coreprotect](https://www.patreon.com/coreprotect) |
20 | | CoreProtect Documentation: | [docs.coreprotect.net](https://docs.coreprotect.net) |
21 | | Downloads for MC 1.14 - 1.20: | [coreprotect.net/latest](https://coreprotect.net/latest/) |
22 | | Downloads for MC 1.8 - 1.12: | [coreprotect.net/legacy](https://coreprotect.net/legacy/) |
23 |
24 | bStats
25 | ------
26 | [](https://bstats.org/plugin/bukkit/CoreProtect)
27 |
28 | API
29 | ------
30 | ### [API Documentation](https://docs.coreprotect.net/api/)
31 |
32 | ### Dependency Information
33 | Maven
34 | ```xml
35 |
36 | playpro-repo
37 | https://maven.playpro.com
38 |
39 | ```
40 | ```xml
41 |
42 | net.coreprotect
43 | coreprotect
44 | 22.4
45 | provided
46 |
47 | ```
48 |
49 | Contributing
50 | ------
51 | CoreProtect is an open source project, and gladly accepts community contributions.
52 |
53 | If you'd like to contribute, please read our contributing guidelines here: [CONTRIBUTING.md](CONTRIBUTING.md)
54 |
55 | [](CONTRIBUTING.md#code-of-conduct)
--------------------------------------------------------------------------------
/docs/api/index.md:
--------------------------------------------------------------------------------
1 | # CoreProtect API
2 |
3 | The CoreProtect API enables you to log your own block changes, perform lookups, rollbacks, restores, and more.
4 |
5 | | API Details | |
6 | | --- | --- |
7 | | **API Version:** | 10 |
8 | | **Plugin Version:** | v22.4+ |
9 | | **Maven:** | [maven.playpro.com](https://maven.playpro.com) |
10 |
11 | *Documentation for the API version 10 can be found [here](/api/version/v10/).*
--------------------------------------------------------------------------------
/docs/config.md:
--------------------------------------------------------------------------------
1 | # Configuration
2 |
3 | The CoreProtect configuration file can be found within the CoreProtect folder, at `config.yml`.
4 |
5 | ## Per-World Configuration
6 |
7 | If you'd like to modify the logging settings for a specific world, simply do the following:
8 |
9 | 1. Copy the config.yml file to the name of the world (e.g. world_nether.yml)
10 | 2. In the new file, modify the logging settings as desired.
11 | 3. Either restart your server, or type "/co reload" in-game.
12 |
13 | Secondary configuration files override the value specified in config.yml. If you leave an option out of a secondary configuration file, then the option specified in config.yml will be used.
14 |
15 | #### Examples
16 | * If you'd like to disable all logging for the End, copy the `config.yml` file to `world_the_end.yml` (matching the folder name for the world). Then, simply disable all logging options within the new file.
17 | * If you just want to disable entity death logging in the Nether, but keep all other logging options the same, simply create a file named `world_nether.yml` containing the text "rollback-entities: false".
18 |
19 | ## Disabling Logging
20 |
21 | To disable logging for specific users, blocks or commands, simply do the following:
22 |
23 | 1. In the CoreProtect plugin directory, create a file named `blacklist.txt`.
24 | 2. Enter the names of the users (or commands) you'd like to disable logging for (each username on a new line).
25 | 3. Either restart your server, or type "/co reload" in-game.
26 |
27 | This can be used to disable logging for non-player users, such as "#creeper". For example, if you'd like to disable logging for the user "Notch", TNT explosions, stone blocks, and the "/help" command, the blacklist.txt file would look like this:
28 | ```text
29 | Notch
30 | #tnt
31 | /help
32 | minecraft:stone
33 | ```
34 |
35 | *Please note that to disable logging for blocks, CoreProtect v23+ is required, and you must include the namespace. For example, to disable logging for dirt, you must add it as "minecraft:dirt".*
--------------------------------------------------------------------------------
/docs/css/extra.css:
--------------------------------------------------------------------------------
1 | /*Customization for blockquote appearance*/
2 | blockquote {
3 | border-left: 5px solid #ccc;
4 | padding-left: 20px;
5 | margin-left: 0px!important;
6 | }
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Welcome to the CoreProtect Documentation
2 |
3 | For more information about CoreProtect, visit [coreprotect.net](http://coreprotect.net).
4 |
5 | ## Getting Started
6 |
7 | Please visit one of the following links for more information.
8 |
9 | [**CoreProtect Commands**](/commands/)
10 | A list of all commands that can be used within CoreProtect.
11 |
12 | [**CoreProtect Permissions**](/permissions/)
13 | A list of all permissions that can be used with CoreProtect.
14 |
15 | [**CoreProtect Language Codes**](/languages/)
16 | A list of all language codes that can be used with CoreProtect.
17 |
18 | [**CoreProtect API Documentation**](/api/)
19 | Log your own block changes, perform lookups, rollbacks, restores, and more.
20 |
21 | [**Compatible Third-Party Plugins & Tools**](/tools-integrations/)
22 | A list of plugins and tools that are compatible with CoreProtect.
23 |
24 | [**Per-World Configuration Files**](/config/#per-world-configuration)
25 | Modify the logging settings for a specific world on your server.
26 |
27 | [**Disable Logging With a Blacklist**](/config/#disabling-logging)
28 | Disable logging for specific users, blocks or commands.
29 |
--------------------------------------------------------------------------------
/docs/languages.md:
--------------------------------------------------------------------------------
1 | # Languages
2 |
3 | Language codes can be entered in `config.yml` for automatic online translation.
4 |
5 | ---
6 |
7 | ## CoreProtect Language Codes
8 |
9 | | Language | Code |
10 | | --- | --- |
11 | | Afrikaans | `af` |
12 | | Albanian | `sq` |
13 | | Amharic | `am` |
14 | | Arabic | `ar` |
15 | | Armenian | `hy` |
16 | | Azerbaijani | `az` |
17 | | Basque | `eu` |
18 | | Belarusian | `be` |
19 | | Bengali | `bn` |
20 | | Bosnian | `bs` |
21 | | Bulgarian | `bg` |
22 | | Catalan | `ca` |
23 | | Cebuano | `ceb` |
24 | | Chinese (Simplified) | `zh-CN` or `zh` |
25 | | Chinese (Traditional) | `zh-TW` |
26 | | Corsican | `co` |
27 | | Croatian | `hr` |
28 | | Czech | `cs` |
29 | | Danish | `da` |
30 | | Dutch | `nl` |
31 | | English | `en` |
32 | | Esperanto | `eo` |
33 | | Estonian | `et` |
34 | | Finnish | `fi` |
35 | | French | `fr` |
36 | | Frisian | `fy` |
37 | | Galician | `gl` |
38 | | Georgian | `ka` |
39 | | German | `de` |
40 | | Greek | `el` |
41 | | Gujarati | `gu` |
42 | | Haitian Creole | `ht` |
43 | | Hausa | `ha` |
44 | | Hawaiian | `haw` |
45 | | Hebrew | `he` or `iw` |
46 | | Hindi | `hi` |
47 | | Hmong | `hmn` |
48 | | Hungarian | `hu` |
49 | | Icelandic | `is` |
50 | | Igbo | `ig` |
51 | | Indonesian | `id` |
52 | | Irish | `ga` |
53 | | Italian | `it` |
54 | | Japanese | `ja` |
55 | | Javanese | `jv` |
56 | | Kannada | `kn` |
57 | | Kazakh | `kk` |
58 | | Khmer | `km` |
59 | | Kinyarwanda | `rw` |
60 | | Korean | `ko` |
61 | | Kurdish | `ku` |
62 | | Kyrgyz | `ky` |
63 | | Lao | `lo` |
64 | | Latin | `la` |
65 | | Latvian | `lv` |
66 | | Lithuanian | `lt` |
67 | | Luxembourgish | `lb` |
68 | | Macedonian | `mk` |
69 | | Malagasy | `mg` |
70 | | Malay | `ms` |
71 | | Malayalam | `ml` |
72 | | Maltese | `mt` |
73 | | Maori | `mi` |
74 | | Marathi | `mr` |
75 | | Mongolian | `mn` |
76 | | Myanmar (Burmese) | `my` |
77 | | Nepali | `ne` |
78 | | Norwegian | `no` |
79 | | Nyanja (Chichewa) | `ny` |
80 | | Odia (Oriya) | `or` |
81 | | Pashto | `ps` |
82 | | Persian | `fa` |
83 | | Polish | `pl` |
84 | | Portuguese (Portugal, Brazil) | `pt` |
85 | | Punjabi | `pa` |
86 | | Romanian | `ro` |
87 | | Russian | `ru` |
88 | | Samoan | `sm` |
89 | | Scots Gaelic | `gd` |
90 | | Serbian | `sr` |
91 | | Sesotho | `st` |
92 | | Shona | `sn` |
93 | | Sindhi | `sd` |
94 | | Sinhala (Sinhalese) | `si` |
95 | | Slovak | `sk` |
96 | | Slovenian | `sl` |
97 | | Somali | `so` |
98 | | Spanish | `es` |
99 | | Sundanese | `su` |
100 | | Swahili | `sw` |
101 | | Swedish | `sv` |
102 | | Tagalog (Filipino) | `tl` |
103 | | Tajik | `tg` |
104 | | Tamil | `ta` |
105 | | Tatar | `tt` |
106 | | Telugu | `te` |
107 | | Thai | `th` |
108 | | Turkish | `tr` |
109 | | Turkmen | `tk` |
110 | | Ukrainian | `uk` |
111 | | Urdu | `ur` |
112 | | Uyghur | `ug` |
113 | | Uzbek | `uz` |
114 | | Vietnamese | `vi` |
115 | | Welsh | `cy` |
116 | | Xhosa | `xh` |
117 | | Yiddish | `yi` |
118 | | Yoruba | `yo` |
119 | | Zulu | `zu` |
120 |
121 | *Source: [cloud.google.com/translate](https://cloud.google.com/translate/docs/languages)*
122 |
123 | ---
--------------------------------------------------------------------------------
/docs/tools-integrations.md:
--------------------------------------------------------------------------------
1 | # Tools & Integrations
2 |
3 | Listed below are links to plugins and tools compatible with CoreProtect.
4 |
5 | These plugins/tools are maintained by third parties, and may have issues outside of our control.
6 |
7 | ---
8 |
9 | ## Plugins
10 |
11 | * **WorldEdit**
12 | Use WorldEdit selections as a radius, and log your WorldEdit changes.
13 | [https://dev.bukkit.org/projects/worldedit](https://dev.bukkit.org/projects/worldedit)
14 |
15 |
16 | * **CoreProtect-Anti-Xray**
17 | Displays how many ores a player has destroyed in a specific time span.
18 | [https://dev.bukkit.org/bukkit-plugins/coreprotect-anti-xray/](https://dev.bukkit.org/bukkit-plugins/coreprotect-anti-xray/)
19 |
20 |
21 | * **CoreProtect TNT**
22 | The CoreProtect TNT extension adds logging for TNT and creeper explosion sources.
23 | [https://www.spigotmc.org/resources/coreprotect-tnt-log-tnt-creeper-explode-source.69609/](https://www.spigotmc.org/resources/coreprotect-tnt-log-tnt-creeper-explode-source.69609/)
24 |
25 |
26 | * **CoreProtect Time-Lapse**
27 | CPTL is an add-on tool for CoreProtect used to create a time-lapse from historical data.
28 | [https://modrinth.com/plugin/cptl](https://modrinth.com/plugin/cptl)
29 |
30 |
31 | ## Tools
32 |
33 | * **CoreProtect Lookup Web Interface**
34 | Search through your CoreProtect history with an easy-to-use interface.
35 | [https://www.spigotmc.org/resources/coreprotect-lookup-web-interface.28033/](https://www.spigotmc.org/resources/coreprotect-lookup-web-interface.28033/)
36 |
37 |
38 | * **Watson**
39 | Watson is a client side Minecraft mod that displays CoreProtect logs in 3D.
40 | [https://github.com/vacla/Watson](https://github.com/vacla/Watson)
41 |
42 |
43 |
44 | ---
45 |
46 | Have you created a plugin that's compatible with CoreProtect?
47 | Let us know to have it added to this list!
48 |
49 | ---
50 |
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: CoreProtect Documentation
2 | site_url: https://docs.coreprotect.net
3 | theme: readthedocs
4 | repo_url: https://github.com/PlayPro/CoreProtect
5 | docs_dir: 'docs'
6 | extra_css:
7 | - css/extra.css
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | mkdocs==1.3.1
--------------------------------------------------------------------------------
/src/main/java/net/coreprotect/CoreProtect.java:
--------------------------------------------------------------------------------
1 | package net.coreprotect;
2 |
3 | import java.io.File;
4 |
5 | import org.bukkit.plugin.java.JavaPlugin;
6 |
7 | import net.coreprotect.config.ConfigHandler;
8 | import net.coreprotect.language.Phrase;
9 | import net.coreprotect.services.PluginInitializationService;
10 | import net.coreprotect.services.ShutdownService;
11 | import net.coreprotect.utility.Chat;
12 |
13 | /**
14 | * Main class for the CoreProtect plugin
15 | */
16 | public final class CoreProtect extends JavaPlugin {
17 |
18 | private static CoreProtect instance;
19 | private boolean advancedChestsEnabled = false;
20 |
21 | /**
22 | * Get the instance of CoreProtect
23 | *
24 | * @return This CoreProtect instance
25 | */
26 | public static CoreProtect getInstance() {
27 | return instance;
28 | }
29 |
30 | private final CoreProtectAPI api = new CoreProtectAPI();
31 |
32 | /**
33 | * Get the CoreProtect API
34 | *
35 | * @return The CoreProtect API
36 | */
37 | public CoreProtectAPI getAPI() {
38 | return api;
39 | }
40 |
41 | @Override
42 | public void onEnable() {
43 | // Set plugin instance and data folder path
44 | instance = this;
45 | ConfigHandler.path = this.getDataFolder().getPath() + File.separator;
46 |
47 | advancedChestsEnabled = getServer().getPluginManager().getPlugin("AdvancedChests") != null;
48 | // Initialize plugin using the initialization service
49 | boolean initialized = PluginInitializationService.initializePlugin(this);
50 |
51 | // Disable plugin if initialization failed
52 | if (!initialized) {
53 | Chat.console(Phrase.build(Phrase.ENABLE_FAILED, ConfigHandler.EDITION_NAME));
54 | getServer().getPluginManager().disablePlugin(this);
55 | }
56 | }
57 |
58 | @Override
59 | public void onDisable() {
60 | ShutdownService.safeShutdown(this);
61 | }
62 |
63 | public boolean isAdvancedChestsEnabled() {
64 | return advancedChestsEnabled;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/net/coreprotect/bukkit/Bukkit_v1_18.java:
--------------------------------------------------------------------------------
1 | package net.coreprotect.bukkit;
2 |
3 | import org.bukkit.inventory.ItemStack;
4 | import org.bukkit.inventory.MerchantRecipe;
5 |
6 | /**
7 | * Bukkit adapter implementation for Minecraft 1.18.
8 | * Provides version-specific implementations for the BukkitInterface
9 | * to handle features introduced in the 1.18 update.
10 | */
11 | public class Bukkit_v1_18 extends Bukkit_v1_17 {
12 |
13 | /**
14 | * Flag to track whether the MerchantRecipe.adjust() method is available.
15 | * This is initialized on first use and prevents repeated reflection checks.
16 | * - null: Not yet checked
17 | * - true: Method exists and should be used
18 | * - false: Method doesn't exist or failed, fallback to parent implementation
19 | */
20 | private Boolean hasAdjustMethod = null;
21 |
22 | /**
23 | * Adjusts an ingredient in a merchant recipe for version 1.18+.
24 | * This handles changes to the MerchantRecipe API introduced in Bukkit 1.18.1.
25 | *
26 | * @param recipe
27 | * The merchant recipe
28 | * @param itemStack
29 | * The item stack to adjust
30 | * @return The adjusted item stack, or null if adjustment not supported or fails
31 | */
32 | @Override
33 | public ItemStack adjustIngredient(MerchantRecipe recipe, ItemStack itemStack) {
34 | if (itemStack == null) {
35 | return null;
36 | }
37 |
38 | try {
39 | // First-time detection of adjust method availability
40 | if (hasAdjustMethod == null) {
41 | hasAdjustMethod = true;
42 | // Test if the adjust method exists using reflection
43 | MerchantRecipe.class.getMethod("adjust", ItemStack.class); // Bukkit 1.18.1+
44 | }
45 | // Skip if we've already determined the method isn't available
46 | else if (Boolean.FALSE.equals(hasAdjustMethod)) {
47 | return super.adjustIngredient(recipe, itemStack);
48 | }
49 |
50 | // Create a clone to avoid modifying the original itemStack
51 | ItemStack adjustedStack = itemStack.clone();
52 | recipe.adjust(adjustedStack);
53 | return adjustedStack;
54 | }
55 | catch (Exception e) {
56 | // Method doesn't exist or failed, mark it for future calls
57 | hasAdjustMethod = false;
58 | return super.adjustIngredient(recipe, itemStack);
59 | }
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/net/coreprotect/command/ApplyCommand.java:
--------------------------------------------------------------------------------
1 | package net.coreprotect.command;
2 |
3 | import java.util.List;
4 |
5 | import org.bukkit.Location;
6 | import org.bukkit.command.Command;
7 | import org.bukkit.command.CommandSender;
8 |
9 | import net.coreprotect.config.ConfigHandler;
10 | import net.coreprotect.language.Phrase;
11 | import net.coreprotect.language.Selector;
12 | import net.coreprotect.utility.Chat;
13 | import net.coreprotect.utility.Color;
14 |
15 | public class ApplyCommand {
16 | protected static void runCommand(CommandSender user, Command command, boolean permission, String[] args) {
17 | try {
18 | if (ConfigHandler.lastRollback.get(user.getName()) != null) {
19 | List