mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Totally stable optimizations that wont cause any problems at all.
This commit is contained in:
@@ -33,7 +33,7 @@ import java.lang.reflect.Method;
|
||||
*
|
||||
* @author MrMicky
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings({"deprecation", "JavaReflectionInvocation"})
|
||||
class ParticleSenderLegacy implements ParticleSender {
|
||||
|
||||
private static final boolean SERVER_IS_1_8;
|
||||
@@ -158,20 +158,18 @@ class ParticleSenderLegacy implements ParticleSender {
|
||||
private int[] toData(ParticleType particle, Object data) {
|
||||
Class<?> dataType = particle.getDataType();
|
||||
if (dataType == ItemStack.class) {
|
||||
if (!(data instanceof ItemStack)) {
|
||||
if (!(data instanceof ItemStack itemStack)) {
|
||||
return SERVER_IS_1_8 ? new int[2] : new int[]{1, 0};
|
||||
}
|
||||
|
||||
ItemStack itemStack = (ItemStack) data;
|
||||
return new int[]{itemStack.getType().getId(), itemStack.getDurability()};
|
||||
}
|
||||
|
||||
if (dataType == MaterialData.class) {
|
||||
if (!(data instanceof MaterialData)) {
|
||||
if (!(data instanceof MaterialData materialData)) {
|
||||
return SERVER_IS_1_8 ? new int[1] : new int[]{1, 0};
|
||||
}
|
||||
|
||||
MaterialData materialData = (MaterialData) data;
|
||||
if (SERVER_IS_1_8) {
|
||||
return new int[]{materialData.getItemType().getId() + (materialData.getData() << 12)};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user