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
247412b1
Commit
247412b1
authored
Jun 17, 2022
by
Akka
Committed by
Melledy
Jun 17, 2022
Browse files
fix the rot of furniture
parent
211d7d6f
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/home/HomeBlockItem.java
View file @
247412b1
...
...
@@ -4,6 +4,7 @@ import dev.morphia.annotations.Entity;
import
dev.morphia.annotations.Id
;
import
emu.grasscutter.data.binout.HomeworldDefaultSaveData
;
import
emu.grasscutter.net.proto.HomeBlockArrangementInfoOuterClass.HomeBlockArrangementInfo
;
import
emu.grasscutter.utils.Position
;
import
lombok.AccessLevel
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -20,6 +21,7 @@ public class HomeBlockItem {
int
blockId
;
boolean
unlocked
;
List
<
HomeFurnitureItem
>
deployFurnitureList
;
List
<
HomeFurnitureItem
>
persistentFurnitureList
;
List
<
HomeAnimalItem
>
deployAnimalList
;
List
<
HomeNPCItem
>
deployNPCList
;
...
...
@@ -30,6 +32,10 @@ public class HomeBlockItem {
.
map
(
HomeFurnitureItem:
:
parseFrom
)
.
toList
();
this
.
persistentFurnitureList
=
homeBlockArrangementInfo
.
getPersistentFurnitureListList
().
stream
()
.
map
(
HomeFurnitureItem:
:
parseFrom
)
.
toList
();
this
.
deployAnimalList
=
homeBlockArrangementInfo
.
getDeployAnimalListList
().
stream
()
.
map
(
HomeAnimalItem:
:
parseFrom
)
.
toList
();
...
...
@@ -52,6 +58,7 @@ public class HomeBlockItem {
.
setComfortValue
(
calComfort
());
this
.
deployFurnitureList
.
forEach
(
f
->
proto
.
addDeployFurniureList
(
f
.
toProto
()));
this
.
persistentFurnitureList
.
forEach
(
f
->
proto
.
addDeployFurniureList
(
f
.
toProto
()));
this
.
deployAnimalList
.
forEach
(
f
->
proto
.
addDeployAnimalList
(
f
.
toProto
()));
this
.
deployNPCList
.
forEach
(
f
->
proto
.
addDeployNpcList
(
f
.
toProto
()));
...
...
@@ -59,7 +66,7 @@ public class HomeBlockItem {
}
public
static
HomeBlockItem
parseFrom
(
HomeworldDefaultSaveData
.
HomeBlock
homeBlock
)
{
// create from default setting
return
HomeBlockItem
.
of
()
.
blockId
(
homeBlock
.
getBlockId
())
.
unlocked
(
homeBlock
.
getFurnitures
()
!=
null
)
...
...
@@ -70,6 +77,7 @@ public class HomeBlockItem {
.
toList
())
.
deployAnimalList
(
List
.
of
())
.
deployNPCList
(
List
.
of
())
.
persistentFurnitureList
(
List
.
of
())
.
build
();
}
}
src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java
View file @
247412b1
...
...
@@ -6,6 +6,7 @@ import emu.grasscutter.data.binout.HomeworldDefaultSaveData;
import
emu.grasscutter.data.excels.ItemData
;
import
emu.grasscutter.net.proto.HomeFurnitureDataOuterClass
;
import
emu.grasscutter.net.proto.HomeMarkPointFurnitureDataOuterClass
;
import
emu.grasscutter.net.proto.VectorOuterClass
;
import
emu.grasscutter.utils.Position
;
import
lombok.AccessLevel
;
import
lombok.Builder
;
...
...
@@ -22,7 +23,7 @@ public class HomeFurnitureItem {
int
parentFurnitureIndex
;
Position
spawnPos
;
Position
spawnRot
;
int
version
;
public
HomeFurnitureDataOuterClass
.
HomeFurnitureData
toProto
(){
return
HomeFurnitureDataOuterClass
.
HomeFurnitureData
.
newBuilder
()
.
setFurnitureId
(
furnitureId
)
...
...
@@ -30,6 +31,7 @@ public class HomeFurnitureItem {
.
setParentFurnitureIndex
(
parentFurnitureIndex
)
.
setSpawnPos
(
spawnPos
.
toProto
())
.
setSpawnRot
(
spawnRot
.
toProto
())
.
setVersion
(
version
)
.
build
();
}
...
...
@@ -50,6 +52,7 @@ public class HomeFurnitureItem {
.
parentFurnitureIndex
(
homeFurnitureData
.
getParentFurnitureIndex
())
.
spawnPos
(
new
Position
(
homeFurnitureData
.
getSpawnPos
()))
.
spawnRot
(
new
Position
(
homeFurnitureData
.
getSpawnRot
()))
.
version
(
homeFurnitureData
.
getVersion
())
.
build
();
}
...
...
src/main/java/emu/grasscutter/game/home/HomeSceneItem.java
View file @
247412b1
...
...
@@ -26,7 +26,7 @@ public class HomeSceneItem {
Position
bornRot
;
Position
djinnPos
;
HomeFurnitureItem
mainHouse
;
int
tmpVersion
;
public
static
HomeSceneItem
parseFrom
(
HomeworldDefaultSaveData
defaultItem
,
int
sceneId
)
{
return
HomeSceneItem
.
of
()
.
sceneId
(
sceneId
)
...
...
@@ -56,6 +56,7 @@ public class HomeSceneItem {
this
.
bornRot
=
new
Position
(
arrangementInfo
.
getBornRot
());
this
.
djinnPos
=
new
Position
(
arrangementInfo
.
getDjinnPos
());
this
.
mainHouse
=
HomeFurnitureItem
.
parseFrom
(
arrangementInfo
.
getMainHouse
());
this
.
tmpVersion
=
arrangementInfo
.
getTmpVersion
();
}
public
int
getRoomSceneId
(){
...
...
@@ -81,7 +82,7 @@ public class HomeSceneItem {
.
setDjinnPos
(
djinnPos
.
toProto
())
.
setIsSetBornPos
(
true
)
.
setSceneId
(
sceneId
)
.
setTmpVersion
(
1
);
.
setTmpVersion
(
tmpVersion
);
if
(
mainHouse
!=
null
){
proto
.
setMainHouse
(
mainHouse
.
toProto
());
...
...
src/main/java/emu/grasscutter/game/managers/FurnitureManager.java
View file @
247412b1
...
...
@@ -124,10 +124,10 @@ public class FurnitureManager {
}
// check if player can take
if
(
slotItem
.
get
().
getBeginTime
()
+
slotItem
.
get
().
getDurTime
()
>=
Utils
.
getCurrentSeconds
()
&&
!
isFastFinish
){
player
.
getSession
().
send
(
new
PacketTakeFurnitureMakeRsp
(
Retcode
.
RET_FURNITURE_MAKE_UNFINISH_VALUE
,
makeId
,
null
,
null
));
return
;
}
//
if(slotItem.get().getBeginTime() + slotItem.get().getDurTime() >= Utils.getCurrentSeconds() && !isFastFinish){
//
player.getSession().send(new PacketTakeFurnitureMakeRsp(Retcode.RET_FURNITURE_MAKE_UNFINISH_VALUE, makeId, null, null));
//
return;
//
}
player
.
getInventory
().
addItem
(
makeData
.
getFurnitureItemID
(),
makeData
.
getCount
());
player
.
getHome
().
getFurnitureMakeSlotItemList
().
remove
(
slotItem
.
get
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketFurnitureCurModuleArrangeCountNotify.java
View file @
247412b1
...
...
@@ -12,45 +12,7 @@ public class PacketFurnitureCurModuleArrangeCountNotify extends BasePacket {
var
proto
=
FurnitureCurModuleArrangeCountNotifyOuterClass
.
FurnitureCurModuleArrangeCountNotify
.
newBuilder
();
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
360101
)
.
setValue
(
7
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
360201
)
.
setValue
(
7
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
360301
)
.
setValue
(
7
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
360401
)
.
setValue
(
2
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
360402
)
.
setValue
(
4
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
364301
)
.
setValue
(
1
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
364401
)
.
setValue
(
1
)
.
build
());
proto
.
addFurnitureArrangeCountList
(
Uint32PairOuterClass
.
Uint32Pair
.
newBuilder
()
.
setKey
(
3750102
)
.
setValue
(
1
)
.
build
());
// TODO
this
.
setData
(
proto
);
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketHomeBasicInfoNotify.java
View file @
247412b1
...
...
@@ -27,22 +27,9 @@ public class PacketHomeBasicInfoNotify extends BasePacket {
.
setCurRoomSceneId
(
homeScene
.
getRoomSceneId
())
.
setIsInEditMode
(
editMode
)
.
setHomeOwnerUid
(
player
.
getUid
())
.
setLevel
(
1
)
.
setLevel
(
player
.
getHome
().
getLevel
()
)
.
setOwnerNickName
(
player
.
getNickname
())
.
setLimitedShopInfo
(
HomeLimitedShopInfoOuterClass
.
HomeLimitedShopInfo
.
newBuilder
()
.
setDjinnPos
(
VectorOuterClass
.
Vector
.
newBuilder
()
.
setZ
(
192
)
.
setX
(
792
)
.
setY
(
316.7f
)
.
build
())
.
setDjinnRot
(
VectorOuterClass
.
Vector
.
newBuilder
()
.
setY
(
176
)
.
build
())
.
setNextCloseTime
(
Integer
.
MAX_VALUE
)
.
setNextGuestOpenTime
(
0
)
.
setNextOpenTime
(
0
)
.
setUid
(
player
.
getUid
())
.
build
())
// TODO limit shop
.
build
());
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java
View file @
247412b1
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.home.HomeBlockItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
...
...
@@ -22,14 +23,17 @@ public class PacketHomeComfortInfoNotify extends BasePacket {
List
<
HomeModuleComfortInfoOuterClass
.
HomeModuleComfortInfo
>
comfortInfoList
=
new
ArrayList
<>();
for
(
int
moduleId
:
player
.
getRealmList
())
{
var
homeScene
=
player
.
getHome
().
getHomeSceneItem
(
moduleId
+
2000
);
var
blockComfortList
=
homeScene
.
getBlockItems
().
values
().
stream
()
.
map
(
HomeBlockItem:
:
calComfort
)
.
toList
();
var
homeRoomScene
=
player
.
getHome
().
getHomeSceneItem
(
homeScene
.
getRoomSceneId
());
comfortInfoList
.
add
(
HomeModuleComfortInfoOuterClass
.
HomeModuleComfortInfo
.
newBuilder
()
.
setModuleId
(
moduleId
)
.
setRoomSceneComfortValue
(
1050
)
.
addWorldSceneBlockComfortValueList
(
750
)
.
addWorldSceneBlockComfortValueList
(
0
)
.
addWorldSceneBlockComfortValueList
(
0
)
.
addWorldSceneBlockComfortValueList
(
0
)
.
setRoomSceneComfortValue
(
homeRoomScene
.
calComfort
())
.
addAllWorldSceneBlockComfortValueList
(
blockComfortList
)
.
build
()
);
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketHomeSceneInitFinishRsp.java
View file @
247412b1
...
...
@@ -3,13 +3,14 @@ package emu.grasscutter.server.packet.send;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass
;
import
emu.grasscutter.net.proto.HomeSceneInitFinishReqOuterClass
;
public
class
PacketHomeSceneInitFinishRsp
extends
BasePacket
{
public
PacketHomeSceneInitFinishRsp
()
{
super
(
PacketOpcodes
.
HomeSceneInitFinishRsp
);
var
proto
=
HomeScene
ArrangementInfo
OuterClass
.
HomeScene
ArrangementInfo
.
newBuilder
();
var
proto
=
HomeScene
InitFinishReq
OuterClass
.
HomeScene
InitFinishReq
.
newBuilder
();
this
.
setData
(
proto
);
...
...
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