1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-11-21 01:48:54 +00:00

feat: 清理无效代码

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2017-05-16 20:37:24 +08:00
parent 20dd524044
commit 5cb710c00f
2 changed files with 14 additions and 9 deletions

View File

@ -23,10 +23,6 @@ public class FakeItem_17 extends FakeItem {
super(loc, item);
}
private static int getNormalizedDistance(final double value) {
return (int) Math.floor(value * 32.0D);
}
@Override
protected PacketContainer setMetadataPacket(PacketContainer fakePacket) {
fakePacket.getIntegers().write(0, eid);
@ -41,9 +37,9 @@ public class FakeItem_17 extends FakeItem {
protected PacketContainer setSpawnPacket(PacketContainer fakePacket) {
StructureModifier<Integer> is = fakePacket.getIntegers();
is.write(0, eid);
is.write(1, getNormalizedDistance(location.getX()));
is.write(2, getNormalizedDistance(location.getY()));
is.write(3, getNormalizedDistance(location.getZ()));
is.write(1, (int) location.getX());
is.write(2, (int) location.getY());
is.write(3, (int) location.getZ());
is.write(9, 2);
return fakePacket;
}

View File

@ -3,6 +3,9 @@ package org.maxgamer.QuickShop.Shop.Item;
import org.bukkit.Location;
import org.bukkit.inventory.ItemStack;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.reflect.StructureModifier;
/**
* Minecraft 虚拟悬浮物品工具类
* 需要depend ProtocolLib
@ -16,7 +19,13 @@ public class FakeItem_18 extends FakeItem_17 {
super(loc, item);
}
private static int getNormalizedDistance(final double value) {
return (int) Math.floor(value * 32.0D);
@Override
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;
}
}