Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
2915b14c
Commit
2915b14c
authored
Jun 17, 2022
by
Melledy
Browse files
2.7 Merge
parent
30c7bb94
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/binout/SceneNpcBornData.java
View file @
2915b14c
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
;
...
...
src/main/java/emu/grasscutter/data/binout/SceneNpcBornEntry.java
View file @
2915b14c
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
;
}
}
src/main/java/emu/grasscutter/data/excels/GatherData.java
View file @
2915b14c
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
P
ointType
;
private
int
p
ointType
;
private
int
I
d
;
private
int
i
d
;
private
int
G
adgetId
;
private
int
g
adgetId
;
private
int
I
temId
;
private
int
i
temId
;
private
int
C
d
;
// Probably hours
private
int
c
d
;
// Probably hours
private
boolean
I
sForbidGuest
;
private
boolean
i
sForbidGuest
;
private
boolean
I
nitDisableInteract
;
private
boolean
i
nitDisableInteract
;
@Override
@Override
public
int
getId
()
{
public
int
getId
()
{
return
this
.
P
ointType
;
return
this
.
p
ointType
;
}
}
public
int
getGatherId
()
{
public
int
getGatherId
()
{
return
I
d
;
return
i
d
;
}
}
public
int
getGadgetId
()
{
public
int
getGadgetId
()
{
return
G
adgetId
;
return
g
adgetId
;
}
}
public
int
getItemId
()
{
public
int
getItemId
()
{
return
I
temId
;
return
i
temId
;
}
}
public
int
getCd
()
{
public
int
getCd
()
{
return
C
d
;
return
c
d
;
}
}
public
boolean
isForbidGuest
()
{
public
boolean
isForbidGuest
()
{
return
I
sForbidGuest
;
return
i
sForbidGuest
;
}
}
public
boolean
initDisableInteract
()
{
public
boolean
initDisableInteract
()
{
return
I
nitDisableInteract
;
return
i
nitDisableInteract
;
}
}
@Override
@Override
...
...
src/main/java/emu/grasscutter/data/excels/InvestigationMonsterData.java
View file @
2915b14c
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
I
d
;
private
int
i
d
;
private
int
C
ityId
;
private
int
c
ityId
;
private
List
<
Integer
>
M
onsterIdList
;
private
List
<
Integer
>
m
onsterIdList
;
private
List
<
Integer
>
G
roupIdList
;
private
List
<
Integer
>
g
roupIdList
;
private
int
R
ewardPreviewId
;
private
int
r
ewardPreviewId
;
private
String
M
apMarkCreateType
;
private
String
m
apMarkCreateType
;
private
String
M
onsterCategory
;
private
String
m
onsterCategory
;
@Override
@Override
public
int
getId
()
{
public
int
getId
()
{
return
this
.
I
d
;
return
this
.
i
d
;
}
}
@Override
@Override
...
...
src/main/java/emu/grasscutter/game/dungeons/challenge/DungeonChallenge.java
View file @
2915b14c
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
;
...
...
src/main/java/emu/grasscutter/game/entity/EntityNPC.java
View file @
2915b14c
...
@@ -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
())
...
...
src/main/java/emu/grasscutter/game/entity/gadget/GadgetChest.java
View file @
2915b14c
...
@@ -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
;
...
...
src/main/java/emu/grasscutter/game/entity/gadget/GadgetGatherPoint.java
View file @
2915b14c
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
;
...
...
src/main/java/emu/grasscutter/game/entity/gadget/GadgetRewardStatue.java
View file @
2915b14c
...
@@ -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
;
}
}
...
...
src/main/java/emu/grasscutter/game/world/WorldDataManager.java
View file @
2915b14c
...
@@ -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
;
...
...
src/main/java/emu/grasscutter/scripts/SceneScriptManager.java
View file @
2915b14c
...
@@ -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
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment