mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-03 06:12:24 +00:00
重构条件
This commit is contained in:
@@ -33,7 +33,7 @@ public class WorldGuardRegionCondition<CTX extends Context> implements Condition
|
||||
this.regions = regions;
|
||||
}
|
||||
|
||||
public static <CTX extends Context> ConditionFactory<CTX> factory() {
|
||||
public static <CTX extends Context> ConditionFactory<CTX, WorldGuardRegionCondition<CTX>> factory() {
|
||||
return new Factory<>();
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ public class WorldGuardRegionCondition<CTX extends Context> implements Condition
|
||||
}
|
||||
}
|
||||
|
||||
private static class Factory<CTX extends Context> implements ConditionFactory<CTX> {
|
||||
private static class Factory<CTX extends Context> implements ConditionFactory<CTX, WorldGuardRegionCondition<CTX>> {
|
||||
|
||||
@Override
|
||||
public Condition<CTX> create(Map<String, Object> arguments) {
|
||||
public WorldGuardRegionCondition<CTX> create(Map<String, Object> arguments) {
|
||||
int mode = ResourceConfigUtils.getAsInt(arguments.getOrDefault("mode", 1), "mode") - 1;
|
||||
MatchMode matchMode = MatchMode.values()[mode];
|
||||
List<String> regions = MiscUtils.getAsStringList(arguments.get("regions"));
|
||||
|
||||
@@ -119,6 +119,7 @@ public class BukkitSeatManager implements SeatManager, Listener {
|
||||
location.add(0,-0.35,0);
|
||||
}
|
||||
seat.remove();
|
||||
location.add(0, 0.2, 0); // 防止座椅较低卡进地下
|
||||
EntityUtils.safeDismount(player, location);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user