Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
821c343
Update to 1.21 - WARNING: DOESN'T WORK
cpaca Sep 15, 2025
d7effee
Remove EnchantmentRarity
cpaca Sep 15, 2025
5146f01
getActiveSlots is deprecated.
cpaca Sep 15, 2025
2c69fff
Revamp EnchantmentListener
cpaca Sep 15, 2025
b9d9a08
Reset CustomEnchantment to scratch
cpaca Sep 15, 2025
ae8eaad
Nuking AnvilListener
cpaca Sep 15, 2025
8e2c795
Update Enchantable to use minecraft registries.
cpaca Sep 15, 2025
a4b2ff2
Remove EnchantManager
cpaca Sep 15, 2025
d6fa505
Delete EnchantCommand.java
cpaca Sep 15, 2025
3297d53
Fix accidentally-deleted semicolon
cpaca Sep 15, 2025
d3a24e6
Fix CustomLootRegistry Enchantments
cpaca Sep 15, 2025
fc36c02
CustomEnchantment implements EnchantmentAbility
cpaca Sep 15, 2025
2a6a928
CustomEnchantment implements EnchantmentAbility
cpaca Sep 15, 2025
e0b316b
Merge branch '1.21-update' of https://github.com/cpaca/HoloItems into…
cpaca Sep 15, 2025
90ecb0a
Remove now-extraneous functions
cpaca Sep 15, 2025
0de04b4
Remove Tide Rider particles
cpaca Sep 15, 2025
1c2a79b
Update John Rengelman's Shadow
cpaca Sep 15, 2025
3c202fb
Fix enchantment namespace
cpaca Sep 15, 2025
61d0dd4
have to use holoitems namespace
cpaca Sep 15, 2025
d90fe5b
Re-register enchantments again
cpaca Sep 15, 2025
5123db8
Register and listen to enchantments
cpaca Sep 15, 2025
ff988d4
Replace unstackable with integer stackSize
cpaca Sep 15, 2025
14b0887
Merge branch '1.21-update' of https://github.com/cpaca/HoloItems into…
cpaca Sep 15, 2025
79ec8fe
Add datapack and associated gradle task
cpaca Sep 15, 2025
07086fa
Make copyDatapack delete old datapack
cpaca Sep 15, 2025
0100d06
Fix enchantment namespace
cpaca Sep 16, 2025
edbb871
Move Backdash recipe to datapack
cpaca Sep 16, 2025
0ebc7a5
Implement book-like items
cpaca Sep 16, 2025
5891896
Remove Keys.OWNER
cpaca Sep 16, 2025
7b294f2
Grindstone now removes BookLike
cpaca Sep 16, 2025
6829a53
Make BookLike a boolean
cpaca Sep 16, 2025
c379eae
make non-booklike anvil uses work again
cpaca Sep 16, 2025
ebe5ab7
Switch to item_name instead of custom_name
cpaca Sep 16, 2025
5e3ce17
Fix acquire command
cpaca Sep 16, 2025
66437e8
Move all recipes to datapack
cpaca Sep 16, 2025
1eaf079
Simplify/reduce code.
cpaca Sep 16, 2025
239ae77
Remove RecipeBuilder Shaped, Shapeless, Furnace
cpaca Sep 16, 2025
2ada2a5
Correct runServer version
cpaca Sep 16, 2025
7ccfb24
Correct apiVersion version
cpaca Sep 16, 2025
1056f04
Switch from bukkit plugin.yml to paper-plugin.yml
cpaca Sep 17, 2025
d0a660d
Fix command
cpaca Sep 17, 2025
79abbe7
Remove CraftListener, RecipeBuilder, RecipeManager.
cpaca Sep 17, 2025
6517878
Remove extraneous recipe classes
cpaca Sep 17, 2025
2c2ba08
Add CustomItem.editRecipe
cpaca Sep 17, 2025
08815bd
Update dependency (InventoryFramework)
cpaca Sep 17, 2025
26eb5b8
Fix bootstrap name
cpaca Sep 17, 2025
d4d737f
Fix bootstrap name
cpaca Sep 17, 2025
f22eef4
Merge branch '1.21-update' of https://github.com/cpaca/HoloItems into…
cpaca Sep 17, 2025
6adb0e0
Remove unnecessary build.gradle.kts lines
cpaca Sep 17, 2025
7e56dfd
Scrapping bootstrap idea.
cpaca Sep 17, 2025
4150b29
Remove Keys.UNSTACKABLE
cpaca Sep 17, 2025
d7680ea
Remove CustomItem.updateStack
cpaca Sep 17, 2025
c848b75
Move HolyFire recipe fully back into code
cpaca Sep 17, 2025
2ef28ed
Add and shade lightbend (hocon)
cpaca Sep 17, 2025
05e27eb
Move recipes back to code format
cpaca Sep 17, 2025
17d96d5
remove extraneous tag
cpaca Sep 17, 2025
3e6cac2
Make Backdash booklike again
cpaca Sep 17, 2025
181c190
add holoitems:enchantments tag
cpaca Sep 17, 2025
1c3bfef
Fix TideRider recipe
cpaca Sep 18, 2025
1151c7b
Rename tag enchantments -> holoenchantments
cpaca Sep 19, 2025
0e523a2
Remove outdated CustomEnchantment functions
cpaca Sep 19, 2025
c2b38e2
Remove ProtocolLib dependency
cpaca Sep 19, 2025
651f4c0
remove old todo
cpaca Sep 19, 2025
4cc91ba
Fix TideRider's particle
cpaca Sep 19, 2025
72fa5bc
Attempt to fix GitHub workflow
cpaca Sep 21, 2025
f517024
Update remaining build.yml versions
cpaca Sep 21, 2025
3163260
Fix using holoitems in non-custom recipes.
cpaca Sep 21, 2025
27b4f50
Actually register recipes
cpaca Sep 21, 2025
e47bb54
Null-check for recipe registration
cpaca Sep 21, 2025
af36235
Fix minRow/minCol calculations
cpaca Sep 21, 2025
d139ea0
Make getRecipe protected again
cpaca Sep 22, 2025
e9b37b8
Use HoloEnchantment tag instead of namespace check
cpaca Sep 22, 2025
dad696f
Explain BookLike try/catch clause
cpaca Sep 22, 2025
9f35503
Fix tag lookup
cpaca Sep 22, 2025
4bac8d7
Move enchantment tag checks to a manager
cpaca Sep 22, 2025
d45486f
Remove CustomEnchantment
cpaca Sep 22, 2025
f27cec1
Suppress UnstableApiUsage for lifecycle API
cpaca Sep 22, 2025
8faa0b8
Make EnchantmentAbility not Keyed
cpaca Sep 22, 2025
9a305ad
Register enchantments in Integrations
cpaca Sep 22, 2025
1013f10
Rename loadCustomEnchantments
cpaca Sep 22, 2025
3e2fcbb
Use better entry construction in EnchantManager
cpaca Sep 22, 2025
6747230
Fix javadoc error (param name was changed)
cpaca Sep 23, 2025
b8b23cb
Remove old command registration
cpaca Oct 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
java: [ 21 ]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew build --stacktrace
- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.sha }}
path: |
Expand Down
43 changes: 28 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
`java-library`
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Generates plugin.yml
id("com.github.johnrengelman.shadow") version "8.1.1" // Shades and relocates dependencies into our plugin jar
id("net.minecrell.plugin-yml.paper") version "0.6.0" // Generates plugin.yml
id("com.gradleup.shadow") version "8.3.9" // Shades and relocates dependencies into our plugin jar
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
}

Expand All @@ -11,7 +11,7 @@ description = "A plugin for HoloCons SMP that adds a ton of custom items and blo

java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

repositories {
Expand All @@ -21,10 +21,10 @@ repositories {
}

dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("com.comphenix.protocol:ProtocolLib:5.2.0-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.9")
implementation("com.github.stefvanschie.inventoryframework:IF:0.10.13")
implementation("com.github.stefvanschie.inventoryframework:IF:0.11.3")
implementation("com.typesafe:config:1.4.4")
}

tasks {
Expand All @@ -38,7 +38,7 @@ tasks {

// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
Expand All @@ -57,31 +57,44 @@ tasks {
// https://github.com/johnrengelman/shadow
shadowJar {
relocate("com.github.stefvanschie.inventoryframework", "shadow.inventoryframework")
relocate("com.typesafe.config", "shadow.lightbend")

archiveClassifier.set("")
}

// Configure the Minecraft version for runServer task
// https://github.com/jpenilla/run-paper
runServer {
minecraftVersion("1.20.1")
dependsOn("copyDatapack")
minecraftVersion("1.21.1")
}
}

tasks.register("copyDatapack") {
// Not sure what group to make this
description = "Copies the datapack into the world's datapacks folder"

delete("./run/world/datapacks/holoitems_datapack")

copy {
from("./holoitems_datapack")
into("./run/world/datapacks/holoitems_datapack")
}
}

// Configure plugin.yml generation
// https://github.com/Minecrell/plugin-yml
bukkit {
paper {
main = "xyz.holocons.mc.holoitemsrevamp.HoloItemsRevamp"
apiVersion = "1.20"
bootstrapper = "xyz.holocons.mc.holoitemsrevamp.HoloItemsBootstrap"
apiVersion = "1.21.1"
authors = listOf("TraceL", "dlee13")
website = "holocons.xyz"
depend = listOf("ProtocolLib")
softDepend = listOf("WorldGuard")
prefix = "HoloItems"

commands {
register("holoitems") {
usage = "/holoitems"
serverDependencies {
register("WorldGuard") {
required = false
}
}
}
17 changes: 17 additions & 0 deletions holoitems_datapack/data/holoitems/enchantment/backdash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "Backdash",
"supported_items": "#minecraft:enchantable/foot_armor",
"primary_items": [],
"weight": 1,
"max_level": 1,
"min_cost": {
"base": 100,
"per_level_above_first": 100
},
"max_cost": {
"base": 100,
"per_level_above_first": 100
},
"anvil_cost": 20,
"slots": ["feet"]
}
17 changes: 17 additions & 0 deletions holoitems_datapack/data/holoitems/enchantment/magnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "Magnet",
"supported_items": "#minecraft:pickaxes",
"primary_items": [],
"weight": 1,
"max_level": 1,
"min_cost": {
"base": 100,
"per_level_above_first": 100
},
"max_cost": {
"base": 100,
"per_level_above_first": 100
},
"anvil_cost": 39,
"slots": ["mainhand"]
}
17 changes: 17 additions & 0 deletions holoitems_datapack/data/holoitems/enchantment/memento.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "Memento",
"supported_items": "minecraft:ender_chest",
"primary_items": [],
"weight": 1,
"max_level": 1,
"min_cost": {
"base": 100,
"per_level_above_first": 100
},
"max_cost": {
"base": 100,
"per_level_above_first": 100
},
"anvil_cost": 30,
"slots": ["any"]
}
17 changes: 17 additions & 0 deletions holoitems_datapack/data/holoitems/enchantment/plow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "Plow",
"supported_items": "#minecraft:shovels",
"primary_items": [],
"weight": 1,
"max_level": 1,
"min_cost": {
"base": 100,
"per_level_above_first": 100
},
"max_cost": {
"base": 100,
"per_level_above_first": 100
},
"anvil_cost": 32,
"slots": ["mainhand"]
}
17 changes: 17 additions & 0 deletions holoitems_datapack/data/holoitems/enchantment/tide_rider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "Tide Rider",
"supported_items": "#minecraft:enchantable/trident",
"primary_items": [],
"weight": 1,
"max_level": 1,
"min_cost": {
"base": 100,
"per_level_above_first": 100
},
"max_cost": {
"base": 100,
"per_level_above_first": 100
},
"anvil_cost": 20,
"slots": ["mainhand"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"values": [
"holoitems:backdash",
"holoitems:magnet",
"holoitems:memento",
"holoitems:plow",
"holoitems:tide_rider"
]
}
6 changes: 6 additions & 0 deletions holoitems_datapack/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 48,
"description": "HoloItems"
}
}
69 changes: 25 additions & 44 deletions src/main/java/com/strangeone101/holoitemsapi/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,21 @@
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

