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
025e5d3c
Commit
025e5d3c
authored
Oct 13, 2022
by
github-actions
Browse files
Fix whitespace [skip actions]
parent
d1d39db5
Changes
16
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Grasscutter.java
View file @
025e5d3c
src/main/java/emu/grasscutter/data/ResourceLoader.java
View file @
025e5d3c
src/main/java/emu/grasscutter/data/excels/DailyDungeonData.java
View file @
025e5d3c
src/main/java/emu/grasscutter/data/excels/ItemData.java
View file @
025e5d3c
src/main/java/emu/grasscutter/database/DatabaseManager.java
View file @
025e5d3c
src/main/java/emu/grasscutter/game/home/GameHome.java
View file @
025e5d3c
...
@@ -39,11 +39,11 @@ public class GameHome {
...
@@ -39,11 +39,11 @@ public class GameHome {
ConcurrentHashMap
<
Integer
,
HomeSceneItem
>
sceneMap
;
ConcurrentHashMap
<
Integer
,
HomeSceneItem
>
sceneMap
;
Set
<
Integer
>
unlockedHomeBgmList
;
Set
<
Integer
>
unlockedHomeBgmList
;
public
void
save
(){
public
void
save
()
{
DatabaseHelper
.
saveHome
(
this
);
DatabaseHelper
.
saveHome
(
this
);
}
}
public
static
GameHome
getByUid
(
Integer
uid
){
public
static
GameHome
getByUid
(
Integer
uid
)
{
var
home
=
DatabaseHelper
.
getHomeByUid
(
uid
);
var
home
=
DatabaseHelper
.
getHomeByUid
(
uid
);
if
(
home
==
null
)
{
if
(
home
==
null
)
{
home
=
GameHome
.
create
(
uid
);
home
=
GameHome
.
create
(
uid
);
...
@@ -51,7 +51,7 @@ public class GameHome {
...
@@ -51,7 +51,7 @@ public class GameHome {
return
home
;
return
home
;
}
}
public
static
GameHome
create
(
Integer
uid
){
public
static
GameHome
create
(
Integer
uid
)
{
return
GameHome
.
of
()
return
GameHome
.
of
()
.
ownerUid
(
uid
)
.
ownerUid
(
uid
)
.
level
(
1
)
.
level
(
1
)
...
@@ -62,7 +62,7 @@ public class GameHome {
...
@@ -62,7 +62,7 @@ public class GameHome {
public
HomeSceneItem
getHomeSceneItem
(
int
sceneId
)
{
public
HomeSceneItem
getHomeSceneItem
(
int
sceneId
)
{
return
sceneMap
.
computeIfAbsent
(
sceneId
,
e
->
{
return
sceneMap
.
computeIfAbsent
(
sceneId
,
e
->
{
var
defaultItem
=
GameData
.
getHomeworldDefaultSaveData
().
get
(
sceneId
);
var
defaultItem
=
GameData
.
getHomeworldDefaultSaveData
().
get
(
sceneId
);
if
(
defaultItem
!=
null
){
if
(
defaultItem
!=
null
)
{
Grasscutter
.
getLogger
().
info
(
"Set player {} home {} to initial setting"
,
ownerUid
,
sceneId
);
Grasscutter
.
getLogger
().
info
(
"Set player {} home {} to initial setting"
,
ownerUid
,
sceneId
);
return
HomeSceneItem
.
parseFrom
(
defaultItem
,
sceneId
);
return
HomeSceneItem
.
parseFrom
(
defaultItem
,
sceneId
);
}
}
...
@@ -87,7 +87,7 @@ public class GameHome {
...
@@ -87,7 +87,7 @@ public class GameHome {
return
this
.
player
;
return
this
.
player
;
}
}
public
HomeWorldLevelData
getLevelData
(){
public
HomeWorldLevelData
getLevelData
()
{
return
GameData
.
getHomeWorldLevelDataMap
().
get
(
level
);
return
GameData
.
getHomeWorldLevelDataMap
().
get
(
level
);
}
}
...
...
src/main/java/emu/grasscutter/game/home/HomeSceneItem.java
View file @
025e5d3c
...
@@ -42,10 +42,10 @@ public class HomeSceneItem {
...
@@ -42,10 +42,10 @@ public class HomeSceneItem {
.
build
();
.
build
();
}
}
public
void
update
(
HomeSceneArrangementInfo
arrangementInfo
){
public
void
update
(
HomeSceneArrangementInfo
arrangementInfo
)
{
for
(
var
blockItem
:
arrangementInfo
.
getBlockArrangementInfoListList
()){
for
(
var
blockItem
:
arrangementInfo
.
getBlockArrangementInfoListList
())
{
var
block
=
this
.
blockItems
.
get
(
blockItem
.
getBlockId
());
var
block
=
this
.
blockItems
.
get
(
blockItem
.
getBlockId
());
if
(
block
==
null
){
if
(
block
==
null
)
{
Grasscutter
.
getLogger
().
warn
(
"Could not found the Home Block {}"
,
blockItem
.
getBlockId
());
Grasscutter
.
getLogger
().
warn
(
"Could not found the Home Block {}"
,
blockItem
.
getBlockId
());
continue
;
continue
;
}
}
...
@@ -61,20 +61,20 @@ public class HomeSceneItem {
...
@@ -61,20 +61,20 @@ public class HomeSceneItem {
this
.
tmpVersion
=
arrangementInfo
.
getTmpVersion
();
this
.
tmpVersion
=
arrangementInfo
.
getTmpVersion
();
}
}
public
int
getRoomSceneId
(){
public
int
getRoomSceneId
()
{
if
(
mainHouse
==
null
||
mainHouse
.
getAsItem
()
==
null
){
if
(
mainHouse
==
null
||
mainHouse
.
getAsItem
()
==
null
)
{
return
0
;
return
0
;
}
}
return
mainHouse
.
getAsItem
().
getRoomSceneId
();
return
mainHouse
.
getAsItem
().
getRoomSceneId
();
}
}
public
int
calComfort
(){
public
int
calComfort
()
{
return
this
.
blockItems
.
values
().
stream
()
return
this
.
blockItems
.
values
().
stream
()
.
mapToInt
(
HomeBlockItem:
:
calComfort
)
.
mapToInt
(
HomeBlockItem:
:
calComfort
)
.
sum
();
.
sum
();
}
}
public
HomeSceneArrangementInfo
toProto
(){
public
HomeSceneArrangementInfo
toProto
()
{
var
proto
=
HomeSceneArrangementInfo
.
newBuilder
();
var
proto
=
HomeSceneArrangementInfo
.
newBuilder
();
blockItems
.
values
().
forEach
(
b
->
proto
.
addBlockArrangementInfoList
(
b
.
toProto
()));
blockItems
.
values
().
forEach
(
b
->
proto
.
addBlockArrangementInfoList
(
b
.
toProto
()));
...
@@ -87,7 +87,7 @@ public class HomeSceneItem {
...
@@ -87,7 +87,7 @@ public class HomeSceneItem {
.
setUnk2700BJHAMKKECEI
(
homeBgmId
)
.
setUnk2700BJHAMKKECEI
(
homeBgmId
)
.
setTmpVersion
(
tmpVersion
);
.
setTmpVersion
(
tmpVersion
);
if
(
mainHouse
!=
null
){
if
(
mainHouse
!=
null
)
{
proto
.
setMainHouse
(
mainHouse
.
toProto
());
proto
.
setMainHouse
(
mainHouse
.
toProto
());
}
}
return
proto
.
build
();
return
proto
.
build
();
...
...
src/main/java/emu/grasscutter/game/inventory/GameItem.java
View file @
025e5d3c
src/main/java/emu/grasscutter/game/player/PlayerCodex.java
View file @
025e5d3c
...
@@ -27,7 +27,7 @@ public class PlayerCodex {
...
@@ -27,7 +27,7 @@ public class PlayerCodex {
@Getter
private
Set
<
Integer
>
unlockedReliquary
;
@Getter
private
Set
<
Integer
>
unlockedReliquary
;
@Getter
private
Set
<
Integer
>
unlockedReliquarySuitCodex
;
@Getter
private
Set
<
Integer
>
unlockedReliquarySuitCodex
;
public
PlayerCodex
(){
public
PlayerCodex
()
{
this
.
unlockedWeapon
=
new
HashSet
<>();
this
.
unlockedWeapon
=
new
HashSet
<>();
this
.
unlockedAnimal
=
new
HashMap
<>();
this
.
unlockedAnimal
=
new
HashMap
<>();
this
.
unlockedMaterial
=
new
HashSet
<>();
this
.
unlockedMaterial
=
new
HashSet
<>();
...
@@ -38,7 +38,7 @@ public class PlayerCodex {
...
@@ -38,7 +38,7 @@ public class PlayerCodex {
this
.
unlockedReliquarySuitCodex
=
new
HashSet
<>();
this
.
unlockedReliquarySuitCodex
=
new
HashSet
<>();
}
}
public
PlayerCodex
(
Player
player
){
public
PlayerCodex
(
Player
player
)
{
this
();
this
();
this
.
player
=
player
;
this
.
player
=
player
;
}
}
...
@@ -48,7 +48,7 @@ public class PlayerCodex {
...
@@ -48,7 +48,7 @@ public class PlayerCodex {
this
.
fixReliquaries
();
this
.
fixReliquaries
();
}
}
public
void
checkAddedItem
(
GameItem
item
){
public
void
checkAddedItem
(
GameItem
item
)
{
val
itemData
=
item
.
getItemData
();
val
itemData
=
item
.
getItemData
();
val
itemId
=
item
.
getItemId
();
val
itemId
=
item
.
getItemId
();
switch
(
itemData
.
getItemType
())
{
switch
(
itemData
.
getItemType
())
{
...
@@ -85,7 +85,7 @@ public class PlayerCodex {
...
@@ -85,7 +85,7 @@ public class PlayerCodex {
}
}
}
}
public
void
checkAnimal
(
GameEntity
target
,
CodexAnimalData
.
CountType
countType
){
public
void
checkAnimal
(
GameEntity
target
,
CodexAnimalData
.
CountType
countType
)
{
if
(
target
instanceof
EntityMonster
)
{
if
(
target
instanceof
EntityMonster
)
{
val
monsterId
=
((
EntityMonster
)
target
).
getMonsterData
().
getId
();
val
monsterId
=
((
EntityMonster
)
target
).
getMonsterData
().
getId
();
val
codexAnimal
=
GameData
.
getCodexAnimalDataMap
().
get
(
monsterId
);
val
codexAnimal
=
GameData
.
getCodexAnimalDataMap
().
get
(
monsterId
);
...
@@ -101,7 +101,7 @@ public class PlayerCodex {
...
@@ -101,7 +101,7 @@ public class PlayerCodex {
}
}
}
}
public
void
checkUnlockedSuits
(
int
reliquaryId
){
public
void
checkUnlockedSuits
(
int
reliquaryId
)
{
GameData
.
getCodexReliquaryArrayList
().
stream
()
GameData
.
getCodexReliquaryArrayList
().
stream
()
.
filter
(
x
->
!
this
.
getUnlockedReliquarySuitCodex
().
contains
(
x
.
getId
()))
.
filter
(
x
->
!
this
.
getUnlockedReliquarySuitCodex
().
contains
(
x
.
getId
()))
.
filter
(
x
->
x
.
containsId
(
reliquaryId
))
.
filter
(
x
->
x
.
containsId
(
reliquaryId
))
...
...
src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseAddEnergy.java
View file @
025e5d3c
...
@@ -27,7 +27,7 @@ public abstract class ItemUseAddEnergy extends ItemUseAction {
...
@@ -27,7 +27,7 @@ public abstract class ItemUseAddEnergy extends ItemUseAction {
var
activeTeam
=
teamManager
.
getActiveTeam
();
var
activeTeam
=
teamManager
.
getActiveTeam
();
// On-field vs off-field multiplier.
// On-field vs off-field multiplier.
// The on-field character gets full amount, off-field characters get less depending on the team size.
// The on-field character gets full amount, off-field characters get less depending on the team size.
final
float
offFieldRatio
=
switch
(
activeTeam
.
size
())
{
final
float
offFieldRatio
=
switch
(
activeTeam
.
size
())
{
case
2
->
0.8f
;
case
2
->
0.8f
;
case
3
->
0.7f
;
case
3
->
0.7f
;
default
->
0.6f
;
default
->
0.6f
;
...
...
src/main/java/emu/grasscutter/game/systems/InventorySystem.java
View file @
025e5d3c
src/main/java/emu/grasscutter/game/world/WorldDataSystem.java
View file @
025e5d3c
...
@@ -85,7 +85,7 @@ public class WorldDataSystem extends BaseGameSystem {
...
@@ -85,7 +85,7 @@ public class WorldDataSystem extends BaseGameSystem {
return
level
;
return
level
;
}
}
private
InvestigationMonsterOuterClass
.
InvestigationMonster
getInvestigationMonster
(
Player
player
,
InvestigationMonsterData
imd
)
{
private
InvestigationMonsterOuterClass
.
InvestigationMonster
getInvestigationMonster
(
Player
player
,
InvestigationMonsterData
imd
)
{
if
(
imd
.
getGroupIdList
().
isEmpty
()
||
imd
.
getMonsterIdList
().
isEmpty
()){
if
(
imd
.
getGroupIdList
().
isEmpty
()
||
imd
.
getMonsterIdList
().
isEmpty
())
{
return
null
;
return
null
;
}
}
...
...
src/main/java/emu/grasscutter/scripts/ScriptLoader.java
View file @
025e5d3c
...
@@ -84,10 +84,10 @@ public class ScriptLoader {
...
@@ -84,10 +84,10 @@ public class ScriptLoader {
ctx
.
globals
.
set
(
"ScriptLib"
,
scriptLibLua
);
ctx
.
globals
.
set
(
"ScriptLib"
,
scriptLibLua
);
}
}
public
static
<
T
>
Optional
<
T
>
tryGet
(
SoftReference
<
T
>
softReference
){
public
static
<
T
>
Optional
<
T
>
tryGet
(
SoftReference
<
T
>
softReference
)
{
try
{
try
{
return
Optional
.
ofNullable
(
softReference
.
get
());
return
Optional
.
ofNullable
(
softReference
.
get
());
}
catch
(
NullPointerException
npe
){
}
catch
(
NullPointerException
npe
)
{
return
Optional
.
empty
();
return
Optional
.
empty
();
}
}
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtCreateGadgetNotify.java
View file @
025e5d3c
src/main/java/emu/grasscutter/server/packet/send/PacketSceneTimeNotify.java
View file @
025e5d3c
src/main/java/emu/grasscutter/utils/FileUtils.java
View file @
025e5d3c
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