Commit 2915b14c authored by Melledy's avatar Melledy
Browse files

2.7 Merge

parent 30c7bb94
package emu.grasscutter.data.custom; package emu.grasscutter.data.binout;
import com.github.davidmoten.rtreemulti.RTree; import com.github.davidmoten.rtreemulti.RTree;
import com.github.davidmoten.rtreemulti.geometry.Geometry; import com.github.davidmoten.rtreemulti.geometry.Geometry;
......
package emu.grasscutter.data.custom; package emu.grasscutter.data.binout;
import emu.grasscutter.utils.Position; import emu.grasscutter.utils.Position;
import lombok.AccessLevel; import lombok.AccessLevel;
...@@ -7,13 +7,26 @@ import lombok.experimental.FieldDefaults; ...@@ -7,13 +7,26 @@ import lombok.experimental.FieldDefaults;
import java.util.List; import java.util.List;
import com.google.gson.annotations.SerializedName;
@Data @Data
@FieldDefaults(level = AccessLevel.PRIVATE) @FieldDefaults(level = AccessLevel.PRIVATE)
public class SceneNpcBornEntry { public class SceneNpcBornEntry {
@SerializedName(value="id", alternate={"_id", "ID"})
int id; int id;
@SerializedName(value="configId", alternate={"_configId"})
int configId; int configId;
@SerializedName(value="pos", alternate={"_pos"})
Position pos; Position pos;
@SerializedName(value="rot", alternate={"_rot"})
Position rot; Position rot;
@SerializedName(value="groupId", alternate={"_groupId"})
int groupId; int groupId;
@SerializedName(value="suiteIdList", alternate={"_suiteIdList"})
List<Integer> suiteIdList; List<Integer> suiteIdList;
} }
package emu.grasscutter.data.def; package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource; import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType;
@ResourceType(name = "GatherExcelConfigData.json") @ResourceType(name = "GatherExcelConfigData.json")
public class GatherData extends GameResource { public class GatherData extends GameResource {
private int PointType; private int pointType;
private int Id; private int id;
private int GadgetId; private int gadgetId;
private int ItemId; private int itemId;
private int Cd; // Probably hours private int cd; // Probably hours
private boolean IsForbidGuest; private boolean isForbidGuest;
private boolean InitDisableInteract; private boolean initDisableInteract;
@Override @Override
public int getId() { public int getId() {
return this.PointType; return this.pointType;
} }
public int getGatherId() { public int getGatherId() {
return Id; return id;
} }
public int getGadgetId() { public int getGadgetId() {
return GadgetId; return gadgetId;
} }
public int getItemId() { public int getItemId() {
return ItemId; return itemId;
} }
public int getCd() { public int getCd() {
return Cd; return cd;
} }
public boolean isForbidGuest() { public boolean isForbidGuest() {
return IsForbidGuest; return isForbidGuest;
} }
public boolean initDisableInteract() { public boolean initDisableInteract() {
return InitDisableInteract; return initDisableInteract;
} }
@Override @Override
......
package emu.grasscutter.data.def; package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource; import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType;
...@@ -9,17 +9,17 @@ import java.util.List; ...@@ -9,17 +9,17 @@ import java.util.List;
@ResourceType(name = "InvestigationMonsterConfigData.json") @ResourceType(name = "InvestigationMonsterConfigData.json")
@Data @Data
public class InvestigationMonsterData extends GameResource { public class InvestigationMonsterData extends GameResource {
private int Id; private int id;
private int CityId; private int cityId;
private List<Integer> MonsterIdList; private List<Integer> monsterIdList;
private List<Integer> GroupIdList; private List<Integer> groupIdList;
private int RewardPreviewId; private int rewardPreviewId;
private String MapMarkCreateType; private String mapMarkCreateType;
private String MonsterCategory; private String monsterCategory;
@Override @Override
public int getId() { public int getId() {
return this.Id; return this.id;
} }
@Override @Override
......
package emu.grasscutter.game.dungeons.challenge; package emu.grasscutter.game.dungeons.challenge;
import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.data.common.ItemParamData;
import emu.grasscutter.data.def.DungeonData; import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.game.dungeons.challenge.trigger.ChallengeTrigger; import emu.grasscutter.game.dungeons.challenge.trigger.ChallengeTrigger;
import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
......
...@@ -60,7 +60,7 @@ public class EntityNPC extends GameEntity{ ...@@ -60,7 +60,7 @@ public class EntityNPC extends GameEntity{
SceneEntityInfoOuterClass.SceneEntityInfo.Builder entityInfo = SceneEntityInfoOuterClass.SceneEntityInfo.newBuilder() SceneEntityInfoOuterClass.SceneEntityInfo.Builder entityInfo = SceneEntityInfoOuterClass.SceneEntityInfo.newBuilder()
.setEntityId(getId()) .setEntityId(getId())
.setEntityType(ProtEntityTypeOuterClass.ProtEntityType.PROT_ENTITY_NPC) .setEntityType(ProtEntityTypeOuterClass.ProtEntityType.PROT_ENTITY_TYPE_NPC)
.setMotionInfo(MotionInfoOuterClass.MotionInfo.newBuilder() .setMotionInfo(MotionInfoOuterClass.MotionInfo.newBuilder()
.setPos(getPosition().toProto()) .setPos(getPosition().toProto())
.setRot(getRotation().toProto()) .setRot(getRotation().toProto())
......
...@@ -5,21 +5,20 @@ import emu.grasscutter.game.entity.EntityGadget; ...@@ -5,21 +5,20 @@ import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.proto.BossChestInfoOuterClass.BossChestInfo; import emu.grasscutter.net.proto.BossChestInfoOuterClass.BossChestInfo;
import emu.grasscutter.net.proto.InterOpTypeOuterClass; import emu.grasscutter.net.proto.InterOpTypeOuterClass;
import emu.grasscutter.net.proto.InterOpTypeOuterClass.InterOpType;
import emu.grasscutter.net.proto.InteractTypeOuterClass; import emu.grasscutter.net.proto.InteractTypeOuterClass;
import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType; import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo; import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
import emu.grasscutter.scripts.constants.ScriptGadgetState; import emu.grasscutter.scripts.constants.ScriptGadgetState;
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp; import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
import static emu.grasscutter.net.proto.InterOpTypeOuterClass.InterOpType.INTER_OP_START;
public class GadgetChest extends GadgetContent { public class GadgetChest extends GadgetContent {
public GadgetChest(EntityGadget gadget) { public GadgetChest(EntityGadget gadget) {
super(gadget); super(gadget);
} }
public boolean onInteract(Player player, InterOpTypeOuterClass.InterOpType opType) { public boolean onInteract(Player player, InterOpType opType) {
var chestInteractHandlerMap = getGadget().getScene().getWorld().getServer().getWorldDataManager().getChestInteractHandlerMap(); var chestInteractHandlerMap = getGadget().getScene().getWorld().getServer().getWorldDataManager().getChestInteractHandlerMap();
var handler = chestInteractHandlerMap.get(getGadget().getGadgetData().getJsonName()); var handler = chestInteractHandlerMap.get(getGadget().getGadgetData().getJsonName());
if(handler == null){ if(handler == null){
...@@ -27,8 +26,8 @@ public class GadgetChest extends GadgetContent { ...@@ -27,8 +26,8 @@ public class GadgetChest extends GadgetContent {
return false; return false;
} }
if(opType == INTER_OP_START && handler.isTwoStep()){ if(opType == InterOpType.INTER_OP_TYPE_START && handler.isTwoStep()){
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_OPEN_CHEST, INTER_OP_START)); player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_TYPE_OPEN_CHEST, InterOpType.INTER_OP_TYPE_START));
return false; return false;
}else{ }else{
var success = handler.onInteract(this, player); var success = handler.onInteract(this, player);
...@@ -37,7 +36,7 @@ public class GadgetChest extends GadgetContent { ...@@ -37,7 +36,7 @@ public class GadgetChest extends GadgetContent {
} }
getGadget().updateState(ScriptGadgetState.ChestOpened); getGadget().updateState(ScriptGadgetState.ChestOpened);
player.sendPacket(new PacketGadgetInteractRsp(this.getGadget(), InteractTypeOuterClass.InteractType.INTERACT_OPEN_CHEST)); player.sendPacket(new PacketGadgetInteractRsp(this.getGadget(), InteractTypeOuterClass.InteractType.INTERACT_TYPE_OPEN_CHEST));
// let the chest disappear // let the chest disappear
getGadget().die(); getGadget().die();
return true; return true;
......
package emu.grasscutter.game.entity.gadget; package emu.grasscutter.game.entity.gadget;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.GatherData; import emu.grasscutter.data.excels.GatherData;
import emu.grasscutter.game.entity.EntityGadget; import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
......
...@@ -19,7 +19,7 @@ public class GadgetRewardStatue extends GadgetContent { ...@@ -19,7 +19,7 @@ public class GadgetRewardStatue extends GadgetContent {
dungeonChallenge.getStatueDrops(player); dungeonChallenge.getStatueDrops(player);
} }
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_OPEN_STATUE)); player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_TYPE_OPEN_STATUE));
return false; return false;
} }
......
...@@ -4,7 +4,7 @@ import com.google.gson.reflect.TypeToken; ...@@ -4,7 +4,7 @@ import com.google.gson.reflect.TypeToken;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.DataLoader; import emu.grasscutter.data.DataLoader;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.RewardPreviewData; import emu.grasscutter.data.excels.RewardPreviewData;
import emu.grasscutter.game.entity.gadget.chest.BossChestInteractHandler; import emu.grasscutter.game.entity.gadget.chest.BossChestInteractHandler;
import emu.grasscutter.game.entity.gadget.chest.ChestInteractHandler; import emu.grasscutter.game.entity.gadget.chest.ChestInteractHandler;
import emu.grasscutter.game.entity.gadget.chest.NormalChestInteractHandler; import emu.grasscutter.game.entity.gadget.chest.NormalChestInteractHandler;
......
...@@ -4,8 +4,8 @@ import com.github.davidmoten.rtreemulti.RTree; ...@@ -4,8 +4,8 @@ import com.github.davidmoten.rtreemulti.RTree;
import com.github.davidmoten.rtreemulti.geometry.Geometry; import com.github.davidmoten.rtreemulti.geometry.Geometry;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.MonsterData; import emu.grasscutter.data.excels.MonsterData;
import emu.grasscutter.data.def.WorldLevelData; import emu.grasscutter.data.excels.WorldLevelData;
import emu.grasscutter.game.entity.EntityGadget; import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.entity.EntityMonster; import emu.grasscutter.game.entity.EntityMonster;
import emu.grasscutter.game.entity.EntityNPC; import emu.grasscutter.game.entity.EntityNPC;
...@@ -414,7 +414,7 @@ public class SceneScriptManager { ...@@ -414,7 +414,7 @@ public class SceneScriptManager {
} }
public void meetEntities(List<? extends GameEntity> gameEntity){ public void meetEntities(List<? extends GameEntity> gameEntity){
getScene().addEntities(gameEntity, VisionTypeOuterClass.VisionType.VISION_MEET); getScene().addEntities(gameEntity, VisionTypeOuterClass.VisionType.VISION_TYPE_MEET);
} }
public void addEntities(List<? extends GameEntity> gameEntity){ public void addEntities(List<? extends GameEntity> gameEntity){
...@@ -434,7 +434,7 @@ public class SceneScriptManager { ...@@ -434,7 +434,7 @@ public class SceneScriptManager {
.filter(e -> configSet.contains(e.getConfigId())) .filter(e -> configSet.contains(e.getConfigId()))
.toList(); .toList();
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_MISS); getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_TYPE_MISS);
} }
public void removeGadgetsInGroup(SceneGroup group, SceneSuite suite) { public void removeGadgetsInGroup(SceneGroup group, SceneSuite suite) {
var configSet = suite.sceneGadgets.stream() var configSet = suite.sceneGadgets.stream()
...@@ -446,6 +446,6 @@ public class SceneScriptManager { ...@@ -446,6 +446,6 @@ public class SceneScriptManager {
.filter(e -> configSet.contains(e.getConfigId())) .filter(e -> configSet.contains(e.getConfigId()))
.toList(); .toList();
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_MISS); getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_TYPE_MISS);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment