4
4
import com .comphenix .packetwrapper .Packet1DDestroyEntity ;
5
5
import com .comphenix .packetwrapper .Packet28EntityMetadata ;
6
6
import com .comphenix .protocol .ProtocolManager ;
7
- import com .comphenix .protocol .events .PacketContainer ;
8
7
import com .comphenix .protocol .wrappers .WrappedDataWatcher ;
9
8
import org .bukkit .Bukkit ;
10
9
import org .bukkit .Location ;
@@ -21,8 +20,6 @@ public class SpawnFakeWither extends JavaPlugin {
21
20
// You could also use a full-fledged API like RemoteEntities
22
21
public static class FakeWither {
23
22
public static final byte INVISIBLE = 0x20 ;
24
- // Just a guess
25
- public static final int HEALTH_RANGE = 80 * 80 ;
26
23
// Next entity ID
27
24
public static int NEXT_ID = 6000 ;
28
25
@@ -37,8 +34,6 @@ public static class FakeWither {
37
34
public int id = NEXT_ID ++;
38
35
// Default health
39
36
public int health = 300 ;
40
-
41
- public boolean visible ;
42
37
public String customName ;
43
38
public boolean created ;
44
39
@@ -67,17 +62,6 @@ public void setHealth(int health) {
67
62
this .health = health ;
68
63
}
69
64
70
- public void setVisible (boolean visible ) {
71
- // Make visible or invisible
72
- if (created ) {
73
- WrappedDataWatcher watcher = new WrappedDataWatcher ();
74
-
75
- watcher .setObject (METADATA_FLAGS , visible ? (byte ) 0 : INVISIBLE );
76
- sendMetadata (watcher );
77
- }
78
- this .visible = visible ;
79
- }
80
-
81
65
public void setCustomName (String name ) {
82
66
if (created ) {
83
67
WrappedDataWatcher watcher = new WrappedDataWatcher ();
@@ -116,9 +100,10 @@ public void create() {
116
100
Packet18SpawnMob spawnMob = new Packet18SpawnMob ();
117
101
WrappedDataWatcher watcher = new WrappedDataWatcher ();
118
102
119
- watcher .setObject (METADATA_FLAGS , visible ? ( byte ) 0 : INVISIBLE );
103
+ watcher .setObject (METADATA_FLAGS , INVISIBLE );
120
104
watcher .setObject (METADATA_WITHER_HEALTH , (int ) health ); // 1.5.2 -> Change to (int)
121
105
106
+
122
107
if (customName != null ) {
123
108
watcher .setObject (METADATA_NAME , customName );
124
109
watcher .setObject (METADATA_SHOW_NAME , (byte ) 1 );
0 commit comments