2.7 Merge

This commit is contained in:
Melledy 2022-06-17 23:36:16 -07:00
parent 4501db1135
commit 45438cd2a7
11 changed files with 54 additions and 42 deletions

View File

@ -1,4 +1,4 @@
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import com.github.davidmoten.rtreemulti.RTree;
import com.github.davidmoten.rtreemulti.geometry.Geometry;

View File

@ -1,4 +1,4 @@
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import emu.grasscutter.utils.Position;
import lombok.AccessLevel;
@ -7,13 +7,26 @@ import lombok.experimental.FieldDefaults;
import java.util.List;
import com.google.gson.annotations.SerializedName;
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class SceneNpcBornEntry {
@SerializedName(value="id", alternate={"_id", "ID"})
int id;
@SerializedName(value="configId", alternate={"_configId"})
int configId;
@SerializedName(value="pos", alternate={"_pos"})
Position pos;
@SerializedName(value="rot", alternate={"_rot"})
Position rot;
@SerializedName(value="groupId", alternate={"_groupId"})
int groupId;
@SerializedName(value="suiteIdList", alternate={"_suiteIdList"})
List<Integer> suiteIdList;
}

View File

@ -1,45 +1,45 @@
package emu.grasscutter.data.def;
package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
@ResourceType(name = "GatherExcelConfigData.json")
public class GatherData extends GameResource {
private int PointType;
private int Id;
private int GadgetId;
private int ItemId;
private int Cd; // Probably hours
private boolean IsForbidGuest;
private boolean InitDisableInteract;
private int pointType;
private int id;
private int gadgetId;
private int itemId;
private int cd; // Probably hours
private boolean isForbidGuest;
private boolean initDisableInteract;
@Override
public int getId() {
return this.PointType;
return this.pointType;
}
public int getGatherId() {
return Id;
return id;
}
public int getGadgetId() {
return GadgetId;
return gadgetId;
}
public int getItemId() {
return ItemId;
return itemId;
}
public int getCd() {
return Cd;
return cd;
}
public boolean isForbidGuest() {
return IsForbidGuest;
return isForbidGuest;
}
public boolean initDisableInteract() {
return InitDisableInteract;
return initDisableInteract;
}
@Override

View File

@ -1,4 +1,4 @@
package emu.grasscutter.data.def;
package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
@ -9,17 +9,17 @@ import java.util.List;
@ResourceType(name = "InvestigationMonsterConfigData.json")
@Data
public class InvestigationMonsterData extends GameResource {
private int Id;
private int CityId;
private List<Integer> MonsterIdList;
private List<Integer> GroupIdList;
private int RewardPreviewId;
private String MapMarkCreateType;
private String MonsterCategory;
private int id;
private int cityId;
private List<Integer> monsterIdList;
private List<Integer> groupIdList;
private int rewardPreviewId;
private String mapMarkCreateType;
private String monsterCategory;
@Override
public int getId() {
return this.Id;
return this.id;
}
@Override

View File

@ -1,7 +1,7 @@
package emu.grasscutter.game.dungeons.challenge;
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.inventory.GameItem;
import emu.grasscutter.game.player.Player;

View File

@ -60,7 +60,7 @@ public class EntityNPC extends GameEntity{
SceneEntityInfoOuterClass.SceneEntityInfo.Builder entityInfo = SceneEntityInfoOuterClass.SceneEntityInfo.newBuilder()
.setEntityId(getId())
.setEntityType(ProtEntityTypeOuterClass.ProtEntityType.PROT_ENTITY_NPC)
.setEntityType(ProtEntityTypeOuterClass.ProtEntityType.PROT_ENTITY_TYPE_NPC)
.setMotionInfo(MotionInfoOuterClass.MotionInfo.newBuilder()
.setPos(getPosition().toProto())
.setRot(getRotation().toProto())

View File

@ -5,21 +5,20 @@ import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.proto.BossChestInfoOuterClass.BossChestInfo;
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.InteractType;
import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
import emu.grasscutter.scripts.constants.ScriptGadgetState;
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
import static emu.grasscutter.net.proto.InterOpTypeOuterClass.InterOpType.INTER_OP_START;
public class GadgetChest extends GadgetContent {
public GadgetChest(EntityGadget 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 handler = chestInteractHandlerMap.get(getGadget().getGadgetData().getJsonName());
if(handler == null){
@ -27,8 +26,8 @@ public class GadgetChest extends GadgetContent {
return false;
}
if(opType == INTER_OP_START && handler.isTwoStep()){
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_OPEN_CHEST, INTER_OP_START));
if(opType == InterOpType.INTER_OP_TYPE_START && handler.isTwoStep()){
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_TYPE_OPEN_CHEST, InterOpType.INTER_OP_TYPE_START));
return false;
}else{
var success = handler.onInteract(this, player);
@ -37,7 +36,7 @@ public class GadgetChest extends GadgetContent {
}
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
getGadget().die();
return true;

View File

@ -1,7 +1,7 @@
package emu.grasscutter.game.entity.gadget;
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.inventory.GameItem;
import emu.grasscutter.game.player.Player;

View File

@ -19,7 +19,7 @@ public class GadgetRewardStatue extends GadgetContent {
dungeonChallenge.getStatueDrops(player);
}
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_OPEN_STATUE));
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_TYPE_OPEN_STATUE));
return false;
}

View File

@ -4,7 +4,7 @@ import com.google.gson.reflect.TypeToken;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.DataLoader;
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.ChestInteractHandler;
import emu.grasscutter.game.entity.gadget.chest.NormalChestInteractHandler;

View File

@ -4,8 +4,8 @@ import com.github.davidmoten.rtreemulti.RTree;
import com.github.davidmoten.rtreemulti.geometry.Geometry;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.MonsterData;
import emu.grasscutter.data.def.WorldLevelData;
import emu.grasscutter.data.excels.MonsterData;
import emu.grasscutter.data.excels.WorldLevelData;
import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.entity.EntityMonster;
import emu.grasscutter.game.entity.EntityNPC;
@ -414,7 +414,7 @@ public class SceneScriptManager {
}
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){
@ -434,7 +434,7 @@ public class SceneScriptManager {
.filter(e -> configSet.contains(e.getConfigId()))
.toList();
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_MISS);
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_TYPE_MISS);
}
public void removeGadgetsInGroup(SceneGroup group, SceneSuite suite) {
var configSet = suite.sceneGadgets.stream()
@ -446,6 +446,6 @@ public class SceneScriptManager {
.filter(e -> configSet.contains(e.getConfigId()))
.toList();
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_MISS);
getScene().removeEntities(toRemove, VisionTypeOuterClass.VisionType.VISION_TYPE_MISS);
}
}