public class Keys {

public static Property<UUID> OWNER;
public static Property<Long> COOLDOWN;
public static Property<Boolean> UNSTACKABLE;
public static Property<String> ITEM_ID;
/**
* Used to represent an item that can also be used "like" an enchantment book.
* The first example of this is Backdash, which is both boots and applicable to other boots.
*/
public static Property<Boolean> BOOK_LIKE;

public static void fillKeys(Plugin plugin) {
OWNER = new Property<UUID>(plugin, "owner") {

@Override
public boolean has(PersistentDataContainer data) {
return data.has(getKey(), DataType.UUID);
}

@Override
public UUID get(PersistentDataContainer data) {
return data.get(getKey(), DataType.UUID);
}

@Override
public void set(PersistentDataContainer data, UUID value) {
data.set(getKey(), DataType.UUID, value);
}

@Override
public String getPropertyName() {
return "Owner";
}
};

COOLDOWN = new Property<Long>(plugin, "cooldown") {

@Override
Expand All @@ -60,53 +42,52 @@ public String getPropertyName() {
}
};

UNSTACKABLE = new Property<Boolean>(plugin, "unstackable") {
ITEM_ID = new Property<String>(plugin, "item_id") {

@Override
public boolean has(PersistentDataContainer data) {
return data.has(getKey(), PersistentDataType.INTEGER);
return data.has(getKey(), PersistentDataType.STRING);
}

@Override
public Boolean get(PersistentDataContainer data) {
return has(data);
public String get(PersistentDataContainer data) {
return data.get(getKey(), PersistentDataType.STRING);
}

@Override
public void set(PersistentDataContainer data, Boolean value) {
if (value) {
data.set(getKey(), PersistentDataType.INTEGER, Bukkit.getCurrentTick());
} else {
data.remove(getKey());
}
public void set(PersistentDataContainer data, String value) {
data.set(getKey(), PersistentDataType.STRING, value);
}

@Override
public String getPropertyName() {
return "Unstackable";
return "Item ID";
}
};

ITEM_ID = new Property<String>(plugin, "item_id") {

BOOK_LIKE = new Property<Boolean>(plugin, "book_like") {
@Override
public boolean has(PersistentDataContainer data) {
return data.has(getKey(), PersistentDataType.STRING);
return data.has(getKey(), PersistentDataType.BOOLEAN);
}

@Override
public String get(PersistentDataContainer data) {
return data.get(getKey(), PersistentDataType.STRING);
public Boolean get(PersistentDataContainer data) {
return data.getOrDefault(getKey(), PersistentDataType.BOOLEAN, false);
}

@Override
public void set(PersistentDataContainer data, String value) {
data.set(getKey(), PersistentDataType.STRING, value);
public void set(PersistentDataContainer data, Boolean value) {
if (value == null || !value) {
data.remove(getKey());
} else {
data.set(getKey(), PersistentDataType.BOOLEAN, true);
}
}

@Override
public String getPropertyName() {
return "Item ID";
return "Book-like";
}
};
}
Expand Down
Loading