Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MythicCraft
MythicCosmetics
Commits
6af93d68
Commit
6af93d68
authored
2 years ago
by
Ashijin
Browse files
Options
Download
Email Patches
Plain Diff
Fixed bug where gestures could leave you unable to swap your hotbar
parent
659fef75
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
60 deletions
+22
-60
plugin/src/main/java/io/lumine/cosmetics/managers/gestures/GestureManager.java
...io/lumine/cosmetics/managers/gestures/GestureManager.java
+3
-1
v1_17_R1/src/main/java/io/lumine/cosmetics/nms/v1_17_R1/cosmetic/VolatileGestureImpl.java
.../cosmetics/nms/v1_17_R1/cosmetic/VolatileGestureImpl.java
+4
-12
v1_18_R1/src/main/java/io/lumine/cosmetics/nms/v1_18_R1/cosmetic/VolatileGestureImpl.java
.../cosmetics/nms/v1_18_R1/cosmetic/VolatileGestureImpl.java
+4
-12
v1_18_R2/src/main/java/io/lumine/cosmetics/nms/v1_18_R2/cosmetic/VolatileGestureImpl.java
.../cosmetics/nms/v1_18_R2/cosmetic/VolatileGestureImpl.java
+4
-12
v1_19_R1/src/main/java/io/lumine/cosmetics/nms/v1_19_R1/cosmetic/VolatileGestureImpl.java
.../cosmetics/nms/v1_19_R1/cosmetic/VolatileGestureImpl.java
+4
-12
v1_19_R1_2/src/main/java/io/lumine/cosmetics/nms/v1_19_R1_2/cosmetic/VolatileGestureImpl.java
...osmetics/nms/v1_19_R1_2/cosmetic/VolatileGestureImpl.java
+2
-10
v1_19_R1_2/src/main/java/io/lumine/cosmetics/nms/v1_19_R1_2/cosmetic/VolatileHatImpl.java
...ne/cosmetics/nms/v1_19_R1_2/cosmetic/VolatileHatImpl.java
+1
-1
No files found.
plugin/src/main/java/io/lumine/cosmetics/managers/gestures/GestureManager.java
View file @
6af93d68
...
@@ -11,6 +11,8 @@ import io.lumine.cosmetics.managers.MCCosmeticsManager;
...
@@ -11,6 +11,8 @@ import io.lumine.cosmetics.managers.MCCosmeticsManager;
import
io.lumine.cosmetics.nms.cosmetic.VolatileEquipmentHelper
;
import
io.lumine.cosmetics.nms.cosmetic.VolatileEquipmentHelper
;
import
io.lumine.utils.Events
;
import
io.lumine.utils.Events
;
import
io.lumine.utils.files.Files
;
import
io.lumine.utils.files.Files
;
import
lombok.Getter
;
import
org.bukkit.entity.Player
;
import
org.bukkit.entity.Player
;
import
org.bukkit.event.player.PlayerJoinEvent
;
import
org.bukkit.event.player.PlayerJoinEvent
;
import
org.bukkit.event.player.PlayerQuitEvent
;
import
org.bukkit.event.player.PlayerQuitEvent
;
...
@@ -21,7 +23,7 @@ import java.util.Map;
...
@@ -21,7 +23,7 @@ import java.util.Map;
public
class
GestureManager
extends
MCCosmeticsManager
<
Gesture
>
{
public
class
GestureManager
extends
MCCosmeticsManager
<
Gesture
>
{
private
final
Map
<
Player
,
CustomPlayerModel
>
ticking
=
Maps
.
newConcurrentMap
();
@Getter
private
final
Map
<
Player
,
CustomPlayerModel
>
ticking
=
Maps
.
newConcurrentMap
();
public
GestureManager
(
MCCosmeticsPlugin
plugin
)
{
public
GestureManager
(
MCCosmeticsPlugin
plugin
)
{
super
(
plugin
,
Gesture
.
class
);
super
(
plugin
,
Gesture
.
class
);
...
...
This diff is collapsed.
Click to expand it.
v1_17_R1/src/main/java/io/lumine/cosmetics/nms/v1_17_R1/cosmetic/VolatileGestureImpl.java
View file @
6af93d68
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
@Override
@Override
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
final
var
profile
=
MCCosmeticsPlugin
.
inst
().
getProfiles
().
getProfile
(
sender
);
if
(!
plugin
.
getGestureManager
().
getTicking
().
containsKey
(
sender
))
{
if
(
profile
==
null
)
return
true
;
return
true
;
}
final
var
maybeEquipped
=
profile
.
getEquipped
(
Gesture
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
return
true
;
}
var
opt
=
maybeEquipped
.
get
().
getCosmetic
();
if
(!(
opt
instanceof
Gesture
gesture
))
return
true
;
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
final
var
manager
=
(
GestureManager
)
g
esture
.
get
Manager
();
final
var
manager
=
(
GestureManager
)
plugin
.
getG
estureManager
();
if
(
inputPacket
.
isShiftKeyDown
())
if
(
inputPacket
.
isShiftKeyDown
())
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
if
(
inputPacket
.
isJumping
())
if
(
inputPacket
.
isJumping
())
...
...
This diff is collapsed.
Click to expand it.
v1_18_R1/src/main/java/io/lumine/cosmetics/nms/v1_18_R1/cosmetic/VolatileGestureImpl.java
View file @
6af93d68
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
@Override
@Override
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
final
var
profile
=
MCCosmeticsPlugin
.
inst
().
getProfiles
().
getProfile
(
sender
);
if
(!
plugin
.
getGestureManager
().
getTicking
().
containsKey
(
sender
))
{
if
(
profile
==
null
)
return
true
;
return
true
;
}
final
var
maybeEquipped
=
profile
.
getEquipped
(
Gesture
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
return
true
;
}
var
opt
=
maybeEquipped
.
get
().
getCosmetic
();
if
(!(
opt
instanceof
Gesture
gesture
))
return
true
;
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
final
var
manager
=
(
GestureManager
)
g
esture
.
get
Manager
();
final
var
manager
=
(
GestureManager
)
plugin
.
getG
estureManager
();
if
(
inputPacket
.
isShiftKeyDown
())
if
(
inputPacket
.
isShiftKeyDown
())
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
if
(
inputPacket
.
isJumping
())
if
(
inputPacket
.
isJumping
())
...
...
This diff is collapsed.
Click to expand it.
v1_18_R2/src/main/java/io/lumine/cosmetics/nms/v1_18_R2/cosmetic/VolatileGestureImpl.java
View file @
6af93d68
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
@Override
@Override
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
final
var
profile
=
MCCosmeticsPlugin
.
inst
().
getProfiles
().
getProfile
(
sender
);
if
(!
plugin
.
getGestureManager
().
getTicking
().
containsKey
(
sender
))
{
if
(
profile
==
null
)
return
true
;
return
true
;
}
final
var
maybeEquipped
=
profile
.
getEquipped
(
Gesture
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
return
true
;
}
var
opt
=
maybeEquipped
.
get
().
getCosmetic
();
if
(!(
opt
instanceof
Gesture
gesture
))
return
true
;
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
final
var
manager
=
(
GestureManager
)
g
esture
.
get
Manager
();
final
var
manager
=
(
GestureManager
)
plugin
.
getG
estureManager
();
if
(
inputPacket
.
isShiftKeyDown
())
if
(
inputPacket
.
isShiftKeyDown
())
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
if
(
inputPacket
.
isJumping
())
if
(
inputPacket
.
isJumping
())
...
...
This diff is collapsed.
Click to expand it.
v1_19_R1/src/main/java/io/lumine/cosmetics/nms/v1_19_R1/cosmetic/VolatileGestureImpl.java
View file @
6af93d68
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
@Override
@Override
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
final
var
profile
=
MCCosmeticsPlugin
.
inst
().
getProfiles
().
getProfile
(
sender
);
if
(!
plugin
.
getGestureManager
().
getTicking
().
containsKey
(
sender
))
{
if
(
profile
==
null
)
return
true
;
return
true
;
}
final
var
maybeEquipped
=
profile
.
getEquipped
(
Gesture
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
return
true
;
}
var
opt
=
maybeEquipped
.
get
().
getCosmetic
();
if
(!(
opt
instanceof
Gesture
gesture
))
return
true
;
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
final
var
manager
=
(
GestureManager
)
g
esture
.
get
Manager
();
final
var
manager
=
(
GestureManager
)
plugin
.
getG
estureManager
();
if
(
inputPacket
.
isShiftKeyDown
())
if
(
inputPacket
.
isShiftKeyDown
())
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
if
(
inputPacket
.
isJumping
())
if
(
inputPacket
.
isJumping
())
...
...
This diff is collapsed.
Click to expand it.
v1_19_R1_2/src/main/java/io/lumine/cosmetics/nms/v1_19_R1_2/cosmetic/VolatileGestureImpl.java
View file @
6af93d68
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
...
@@ -142,20 +142,12 @@ public class VolatileGestureImpl implements VolatileEquipmentHelper {
@Override
@Override
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
public
boolean
read
(
Player
sender
,
Object
packet
,
boolean
isCanceled
)
{
final
var
profile
=
MCCosmeticsPlugin
.
inst
().
getProfiles
().
getProfile
(
sender
);
if
(!
plugin
.
getGestureManager
().
getTicking
().
containsKey
(
sender
))
{
if
(
profile
==
null
)
return
true
;
final
var
maybeEquipped
=
profile
.
getEquipped
(
Gesture
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
return
true
;
return
true
;
}
}
var
opt
=
maybeEquipped
.
get
().
getCosmetic
();
if
(!(
opt
instanceof
Gesture
gesture
))
return
true
;
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
if
(
packet
instanceof
ServerboundPlayerInputPacket
inputPacket
)
{
final
var
manager
=
(
GestureManager
)
g
esture
.
get
Manager
();
final
var
manager
=
(
GestureManager
)
plugin
.
getG
estureManager
();
if
(
inputPacket
.
isShiftKeyDown
())
if
(
inputPacket
.
isShiftKeyDown
())
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
manager
.
quit
(
sender
,
QuitMethod
.
SNEAK
);
if
(
inputPacket
.
isJumping
())
if
(
inputPacket
.
isJumping
())
...
...
This diff is collapsed.
Click to expand it.
v1_19_R1_2/src/main/java/io/lumine/cosmetics/nms/v1_19_R1_2/cosmetic/VolatileHatImpl.java
View file @
6af93d68
...
@@ -140,7 +140,7 @@ public class VolatileHatImpl implements VolatileEquipmentHelper {
...
@@ -140,7 +140,7 @@ public class VolatileHatImpl implements VolatileEquipmentHelper {
}
}
public
void
handleSpawn
(
Profile
profile
)
{
public
void
handleSpawn
(
Profile
profile
)
{
final
var
maybeEquipped
=
profile
.
getEquipped
(
Hat
.
class
);
final
var
maybeEquipped
=
profile
.
getEquipped
(
Hat
.
class
);
if
(
maybeEquipped
.
isEmpty
())
{
if
(
maybeEquipped
.
isEmpty
())
{
return
;
return
;
...
...
This diff is collapsed.
Click to expand it.
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