Skip to content

Commit 6989ed6

Browse files
committed
Finish splitting bridge.py into multiple files.
1 parent 4f5083b commit 6989ed6

17 files changed

Lines changed: 5281 additions & 5716 deletions

File tree

next.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Move the following things into the extension module:
77

88
Update documentation to add a [ext] tag to all features that are in the extension module, and update the type stub as well.
99

10-
Make the bridge module a proper module (a folder, with __init__.py) and split it into multiple files.
10+
- ✅ Make the bridge module a proper module (a folder, with __init__.py) and split it into multiple files.
1111
The extension module will be imported as `from bridge.extensions import xyz`. each feature will have its own file.
1212

1313
- BossBarDisplay:

releases/pyjavabridge-dev.jar

113 KB
Binary file not shown.

src/main/java/com/pyjavabridge/BridgeInstance.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import org.bukkit.NamespacedKey;
2121
import org.bukkit.Registry;
2222
import org.bukkit.Sound;
23+
import io.papermc.paper.registry.RegistryAccess;
24+
import io.papermc.paper.registry.RegistryKey;
2325
import org.bukkit.World;
2426
import org.bukkit.block.Block;
2527
import org.bukkit.block.BlockState;
@@ -1535,7 +1537,8 @@ private Object invokeServerMethod(org.bukkit.Server server, String method, List<
15351537
}
15361538
if ("getAllEnchantments".equals(method)) {
15371539
List<String> names = new ArrayList<>();
1538-
for (org.bukkit.enchantments.Enchantment ench : org.bukkit.Registry.ENCHANTMENT) {
1540+
Registry<org.bukkit.enchantments.Enchantment> enchReg = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT);
1541+
for (org.bukkit.enchantments.Enchantment ench : enchReg) {
15391542
names.add(ench.getKey().getKey().toUpperCase());
15401543
}
15411544
return names;
@@ -1545,7 +1548,8 @@ private Object invokeServerMethod(org.bukkit.Server server, String method, List<
15451548
Material mat = Material.valueOf(materialName);
15461549
ItemStack testItem = new ItemStack(mat);
15471550
List<String> names = new ArrayList<>();
1548-
for (org.bukkit.enchantments.Enchantment ench : org.bukkit.Registry.ENCHANTMENT) {
1551+
Registry<org.bukkit.enchantments.Enchantment> enchReg2 = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT);
1552+
for (org.bukkit.enchantments.Enchantment ench : enchReg2) {
15491553
if (ench.canEnchantItem(testItem)) {
15501554
names.add(ench.getKey().getKey().toUpperCase());
15511555
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
12
# Bridge package files to copy (paths relative to bridge/)
3+
24
__init__.py
35
__init__.pyi
6+
errors.py
7+
types.py
8+
connection.py
9+
wrappers.py
10+
utils.py
11+
helpers.py
12+
decorators.py
13+
api.py
414
extensions/__init__.py
15+
extensions/npc.py
16+
extensions/image_display.py
17+
extensions/mesh_display.py

0 commit comments

Comments
 (0)