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
96da4b61
Commit
96da4b61
authored
Oct 18, 2022
by
github-actions
Browse files
Fix whitespace [skip actions]
parent
026ef9c5
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/excels/CompoundData.java
View file @
96da4b61
...
...
@@ -12,7 +12,7 @@ public class CompoundData extends GameResource {
private
int
id
;
@Override
public
int
getId
(){
return
this
.
id
;}
public
int
getId
()
{
return
this
.
id
;}
@Getter
private
int
groupId
;
@Getter
private
int
rankLevel
;
@Getter
private
boolean
isDefaultUnlocked
;
...
...
src/main/java/emu/grasscutter/data/excels/CookRecipeData.java
View file @
96da4b61
...
...
@@ -20,9 +20,9 @@ public class CookRecipeData extends GameResource {
@Getter
List
<
ItemParamData
>
inputVec
;
@Override
public
int
getId
()
{
return
this
.
id
;
}
public
int
getId
()
{
return
this
.
id
;
}
@Override
public
void
onLoad
()
{
}
...
...
src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java
View file @
96da4b61
...
...
@@ -4,88 +4,88 @@ import dev.morphia.annotations.Entity;
@Entity
public
class
ActiveForgeData
{
private
int
forgeId
;
private
int
avatarId
;
private
int
count
;
private
int
startTime
;
private
int
forgeTime
;
private
int
lastUnfinishedCount
;
private
boolean
changed
;
public
int
getFinishedCount
(
int
currentTime
)
{
int
timeDelta
=
currentTime
-
this
.
startTime
;
int
finishedCount
=
timeDelta
/
this
.
forgeTime
;
return
Math
.
min
(
finishedCount
,
this
.
count
);
}
public
int
getUnfinishedCount
(
int
currentTime
)
{
return
this
.
count
-
this
.
getFinishedCount
(
currentTime
);
}
public
int
getNextFinishTimestamp
(
int
currentTime
)
{
return
(
currentTime
>=
this
.
getTotalFinishTimestamp
())
?
this
.
getTotalFinishTimestamp
()
:
(
this
.
getFinishedCount
(
currentTime
)
*
this
.
forgeTime
+
this
.
forgeTime
+
this
.
startTime
);
}
public
int
getTotalFinishTimestamp
()
{
return
this
.
startTime
+
this
.
forgeTime
*
this
.
count
;
}
public
int
getForgeId
()
{
return
this
.
forgeId
;
}
public
void
setForgeId
(
int
value
)
{
this
.
forgeId
=
value
;
}
public
int
getAvatarId
()
{
return
this
.
avatarId
;
}
public
void
setAvatarId
(
int
value
)
{
this
.
avatarId
=
value
;
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
value
)
{
this
.
count
=
value
;
}
public
int
getStartTime
()
{
return
this
.
startTime
;
}
public
void
setStartTime
(
int
value
)
{
this
.
startTime
=
value
;
}
public
int
getForgeTime
()
{
return
this
.
forgeTime
;
}
public
void
setForgeTime
(
int
value
)
{
this
.
forgeTime
=
value
;
}
public
boolean
isChanged
()
{
return
this
.
changed
;
}
public
void
setChanged
(
boolean
value
)
{
this
.
changed
=
value
;
}
public
boolean
updateChanged
(
int
currentTime
)
{
int
currentUnfinished
=
this
.
getUnfinishedCount
(
currentTime
);
if
(
currentUnfinished
!=
this
.
lastUnfinishedCount
)
{
this
.
changed
=
true
;
this
.
lastUnfinishedCount
=
currentUnfinished
;
}
return
this
.
changed
;
}
private
int
forgeId
;
private
int
avatarId
;
private
int
count
;
private
int
startTime
;
private
int
forgeTime
;
private
int
lastUnfinishedCount
;
private
boolean
changed
;
public
int
getFinishedCount
(
int
currentTime
)
{
int
timeDelta
=
currentTime
-
this
.
startTime
;
int
finishedCount
=
timeDelta
/
this
.
forgeTime
;
return
Math
.
min
(
finishedCount
,
this
.
count
);
}
public
int
getUnfinishedCount
(
int
currentTime
)
{
return
this
.
count
-
this
.
getFinishedCount
(
currentTime
);
}
public
int
getNextFinishTimestamp
(
int
currentTime
)
{
return
(
currentTime
>=
this
.
getTotalFinishTimestamp
())
?
this
.
getTotalFinishTimestamp
()
:
(
this
.
getFinishedCount
(
currentTime
)
*
this
.
forgeTime
+
this
.
forgeTime
+
this
.
startTime
);
}
public
int
getTotalFinishTimestamp
()
{
return
this
.
startTime
+
this
.
forgeTime
*
this
.
count
;
}
public
int
getForgeId
()
{
return
this
.
forgeId
;
}
public
void
setForgeId
(
int
value
)
{
this
.
forgeId
=
value
;
}
public
int
getAvatarId
()
{
return
this
.
avatarId
;
}
public
void
setAvatarId
(
int
value
)
{
this
.
avatarId
=
value
;
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
value
)
{
this
.
count
=
value
;
}
public
int
getStartTime
()
{
return
this
.
startTime
;
}
public
void
setStartTime
(
int
value
)
{
this
.
startTime
=
value
;
}
public
int
getForgeTime
()
{
return
this
.
forgeTime
;
}
public
void
setForgeTime
(
int
value
)
{
this
.
forgeTime
=
value
;
}
public
boolean
isChanged
()
{
return
this
.
changed
;
}
public
void
setChanged
(
boolean
value
)
{
this
.
changed
=
value
;
}
public
boolean
updateChanged
(
int
currentTime
)
{
int
currentUnfinished
=
this
.
getUnfinishedCount
(
currentTime
);
if
(
currentUnfinished
!=
this
.
lastUnfinishedCount
)
{
this
.
changed
=
true
;
this
.
lastUnfinishedCount
=
currentUnfinished
;
}
return
this
.
changed
;
}
}
src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java
View file @
96da4b61
...
...
@@ -155,7 +155,7 @@ public final class RegionHandler implements Router {
String
key_id
=
ctx
.
queryParam
(
"key_id"
);
if
(
key_id
==
null
)
if
(
key_id
==
null
)
throw
new
Exception
(
"Key ID was not set"
);
Cipher
cipher
=
Cipher
.
getInstance
(
"RSA/ECB/PKCS1Padding"
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketDestroyMaterialRsp.java
View file @
96da4b61
...
...
@@ -6,17 +6,17 @@ import emu.grasscutter.net.proto.DestroyMaterialRspOuterClass.DestroyMaterialRsp
import
it.unimi.dsi.fastutil.ints.Int2IntMap
;
public
class
PacketDestroyMaterialRsp
extends
BasePacket
{
public
PacketDestroyMaterialRsp
(
Int2IntMap
returnMaterialMap
)
{
super
(
PacketOpcodes
.
DestroyMaterialRsp
);
public
PacketDestroyMaterialRsp
(
Int2IntMap
returnMaterialMap
)
{
super
(
PacketOpcodes
.
DestroyMaterialRsp
);
var
proto
=
DestroyMaterialRsp
.
newBuilder
();
returnMaterialMap
.
forEach
((
id
,
count
)
->
{
proto
.
addItemIdList
(
id
);
proto
.
addItemCountList
(
count
);
});
this
.
setData
(
proto
);
}
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketForgeStartRsp.java
View file @
96da4b61
...
...
@@ -12,7 +12,7 @@ public class PacketForgeStartRsp extends BasePacket {
ForgeStartRsp
proto
=
ForgeStartRsp
.
newBuilder
()
.
setRetcode
(
retcode
.
getNumber
())
.
build
();
.
build
();
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