mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
添加掉落经验方块别名
This commit is contained in:
@@ -48,6 +48,7 @@ public class BukkitBlockBehaviors extends BlockBehaviors {
|
||||
public static final Key SNOWY_BLOCK = Key.from("craftengine:snowy_block");
|
||||
public static final Key HANGABLE_BLOCK = Key.from("craftengine:hangable_block");
|
||||
public static final Key DROP_EXPERIENCE_BLOCK = Key.from("craftengine:drop_experience_block");
|
||||
public static final Key DROP_EXP_BLOCK = Key.from("craftengine:drop_exp_block");
|
||||
|
||||
public static void init() {
|
||||
register(EMPTY, (block, args) -> EmptyBlockBehavior.INSTANCE);
|
||||
@@ -94,5 +95,6 @@ public class BukkitBlockBehaviors extends BlockBehaviors {
|
||||
register(SNOWY_BLOCK, SnowyBlockBehavior.FACTORY);
|
||||
register(HANGABLE_BLOCK, HangableBlockBehavior.FACTORY);
|
||||
register(DROP_EXPERIENCE_BLOCK, DropExperienceBlockBehavior.FACTORY);
|
||||
register(DROP_EXP_BLOCK, DropExperienceBlockBehavior.FACTORY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class DropExperienceBlockBehavior extends BukkitBlockBehavior {
|
||||
|
||||
@Override
|
||||
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
|
||||
NumberProvider amount = NumberProviders.fromObject(arguments.getOrDefault("amount", 0));
|
||||
NumberProvider amount = NumberProviders.fromObject(ResourceConfigUtils.get(arguments, "amount", "count"));
|
||||
Condition<Context> conditions = null;
|
||||
List<Condition<Context>> conditionList = ResourceConfigUtils.parseConfigAsList(ResourceConfigUtils.get(arguments, "conditions", "condition"), EventConditions::fromMap);
|
||||
if (conditionList.size() == 1) {
|
||||
|
||||
Reference in New Issue
Block a user