mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-22 01:58:54 +00:00
feat: 清理无效代码
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
20dd524044
commit
5cb710c00f
@ -23,10 +23,6 @@ public class FakeItem_17 extends FakeItem {
|
|||||||
super(loc, item);
|
super(loc, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getNormalizedDistance(final double value) {
|
|
||||||
return (int) Math.floor(value * 32.0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PacketContainer setMetadataPacket(PacketContainer fakePacket) {
|
protected PacketContainer setMetadataPacket(PacketContainer fakePacket) {
|
||||||
fakePacket.getIntegers().write(0, eid);
|
fakePacket.getIntegers().write(0, eid);
|
||||||
@ -41,9 +37,9 @@ public class FakeItem_17 extends FakeItem {
|
|||||||
protected PacketContainer setSpawnPacket(PacketContainer fakePacket) {
|
protected PacketContainer setSpawnPacket(PacketContainer fakePacket) {
|
||||||
StructureModifier<Integer> is = fakePacket.getIntegers();
|
StructureModifier<Integer> is = fakePacket.getIntegers();
|
||||||
is.write(0, eid);
|
is.write(0, eid);
|
||||||
is.write(1, getNormalizedDistance(location.getX()));
|
is.write(1, (int) location.getX());
|
||||||
is.write(2, getNormalizedDistance(location.getY()));
|
is.write(2, (int) location.getY());
|
||||||
is.write(3, getNormalizedDistance(location.getZ()));
|
is.write(3, (int) location.getZ());
|
||||||
is.write(9, 2);
|
is.write(9, 2);
|
||||||
return fakePacket;
|
return fakePacket;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package org.maxgamer.QuickShop.Shop.Item;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
|
import com.comphenix.protocol.reflect.StructureModifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minecraft 虚拟悬浮物品工具类
|
* Minecraft 虚拟悬浮物品工具类
|
||||||
* 需要depend ProtocolLib
|
* 需要depend ProtocolLib
|
||||||
@ -16,7 +19,13 @@ public class FakeItem_18 extends FakeItem_17 {
|
|||||||
super(loc, item);
|
super(loc, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getNormalizedDistance(final double value) {
|
@Override
|
||||||
return (int) Math.floor(value * 32.0D);
|
protected PacketContainer setSpawnPacket(PacketContainer fakePacket) {
|
||||||
|
StructureModifier<Integer> is = fakePacket.getIntegers();
|
||||||
|
is.write(0, eid);
|
||||||
|
is.write(1, (int) location.getX() * 32);
|
||||||
|
is.write(2, (int) location.getY() * 32);
|
||||||
|
is.write(3, (int) location.getZ() * 32);
|
||||||
|
return fakePacket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user