mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 00:44:46 +01:00
npc/animals arrangement & support enter room scene
This commit is contained in:
@@ -16,13 +16,12 @@ import java.util.List;
|
||||
@Builder(builderMethodName = "of")
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class HomeBlockItem {
|
||||
|
||||
@Id
|
||||
int blockId;
|
||||
boolean unlocked;
|
||||
|
||||
List<HomeFurnitureItem> deployFurnitureList;
|
||||
|
||||
List<HomeAnimalItem> deployAnimalList;
|
||||
List<HomeNPCItem> deployNPCList;
|
||||
|
||||
public void update(HomeBlockArrangementInfo homeBlockArrangementInfo) {
|
||||
this.blockId = homeBlockArrangementInfo.getBlockId();
|
||||
@@ -30,6 +29,14 @@ public class HomeBlockItem {
|
||||
this.deployFurnitureList = homeBlockArrangementInfo.getDeployFurniureListList().stream()
|
||||
.map(HomeFurnitureItem::parseFrom)
|
||||
.toList();
|
||||
|
||||
this.deployAnimalList = homeBlockArrangementInfo.getDeployAnimalListList().stream()
|
||||
.map(HomeAnimalItem::parseFrom)
|
||||
.toList();
|
||||
|
||||
this.deployNPCList = homeBlockArrangementInfo.getDeployNpcListList().stream()
|
||||
.map(HomeNPCItem::parseFrom)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public int calComfort(){
|
||||
@@ -45,6 +52,8 @@ public class HomeBlockItem {
|
||||
.setComfortValue(calComfort());
|
||||
|
||||
this.deployFurnitureList.forEach(f -> proto.addDeployFurniureList(f.toProto()));
|
||||
this.deployAnimalList.forEach(f -> proto.addDeployAnimalList(f.toProto()));
|
||||
this.deployNPCList.forEach(f -> proto.addDeployNpcList(f.toProto()));
|
||||
|
||||
return proto.build();
|
||||
}
|
||||
@@ -59,6 +68,8 @@ public class HomeBlockItem {
|
||||
homeBlock.getFurnitures().stream()
|
||||
.map(HomeFurnitureItem::parseFrom)
|
||||
.toList())
|
||||
.deployAnimalList(List.of())
|
||||
.deployNPCList(List.of())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user