diff --git a/README.md b/README.md
index fefff6da4..941fceae5 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,14 @@
-
-
-
-
+
+
+
+
+
+
+
diff --git a/bukkit/build.gradle.kts b/bukkit/build.gradle.kts
index 607fff3b3..8e5ae6b27 100644
--- a/bukkit/build.gradle.kts
+++ b/bukkit/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
- id("com.gradleup.shadow") version "9.0.0-beta11"
+ id("com.gradleup.shadow") version "9.0.0-beta13"
id("maven-publish")
}
diff --git a/bukkit/legacy/build.gradle.kts b/bukkit/legacy/build.gradle.kts
index ae80f6f46..da89d9df8 100644
--- a/bukkit/legacy/build.gradle.kts
+++ b/bukkit/legacy/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
- id("com.gradleup.shadow") version "9.0.0-beta11"
+ id("com.gradleup.shadow") version "9.0.0-beta13"
}
repositories {
diff --git a/bukkit/loader/build.gradle.kts b/bukkit/loader/build.gradle.kts
index dae694cd2..6be000e1a 100644
--- a/bukkit/loader/build.gradle.kts
+++ b/bukkit/loader/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
- id("com.gradleup.shadow") version "9.0.0-beta11"
- id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
+ id("com.gradleup.shadow") version "9.0.0-beta13"
+ id("de.eldoria.plugin-yml.bukkit") version "0.7.1"
}
repositories {
@@ -60,7 +60,7 @@ artifacts {
tasks {
shadowJar {
- archiveFileName = "${rootProject.name}-plugin-${rootProject.properties["project_version"]}.jar"
+ archiveFileName = "${rootProject.name}-bukkit-plugin-${rootProject.properties["project_version"]}.jar"
destinationDirectory.set(file("$rootDir/target"))
relocate("net.kyori", "net.momirealms.craftengine.libraries")
relocate("net.momirealms.sparrow.nbt", "net.momirealms.craftengine.libraries.nbt")
diff --git a/bukkit/loader/src/main/resources/resources/default/configuration/fix_client_visual.yml b/bukkit/loader/src/main/resources/resources/default/configuration/fix_client_visual.yml
index f9d659368..9e18aabaf 100644
--- a/bukkit/loader/src/main/resources/resources/default/configuration/fix_client_visual.yml
+++ b/bukkit/loader/src/main/resources/resources/default/configuration/fix_client_visual.yml
@@ -23,4 +23,5 @@ blocks:
minecraft:note_block:
settings:
client-bound-tags:
- - minecraft:beacon_base_blocks
\ No newline at end of file
+ - minecraft:beacon_base_blocks
+ - minecraft:mineable/axe
\ No newline at end of file
diff --git a/bukkit/loader/src/main/resources/translations/en.yml b/bukkit/loader/src/main/resources/translations/en.yml
index 4c2938cb0..456d2405d 100644
--- a/bukkit/loader/src/main/resources/translations/en.yml
+++ b/bukkit/loader/src/main/resources/translations/en.yml
@@ -90,6 +90,7 @@ warning.config.condition.match_block_property.missing_properties: "Issue
warning.config.condition.match_item.missing_id: "Issue found in file - The config '' is missing the required 'id' argument for 'match_item' condition."
warning.config.condition.table_bonus.missing_enchantment: "Issue found in file - The config '' is missing the required 'enchantment' argument for 'table_bonus' condition."
warning.config.condition.table_bonus.missing_chances: "Issue found in file - The config '' is missing the required 'chances' argument for 'table_bonus' condition."
+warning.config.condition.click_type.missing_click_type: "Issue found in file - The config '' is missing the required 'click-type' argument for 'click_type' condition."
warning.config.structure.not_section: "Issue found in file - The config '' is expected to be a config section while it's actually a(n) ''."
warning.config.image.duplicate: "Issue found in file - Duplicated image ''. Please check if there is the same configuration in other files."
warning.config.image.missing_height: "Issue found in file - The image '' is missing the required 'height' argument."
@@ -298,4 +299,5 @@ warning.config.conflict_matcher.any_of.missing_terms: "Issue found in co
warning.config.conflict_resolution.missing_type: "Issue found in config.yml at 'resource-pack.duplicated-files-handler' - Missing required 'type' argument for one of the resolutions."
warning.config.conflict_resolution.invalid_type: "Issue found in config.yml at 'resource-pack.duplicated-files-handler' - One of the resolutions is using the invalid type ''."
warning.config.function.command.missing_command: "Issue found in file - The config '' is missing the required 'command' argument for 'command' function."
+warning.config.event.missing_trigger: "Issue found in file - The config '' is missing the required 'on' argument for event triggers."
warning.config.event.invalid_trigger: "Issue found in file - The config '' is using an invalid event trigger ''."
\ No newline at end of file
diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/BukkitBlockManager.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/BukkitBlockManager.java
index 5e8d9a78a..84f1098d6 100644
--- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/BukkitBlockManager.java
+++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/BukkitBlockManager.java
@@ -31,7 +31,6 @@ import net.momirealms.craftengine.core.plugin.locale.LocalizedResourceConfigExce
import net.momirealms.craftengine.core.plugin.locale.TranslationManager;
import net.momirealms.craftengine.core.registry.BuiltInRegistries;
import net.momirealms.craftengine.core.registry.Holder;
-import net.momirealms.craftengine.core.registry.Registries;
import net.momirealms.craftengine.core.registry.WritableRegistry;
import net.momirealms.craftengine.core.util.*;
import org.bukkit.Bukkit;
@@ -49,7 +48,6 @@ import java.io.File;
import java.lang.reflect.Field;
import java.nio.file.Path;
import java.util.*;
-import java.util.stream.Collectors;
public class BukkitBlockManager extends AbstractBlockManager {
private static BukkitBlockManager instance;
@@ -252,7 +250,7 @@ public class BukkitBlockManager extends AbstractBlockManager {
for (int i = 0; i < size; i++) {
states[i] = new PackedBlockState(BlockStateUtils.idToBlockState(i), i);
}
- BlockRegistryMirror.init(states);
+ BlockRegistryMirror.init(states, new PackedBlockState(Reflections.instance$Blocks$STONE$defaultState, BlockStateUtils.blockStateToId(Reflections.instance$Blocks$STONE$defaultState)));
}
private void registerEmptyBlock() {
@@ -460,36 +458,8 @@ public class BukkitBlockManager extends AbstractBlockManager {
}
}
- Object eventsObj = ResourceConfigUtils.get(section, "events");
- EnumMap>> events = new EnumMap<>(EventTrigger.class);
- if (eventsObj instanceof Map, ?> eventsSection) {
- Map eventsSectionMap = MiscUtils.castToMap(eventsSection, false);
- for (Map.Entry eventEntry : eventsSectionMap.entrySet()) {
- try {
- EventTrigger eventTrigger = EventTrigger.valueOf(eventEntry.getKey().toUpperCase(Locale.ENGLISH));
- if (eventEntry.getValue() instanceof List> list) {
- if (list.size() == 1) {
- events.put(eventTrigger, List.of(BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(0), false))));
- } else if (list.size() == 2) {
- events.put(eventTrigger, List.of(
- BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(0), false)),
- BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(1), false))
- ));
- } else {
- List> eventsList = new ArrayList<>();
- for (Object event : list) {
- eventsList.add(BlockEventFunctions.fromMap(MiscUtils.castToMap(event, false)));
- }
- events.put(eventTrigger, eventsList);
- }
- } else if (eventEntry.getValue() instanceof Map, ?> eventSection) {
- events.put(eventTrigger, List.of(BlockEventFunctions.fromMap(MiscUtils.castToMap(eventSection, false))));
- }
- } catch (IllegalArgumentException e) {
- throw new LocalizedResourceConfigException("warning.config.event.invalid_trigger", eventEntry.getKey());
- }
- }
- }
+ Object eventsObj = ResourceConfigUtils.get(section, "events", "event");
+ EnumMap>> events = parseEvents(eventsObj);
Map behaviors = MiscUtils.castToMap(section.getOrDefault("behavior", Map.of()), false);
CustomBlock block = BukkitCustomBlock.builder(id)
@@ -543,6 +513,55 @@ public class BukkitBlockManager extends AbstractBlockManager {
}
}
+ private EnumMap>> parseEvents(Object eventsObj) {
+ EnumMap>> events = new EnumMap<>(EventTrigger.class);
+ if (eventsObj instanceof Map, ?> eventsSection) {
+ Map eventsSectionMap = MiscUtils.castToMap(eventsSection, false);
+ for (Map.Entry eventEntry : eventsSectionMap.entrySet()) {
+ try {
+ EventTrigger eventTrigger = EventTrigger.byName(eventEntry.getKey());
+ if (eventEntry.getValue() instanceof List> list) {
+ if (list.size() == 1) {
+ events.put(eventTrigger, List.of(BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(0), false))));
+ } else if (list.size() == 2) {
+ events.put(eventTrigger, List.of(
+ BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(0), false)),
+ BlockEventFunctions.fromMap(MiscUtils.castToMap(list.get(1), false))
+ ));
+ } else {
+ List> eventsList = new ArrayList<>();
+ for (Object event : list) {
+ eventsList.add(BlockEventFunctions.fromMap(MiscUtils.castToMap(event, false)));
+ }
+ events.put(eventTrigger, eventsList);
+ }
+ } else if (eventEntry.getValue() instanceof Map, ?> eventSection) {
+ events.put(eventTrigger, List.of(BlockEventFunctions.fromMap(MiscUtils.castToMap(eventSection, false))));
+ }
+ } catch (IllegalArgumentException e) {
+ throw new LocalizedResourceConfigException("warning.config.event.invalid_trigger", eventEntry.getKey());
+ }
+ }
+ } else if (eventsObj instanceof List> list) {
+ @SuppressWarnings("unchecked")
+ List