-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
PacketHelper.java
121 lines (83 loc) · 4.12 KB
/
PacketHelper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package com.denizenscript.denizen.nms.interfaces;
import com.denizenscript.denizen.nms.util.jnbt.CompoundTag;
import com.denizenscript.denizen.objects.ColorTag;
import com.denizenscript.denizen.utilities.maps.MapImage;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.block.banner.Pattern;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.map.MapCanvas;
import org.bukkit.map.MapPalette;
import java.util.List;
import java.util.UUID;
public interface PacketHelper {
void setFakeAbsorption(Player player, float value);
void resetWorldBorder(Player player);
void setWorldBorder(Player player, Location center, double size, double currSize, long time, int warningDistance, int warningTime);
void setSlot(Player player, int slot, ItemStack itemStack, boolean playerOnly);
void setFieldOfView(Player player, float fov);
void respawn(Player player);
void setVision(Player player, EntityType entityType);
default void showDemoScreen(Player player) {
throw new UnsupportedOperationException();
}
void showBlockAction(Player player, Location location, int action, int state);
void showBlockCrack(Player player, int id, Location location, int progress);
void showTileEntityData(Player player, Location location, int action, CompoundTag compoundTag);
void showBannerUpdate(Player player, Location location, DyeColor base, List<Pattern> patterns);
void showTabListHeaderFooter(Player player, String header, String footer);
void resetTabListHeaderFooter(Player player);
void showTitle(Player player, String title, String subtitle, int fadeIn, int stay, int fadeOut);
void showEquipment(Player player, LivingEntity entity, EquipmentSlot equipmentSlot, ItemStack itemStack);
void resetEquipment(Player player, LivingEntity entity);
void openBook(Player player, EquipmentSlot hand);
void showHealth(Player player, float health, int food, float saturation);
void resetHealth(Player player);
void showExperience(Player player, float experience, int level);
void resetExperience(Player player);
boolean showSignEditor(Player player, Location location);
void forceSpectate(Player player, Entity entity);
void setNetworkManagerFor(Player player);
default void sendRename(Player player, Entity entity, String name, boolean listMode) {
throw new UnsupportedOperationException();
}
default void generateNoCollideTeam(Player player, UUID noCollide) {
throw new UnsupportedOperationException();
}
default void removeNoCollideTeam(Player player, UUID noCollide) {
throw new UnsupportedOperationException();
}
default void sendEntityMetadataFlagsUpdate(Player player, Entity entity) {
}
default void sendEntityEffect(Player player, Entity entity, byte effectId) {
throw new UnsupportedOperationException();
}
default int getPacketStats(Player player, boolean sent) {
throw new UnsupportedOperationException();
}
default void setMapData(MapCanvas canvas, byte[] bytes, int x, int y, MapImage image) {
int width = image.width, height = image.height;
for (int x2 = 0; x2 < width; ++x2) {
for (int y2 = 0; y2 < height; ++y2) {
byte p = bytes[y2 * width + x2];
if (p != MapPalette.TRANSPARENT) {
canvas.setPixel(x + x2, y + y2, p);
}
}
}
}
default void showDebugTestMarker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
throw new UnsupportedOperationException();
}
default void clearDebugTestMarker(Player player) {
throw new UnsupportedOperationException();
}
default void sendBrand(Player player, String brand) {
throw new UnsupportedOperationException();
}
}