mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 02:44:19 +00:00
Merge remote-tracking branch 'origin/unstable' into unstable
# Conflicts: # src/main/java/emu/grasscutter/game/talk/TalkManager.java
This commit is contained in:
commit
2017bc57a0
@ -4,11 +4,10 @@ import com.google.gson.annotations.SerializedName;
|
|||||||
import emu.grasscutter.data.GameResource;
|
import emu.grasscutter.data.GameResource;
|
||||||
import emu.grasscutter.data.ResourceType;
|
import emu.grasscutter.data.ResourceType;
|
||||||
import emu.grasscutter.game.talk.TalkExec;
|
import emu.grasscutter.game.talk.TalkExec;
|
||||||
|
import java.util.List;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@ResourceType(name = "TalkExcelConfigData.json")
|
@ResourceType(name = "TalkExcelConfigData.json")
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Data
|
@Data
|
||||||
|
@ -21,15 +21,14 @@ import emu.grasscutter.net.proto.AbilityMixinCostStaminaOuterClass.AbilityMixinC
|
|||||||
import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry;
|
import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry;
|
||||||
import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction;
|
import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction;
|
||||||
import io.netty.util.concurrent.FastThreadLocalThread;
|
import io.netty.util.concurrent.FastThreadLocalThread;
|
||||||
import lombok.Getter;
|
|
||||||
import org.reflections.Reflections;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.LinkedBlockingDeque;
|
import java.util.concurrent.LinkedBlockingDeque;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.reflections.Reflections;
|
||||||
|
|
||||||
public final class AbilityManager extends BasePlayerManager {
|
public final class AbilityManager extends BasePlayerManager {
|
||||||
public static final ExecutorService eventExecutor;
|
public static final ExecutorService eventExecutor;
|
||||||
|
@ -63,7 +63,8 @@ public class BasicActivityConditionExecutor implements ActivityConditionExecutor
|
|||||||
(BooleanSupplier)
|
(BooleanSupplier)
|
||||||
() ->
|
() ->
|
||||||
activityConditionsHandlers
|
activityConditionsHandlers
|
||||||
.getOrDefault(c.getType(), new UnknownActivityConditionHandler(c.getType()))
|
.getOrDefault(
|
||||||
|
c.getType(), new UnknownActivityConditionHandler(c.getType()))
|
||||||
.execute(activity, activityConfig, c.paramArray()))
|
.execute(activity, activityConfig, c.paramArray()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
@ -15,8 +15,7 @@ public class UnknownActivityConditionHandler extends ActivityConditionBaseHandle
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(
|
public boolean execute(
|
||||||
PlayerActivityData activityData, ActivityConfigItem activityConfig, int... params) {
|
PlayerActivityData activityData, ActivityConfigItem activityConfig, int... params) {
|
||||||
Grasscutter.getLogger().error("Called unknown condition handler {}.",
|
Grasscutter.getLogger().error("Called unknown condition handler {}.", conditions.name());
|
||||||
conditions.name());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@ public final class TalkManager extends BasePlayerManager {
|
|||||||
var entity = player.getScene().getEntityById(npcEntityId);
|
var entity = player.getScene().getEntityById(npcEntityId);
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
// The config ID of the entity is the NPC's ID.
|
// The config ID of the entity is the NPC's ID.
|
||||||
if (!talkData.getNpcId().contains(entity.getConfigId()))
|
if (!talkData.getNpcId().contains(entity.getConfigId())) return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the talk action on associated handlers.
|
// Execute the talk action on associated handlers.
|
||||||
|
@ -5,11 +5,10 @@ import emu.grasscutter.utils.Utils;
|
|||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.DefaultEventLoop;
|
import io.netty.channel.DefaultEventLoop;
|
||||||
import kcp.highway.KcpListener;
|
|
||||||
import kcp.highway.Ukcp;
|
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import kcp.highway.KcpListener;
|
||||||
|
import kcp.highway.Ukcp;
|
||||||
|
|
||||||
public class GameSessionManager {
|
public class GameSessionManager {
|
||||||
private static final DefaultEventLoop logicThread = new DefaultEventLoop();
|
private static final DefaultEventLoop logicThread = new DefaultEventLoop();
|
||||||
|
Loading…
Reference in New Issue
Block a user