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
bfbf52da
Commit
bfbf52da
authored
3 years ago
by
Ticxo
Browse files
Options
Download
Email Patches
Plain Diff
Removed unnecessary reflection
parent
f637c4a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
v1_18_R2/src/main/java/io/lumine/cosmetics/nms/VolatileCodeEnabled_v1_18_R2.java
...io/lumine/cosmetics/nms/VolatileCodeEnabled_v1_18_R2.java
+2
-7
No files found.
v1_18_R2/src/main/java/io/lumine/cosmetics/nms/VolatileCodeEnabled_v1_18_R2.java
View file @
bfbf52da
...
@@ -11,7 +11,6 @@ import io.lumine.cosmetics.managers.sprays.Spray;
...
@@ -11,7 +11,6 @@ import io.lumine.cosmetics.managers.sprays.Spray;
import
io.lumine.cosmetics.nms.cosmetic.VolatileCosmeticHelper
;
import
io.lumine.cosmetics.nms.cosmetic.VolatileCosmeticHelper
;
import
io.lumine.cosmetics.nms.v1_18_R2.cosmetic.*
;
import
io.lumine.cosmetics.nms.v1_18_R2.cosmetic.*
;
import
io.lumine.cosmetics.nms.v1_18_R2.network.VolatileChannelHandler
;
import
io.lumine.cosmetics.nms.v1_18_R2.network.VolatileChannelHandler
;
import
io.lumine.utils.reflection.Reflector
;
import
io.netty.channel.Channel
;
import
io.netty.channel.Channel
;
import
io.netty.channel.ChannelPipeline
;
import
io.netty.channel.ChannelPipeline
;
import
lombok.Getter
;
import
lombok.Getter
;
...
@@ -20,7 +19,6 @@ import net.minecraft.network.protocol.Packet;
...
@@ -20,7 +19,6 @@ import net.minecraft.network.protocol.Packet;
import
net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket
;
import
net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket
;
import
net.minecraft.server.level.ServerLevel
;
import
net.minecraft.server.level.ServerLevel
;
import
net.minecraft.server.level.ServerPlayer
;
import
net.minecraft.server.level.ServerPlayer
;
import
net.minecraft.world.level.entity.PersistentEntitySectionManager
;
import
org.bukkit.Bukkit
;
import
org.bukkit.Bukkit
;
import
org.bukkit.World
;
import
org.bukkit.World
;
import
org.bukkit.craftbukkit.v1_18_R2.CraftWorld
;
import
org.bukkit.craftbukkit.v1_18_R2.CraftWorld
;
...
@@ -37,8 +35,6 @@ public class VolatileCodeEnabled_v1_18_R2 implements VolatileCodeHandler {
...
@@ -37,8 +35,6 @@ public class VolatileCodeEnabled_v1_18_R2 implements VolatileCodeHandler {
@Getter
private
final
MCCosmeticsPlugin
plugin
;
@Getter
private
final
MCCosmeticsPlugin
plugin
;
private
final
Map
<
Class
<?
extends
Cosmetic
>,
VolatileCosmeticHelper
>
cosmeticHelpers
=
Maps
.
newConcurrentMap
();
private
final
Map
<
Class
<?
extends
Cosmetic
>,
VolatileCosmeticHelper
>
cosmeticHelpers
=
Maps
.
newConcurrentMap
();
private
Reflector
<
ServerLevel
>
refServerLevel
=
new
Reflector
<>(
ServerLevel
.
class
,
"O"
);
public
VolatileCodeEnabled_v1_18_R2
(
MCCosmeticsPlugin
plugin
)
{
public
VolatileCodeEnabled_v1_18_R2
(
MCCosmeticsPlugin
plugin
)
{
this
.
plugin
=
plugin
;
this
.
plugin
=
plugin
;
...
@@ -133,11 +129,10 @@ public class VolatileCodeEnabled_v1_18_R2 implements VolatileCodeHandler {
...
@@ -133,11 +129,10 @@ public class VolatileCodeEnabled_v1_18_R2 implements VolatileCodeHandler {
}
}
}
}
@SuppressWarnings
(
"unchecked"
)
public
Entity
getEntity
(
World
world
,
int
id
)
{
public
Entity
getEntity
(
World
world
,
int
id
)
{
ServerLevel
level
=
((
CraftWorld
)
world
).
getHandle
();
ServerLevel
level
=
((
CraftWorld
)
world
).
getHandle
();
PersistentEntitySectionManager
<
net
.
minecraft
.
world
.
entity
.
Entity
>
entityManager
=
(
PersistentEntitySectionManager
<
net
.
minecraft
.
world
.
entity
.
Entity
>)
refServerLevel
.
get
(
level
,
"O"
)
;
final
var
entityManager
=
level
.
entityManager
;
net
.
minecraft
.
world
.
entity
.
Entity
entity
=
entityManager
.
getEntityGetter
().
get
(
id
);
final
var
entity
=
entityManager
.
getEntityGetter
().
get
(
id
);
return
entity
==
null
?
null
:
entity
.
getBukkitEntity
();
return
entity
==
null
?
null
:
entity
.
getBukkitEntity
();
}
}
...
...
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