Skip to content

Commit c435ebc

Browse files
committed
added BloodpactEnchantment.kt
Signed-off-by: illyrius666 <28700752+illyrius666@users.noreply.github.com>
1 parent da09ea0 commit c435ebc

12 files changed

Lines changed: 184 additions & 56 deletions

.idea/dictionaries/project.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ARCHITECTURE.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ There are no automated tests in this project.
2525

2626
### Entry Points
2727

28-
- **`VanillaPlusBootstrap`**`PluginBootstrap` implementation. Runs before plugin enable. Creates item tags (`vanillaplus:tools`, `vanillaplus:weapons`, `vanillaplus:tools_weapons`, `vanillaplus:blaze_rods`), registers eleven custom enchantments into Paper's registry via `RegistryEvents.ENCHANTMENT`, then tags all eleven as tradeable, non-treasure, and in-enchanting-table via `LifecycleEvents.TAGS.postFlatten`.
28+
- **`VanillaPlusBootstrap`**`PluginBootstrap` implementation. Runs before plugin enable. Creates item tags (`vanillaplus:tools`, `vanillaplus:weapons`, `vanillaplus:tools_weapons`, `vanillaplus:blaze_rods`), registers twelve custom enchantments into Paper's registry via `RegistryEvents.ENCHANTMENT`, then tags all twelve as tradeable, non-treasure, and in-enchanting-table via `LifecycleEvents.TAGS.postFlatten`.
2929
- **`VanillaPlus`**`JavaPlugin` main class. On enable: validates server version, registers all recipes, registers all modules, then calls `ManaManager.startRegenTask()` to begin the shared mana regeneration loop. All modules are active by default (`enabled` defaults to `true` on `ModuleInterface`); override `enabled` to `false` in a specific module to disable it at compile time.
3030

3131
### Module System
@@ -44,7 +44,7 @@ Custom enchantments implement **`EnchantmentInterface`** and are registered in `
4444
- **`invoke(builder)`** — override to configure the enchantment's registry entry (description, anvil cost, level range, weight, slot group, etc.). The default implementation is a no-op pass-through.
4545
- **`get()`** — looks up and returns the live `Enchantment` instance from the registry after bootstrap.
4646

47-
Event handling is done via ordinary `@EventHandler` methods in each enchantment object — there is no generic event type on the interface. Eleven enchantments are actively registered and tagged as tradeable, non-treasure, and in-enchanting-table:
47+
Event handling is done via ordinary `@EventHandler` methods in each enchantment object — there is no generic event type on the interface. Twelve enchantments are actively registered and tagged as tradeable, non-treasure, and in-enchanting-table:
4848

4949
| Enchantment | Slot Group | Supported Items |
5050
|-------------|------------|-----------------------------------------------|
@@ -59,10 +59,11 @@ Event handling is done via ordinary `@EventHandler` methods in each enchantment
5959
| Frostbind | `MAINHAND` | Blaze Rods (`vanillaplus:blaze_rods`) |
6060
| Tempest | `MAINHAND` | Blaze Rods (`vanillaplus:blaze_rods`) |
6161
| Voidpull | `MAINHAND` | Blaze Rods (`vanillaplus:blaze_rods`) |
62+
| Bloodpact | `MAINHAND` | Blaze Rods (`vanillaplus:blaze_rods`) |
6263

6364
SilkTouch and FeatherFalling exist as implementations but are not currently registered in the bootstrap.
6465

65-
**Mana system:** All five Blaze Rod spell enchantments (Inferno, Skysunder, Witherbrand, Frostbind, Voidpull) and Tempest share a single mana pool stored in `PlayerPDC.mana`. All five are mutually exclusive with each other via `exclusiveWith`. `ManaManager` owns the bossbar display (`showManaBar`), regen scheduler (`startRegenTask`), and the no-mana sound (`NO_MANA_SOUND`). The bossbar uses the **Spellbite** gradient (`#832466 → #BF4299 → #832466`) with `NOTCHED_10` overlay. Frostbind tags its `Snowball` projectiles with a `NamespacedKey` (`frostbind_projectile`) and resolves the hit in `ProjectileHitEvent`.
66+
**Mana system:** All seven Blaze Rod spell enchantments (Inferno, Skysunder, Witherbrand, Frostbind, Tempest, Voidpull, Bloodpact) share a single mana pool stored in `PlayerPDC.mana`. All seven are mutually exclusive with each other via `exclusiveWith`. `ManaManager` owns the bossbar display (`showManaBar`), regen scheduler (`startRegenTask`), and the no-mana sound (`NO_MANA_SOUND`). The bossbar uses the **Spellbite** gradient (`#832466 → #BF4299 → #832466`) with `NOTCHED_10` overlay. Unlike other spells, Bloodpact does not call `ManaManager.consumeMana` — it manually validates the left-click and trades player health for mana directly. Frostbind and Voidpull tag their projectiles with a `NamespacedKey` and resolve hits in `ProjectileHitEvent`. Projectile trail effects are created via `ScheduleUtils.spawnProjectileTrail`, which schedules a per-tick particle task that self-cancels when the entity is no longer valid.
6667

6768
### PDCs (Persistent Data Containers)
6869

@@ -74,16 +75,16 @@ Recipe objects implement **`RecipeInterface`** and are listed in `VanillaPlus.on
7475

7576
### Package Structure (`org.xodium.vanillaplus`)
7677

77-
| Package | Contents |
78-
|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------|
79-
| `modules/` | 14 feature module singletons |
80-
| `data/` | `CommandData`, `BookData`, `AdjacentBlockData` |
81-
| `enchantments/` | Verdance, Tether, Nimbus, Earthrend, Embertread, Inferno, Skysunder, Witherbrand, Frostbind, Tempest, Voidpull, SilkTouch, FeatherFalling |
82-
| `interfaces/` | `ModuleInterface`, `EnchantmentInterface`, `RecipeInterface` |
83-
| `managers/` | `ManaManager`, `PlayerMessageManager` |
84-
| `pdcs/` | `PlayerPDC` |
85-
| `recipes/` | Chainmail, DiamondRecycle, Painting, RottenFlesh, WoodLog |
86-
| `utils/` | `Utils`, `CommandUtils`, `BlockUtils`, `PlayerUtils`, `ScheduleUtils` |
78+
| Package | Contents |
79+
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
80+
| `modules/` | 14 feature module singletons |
81+
| `data/` | `CommandData`, `BookData`, `AdjacentBlockData` |
82+
| `enchantments/` | Verdance, Tether, Nimbus, Earthrend, Embertread, Inferno, Skysunder, Witherbrand, Frostbind, Tempest, Voidpull, Bloodpact, SilkTouch, FeatherFalling |
83+
| `interfaces/` | `ModuleInterface`, `EnchantmentInterface`, `RecipeInterface` |
84+
| `managers/` | `ManaManager`, `PlayerMessageManager` |
85+
| `pdcs/` | `PlayerPDC` |
86+
| `recipes/` | Chainmail, DiamondRecycle, Painting, RottenFlesh, WoodLog |
87+
| `utils/` | `Utils`, `CommandUtils`, `BlockUtils`, `PlayerUtils`, `ScheduleUtils` |
8788

8889
### Key Conventions
8990

docs/enchantments.md

Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enchantments
22

3-
VanillaPlus adds **8 custom enchantments** and **extends 2 vanilla enchantments**. All are obtainable through the enchanting table, anvil and villager trades (tradeable, non-treasure).
3+
VanillaPlus adds **9 custom enchantments** and **extends 2 vanilla enchantments**. All are obtainable through the enchanting table, anvil and villager trades (tradeable, non-treasure).
44

55
---
66

@@ -79,12 +79,12 @@ When a fully grown crop is harvested with a Verdance hoe, the crop block is rese
7979

8080
> Launches a fireball on left-click with a Blaze Rod.
8181
82-
| Property | Value |
83-
|--------------------|-----------------------|
84-
| **Slot** | Mainhand (Blaze Rods) |
85-
| **Levels** | I |
86-
| **Mana cost** | 10 |
87-
| **Exclusive with** | Skysunder |
82+
| Property | Value |
83+
|--------------------|-----------------------------------------------------------------|
84+
| **Slot** | Mainhand (Blaze Rods) |
85+
| **Levels** | I |
86+
| **Mana cost** | 10 |
87+
| **Exclusive with** | Skysunder, Witherbrand, Frostbind, Tempest, Voidpull, Bloodpact |
8888

8989
Left-clicking with an enchanted Blaze Rod fires a small fireball in the direction you are looking. Fireballs deal no block damage (`yield = 0`) and leave a trail of flame and lava particles. Requires mana; displays the shared **Spellbite** mana bar on cast. Only usable in Survival or Adventure mode.
9090

@@ -94,79 +94,94 @@ Left-clicking with an enchanted Blaze Rod fires a small fireball in the directio
9494

9595
> Calls down a lightning bolt on left-click with a Blaze Rod.
9696
97-
| Property | Value |
98-
|--------------------|-----------------------|
99-
| **Slot** | Mainhand (Blaze Rods) |
100-
| **Levels** | I |
101-
| **Mana cost** | 20 |
102-
| **Range** | 30 blocks |
103-
| **Exclusive with** | Inferno |
97+
| Property | Value |
98+
|--------------------|---------------------------------------------------------------|
99+
| **Slot** | Mainhand (Blaze Rods) |
100+
| **Levels** | I |
101+
| **Mana cost** | 20 |
102+
| **Range** | 30 blocks |
103+
| **Exclusive with** | Inferno, Witherbrand, Frostbind, Tempest, Voidpull, Bloodpact |
104104

105105
Left-clicking with a Skysunder Blaze Rod ray-traces up to 30 blocks in the direction you are looking. A real lightning bolt (dealing damage) strikes the first block hit, or the maximum range point if no block is found. Bursts `ELECTRIC_SPARK` particles at the strike location. Draws from the shared **Spellbite** mana pool (costs twice as much as Inferno). Only usable in Survival or Adventure mode.
106106

107107
---
108108

109109
### Voidpull
110110

111-
> Yanks a targeted entity to you on left-click with a Blaze Rod.
111+
> Shoots an ender pearl that pulls the struck entity to you on left-click with a Blaze Rod.
112112
113-
| Property | Value |
114-
|--------------------|-----------------------------------------------------|
115-
| **Slot** | Mainhand (Blaze Rods) |
116-
| **Levels** | I |
117-
| **Mana cost** | 20 |
118-
| **Range** | 30 blocks |
119-
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Frostbind, Tempest |
113+
| Property | Value |
114+
|--------------------|----------------------------------------------------------------|
115+
| **Slot** | Mainhand (Blaze Rods) |
116+
| **Levels** | I |
117+
| **Mana cost** | 20 |
118+
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Frostbind, Tempest, Bloodpact |
120119

121-
Left-clicking with a Voidpull Blaze Rod ray-traces up to 30 blocks for an entity. The first entity hit is teleported directly in front of the player. Portal particles burst at both the origin and arrival location. Requires mana; draws from the shared **Spellbite** mana pool. Only usable in Survival or Adventure mode.
120+
Left-clicking with a Voidpull Blaze Rod fires an ender pearl (no gravity) in the direction you are looking. While in flight the pearl trails portal and reverse-portal particles. When the pearl strikes an entity, that entity is teleported directly in front of the player. Portal particles burst at both the origin and arrival location. Requires mana; draws from the shared **Spellbite** mana pool. Only usable in Survival or Adventure mode.
122121

123122
---
124123

125124
### Frostbind
126125

127126
> Launches a freezing snowball on left-click with a Blaze Rod.
128127
129-
| Property | Value |
130-
|--------------------|------------------------------------------|
131-
| **Slot** | Mainhand (Blaze Rods) |
132-
| **Levels** | I |
133-
| **Mana cost** | 15 |
134-
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Tempest |
128+
| Property | Value |
129+
|--------------------|---------------------------------------------------------------|
130+
| **Slot** | Mainhand (Blaze Rods) |
131+
| **Levels** | I |
132+
| **Mana cost** | 15 |
133+
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Tempest, Voidpull, Bloodpact |
135134

136-
Left-clicking with a Frostbind Blaze Rod fires a snowball in the direction you are looking. On hit, the struck entity is frozen solid for several seconds (set to full freeze ticks, decaying naturally outside powder snow). Bursts snowflake particles at the impact location. Requires mana; draws from the shared **Spellbite** mana pool. Only usable in Survival or Adventure mode.
135+
Left-clicking with a Frostbind Blaze Rod fires a snowball (no gravity) in the direction you are looking. On hit, the struck entity is frozen solid for several seconds (set to full freeze ticks, decaying naturally outside powder snow). The snowball trails snowflake and snowball particles in flight. Bursts snowflake particles at the impact location. Requires mana; draws from the shared **Spellbite** mana pool. Only usable in Survival or Adventure mode.
137136

138137
---
139138

140139
### Tempest
141140

142141
> Launches a burst of wind charges on left-click with a Blaze Rod.
143142
144-
| Property | Value |
145-
|--------------------|--------------------------------------------|
146-
| **Slot** | Mainhand (Blaze Rods) |
147-
| **Levels** | I |
148-
| **Mana cost** | 25 |
149-
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Frostbind |
143+
| Property | Value |
144+
|--------------------|-----------------------------------------------------------------|
145+
| **Slot** | Mainhand (Blaze Rods) |
146+
| **Levels** | I |
147+
| **Mana cost** | 25 |
148+
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Frostbind, Voidpull, Bloodpact |
150149

151-
Left-clicking with a Tempest Blaze Rod fires three wind charges in a horizontal spread. Each charge knocks back anything it hits on explosion. Requires mana; the highest mana cost of all Blaze Rod spells. Only usable in Survival or Adventure mode.
150+
Left-clicking with a Tempest Blaze Rod fires three wind charges in a horizontal spread. Each charge trails gust and cloud particles and knocks back anything it hits on explosion. Requires mana; the highest mana cost of all Blaze Rod spells. Only usable in Survival or Adventure mode.
152151

153152
---
154153

155154
### Witherbrand
156155

157156
> Launches a wither skull on left-click with a Blaze Rod.
158157
159-
| Property | Value |
160-
|--------------------|-----------------------|
161-
| **Slot** | Mainhand (Blaze Rods) |
162-
| **Levels** | I |
163-
| **Mana cost** | 15 |
164-
| **Exclusive with** | Inferno, Skysunder |
158+
| Property | Value |
159+
|--------------------|-------------------------------------------------------------|
160+
| **Slot** | Mainhand (Blaze Rods) |
161+
| **Levels** | I |
162+
| **Mana cost** | 15 |
163+
| **Exclusive with** | Inferno, Skysunder, Frostbind, Tempest, Voidpull, Bloodpact |
165164

166165
Left-clicking with a Witherbrand Blaze Rod fires an uncharged wither skull in the direction you are looking. The skull applies the Wither effect on hit and leaves a trail of soul and ash particles. Requires mana; draws from the shared **Spellbite** mana pool. Only usable in Survival or Adventure mode.
167166

168167
---
169168

169+
### Bloodpact
170+
171+
> Sacrifice health to restore mana on left-click with a Blaze Rod.
172+
173+
| Property | Value |
174+
|--------------------|---------------------------------------------------------------|
175+
| **Slot** | Mainhand (Blaze Rods) |
176+
| **Levels** | I |
177+
| **Health cost** | 2 hearts (4 HP) |
178+
| **Mana gain** | 40 |
179+
| **Exclusive with** | Inferno, Skysunder, Witherbrand, Frostbind, Tempest, Voidpull |
180+
181+
Left-clicking with a Bloodpact Blaze Rod drains 2 hearts and immediately restores 40 mana. Blocked if the player's health would drop to zero or below, or if mana is already full — both play the no-mana sound as feedback. Damage indicator and crimson spore particles burst from the player on a successful cast. Unlike other Blaze Rod spells, Bloodpact produces mana rather than consuming it, making it a dedicated mana recovery tool at the cost of survivability. Only usable in Survival or Adventure mode.
182+
183+
---
184+
170185
## Extended vanilla enchantments
171186

172187
These enchantments already exist in vanilla Minecraft. VanillaPlus adds extra behaviour on top of their normal effects. The extended behaviour is togglable in [PlayerModule config](modules/player.md).

0 commit comments

Comments
 (0)