summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
blob: 1b0058f24c8c84975f8b17abb98fbe536c6a475c (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
package com.earth2me.essentials;

import java.net.InetSocketAddress;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Achievement;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Instrument;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Note;
import org.bukkit.Server;
import org.bukkit.Statistic;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.map.MapView;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.bukkit.util.Vector;


public class OfflinePlayer implements Player
{
	private final String name;
	final transient IEssentials ess;
	private Location location = new Location(null, 0, 0, 0, 0, 0);
	private World world;
	private UUID uniqueId = UUID.randomUUID();
	private org.bukkit.OfflinePlayer base;

	public OfflinePlayer(String name, IEssentials ess)
	{
		this.name = name;
		this.ess = ess;
		this.world = ess.getServer().getWorlds().get(0);
		this.base = ess.getServer().getOfflinePlayer(name);
	}

	public boolean isOnline()
	{
		return base.isOnline();
	}

	public boolean isOp()
	{
		return base.isOp();
	}

	public void sendMessage(String string)
	{
	}

	public String getDisplayName()
	{
		return name;
	}

	public void setDisplayName(String string)
	{
	}

	public void setCompassTarget(Location lctn)
	{
	}

	public InetSocketAddress getAddress()
	{
		return null;
	}

	public void kickPlayer(String string)
	{
	}

	public String getName()
	{
		return name;
	}

	public PlayerInventory getInventory()
	{
		return null;
	}

	public ItemStack getItemInHand()
	{
		return null;
	}

	public void setItemInHand(ItemStack is)
	{
	}

	public int getHealth()
	{
		return 0;
	}

	public void setHealth(int i)
	{
	}

	public Egg throwEgg()
	{
		return null;
	}

	public Snowball throwSnowball()
	{
		return null;
	}

	public Arrow shootArrow()
	{
		return null;
	}

	public boolean isInsideVehicle()
	{
		return false;
	}

	public boolean leaveVehicle()
	{
		return false;
	}

	public Vehicle getVehicle()
	{
		return null;
	}

	public Location getLocation()
	{
		return location;
	}

	public World getWorld()
	{
		return world;
	}

	public void setLocation(Location loc)
	{
		location = loc;
		world = loc.getWorld();
	}

	public void teleportTo(Location lctn)
	{
	}

	public void teleportTo(Entity entity)
	{
	}

	public int getEntityId()
	{
		return -1;
	}

	public boolean performCommand(String string)
	{
		return false;
	}

	public boolean isPlayer()
	{
		return false;
	}

	public int getRemainingAir()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setRemainingAir(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getMaximumAir()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setMaximumAir(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean isSneaking()
	{
		return false;
	}

	public void setSneaking(boolean bln)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void updateInventory()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void chat(String string)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public double getEyeHeight()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public double getEyeHeight(boolean bln)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public List<Block> getLineOfSight(HashSet<Byte> hs, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Block getTargetBlock(HashSet<Byte> hs, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public List<Block> getLastTwoTargetBlocks(HashSet<Byte> hs, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getFireTicks()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getMaxFireTicks()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setFireTicks(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void remove()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Server getServer()
	{
		return ess == null ? null : ess.getServer();
	}

	public Vector getMomentum()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setMomentum(Vector vector)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setVelocity(Vector vector)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Vector getVelocity()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void damage(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void damage(int i, Entity entity)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Location getEyeLocation()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void sendRawMessage(String string)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Location getCompassTarget()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getMaximumNoDamageTicks()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setMaximumNoDamageTicks(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getLastDamage()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setLastDamage(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getNoDamageTicks()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setNoDamageTicks(int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean teleport(Location lctn)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean teleport(Entity entity)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public Entity getPassenger()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean setPassenger(Entity entity)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean isEmpty()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean eject()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void saveData()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void loadData()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean isSleeping()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public int getSleepTicks()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public List<Entity> getNearbyEntities(double d, double d1, double d2)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean isDead()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public float getFallDistance()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setFallDistance(float f)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setSleepingIgnored(boolean bln)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean isSleepingIgnored()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void awardAchievement(Achievement a)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void incrementStatistic(Statistic ststc)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void incrementStatistic(Statistic ststc, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void incrementStatistic(Statistic ststc, Material mtrl)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void incrementStatistic(Statistic ststc, Material mtrl, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void playNote(Location lctn, byte b, byte b1)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void sendBlockChange(Location lctn, Material mtrl, byte b)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void sendBlockChange(Location lctn, int i, byte b)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void setLastDamageCause(EntityDamageEvent ede)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public EntityDamageEvent getLastDamageCause()
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public void playEffect(Location lctn, Effect effect, int i)
	{
		throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
	}

	public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes)
	{
		return true;
	}

	public UUID getUniqueId()
	{
		return uniqueId;
	}

	public void playNote(Location lctn, Instrument i, Note note)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public void setPlayerTime(long l, boolean bln)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public long getPlayerTime()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public long getPlayerTimeOffset()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public boolean isPlayerTimeRelative()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public void resetPlayerTime()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public boolean isPermissionSet(String string)
	{
		return false;
	}

	public boolean isPermissionSet(Permission prmsn)
	{
		return false;
	}

	public boolean hasPermission(String string)
	{
		return false;
	}

	public boolean hasPermission(Permission prmsn)
	{
		return false;
	}

	public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public PermissionAttachment addAttachment(Plugin plugin)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public PermissionAttachment addAttachment(Plugin plugin, int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public void removeAttachment(PermissionAttachment pa)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public void recalculatePermissions()
	{
	}

	public Set<PermissionAttachmentInfo> getEffectivePermissions()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	public void setOp(boolean bln)
	{
		base.setOp(bln);
	}

	@Override
	public void sendMap(MapView mv)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public boolean isBanned()
	{
		return base.isBanned();
	}

	@Override
	public void setBanned(boolean bln)
	{
		base.setBanned(bln);
	}

	@Override
	public boolean isWhitelisted()
	{
		return base.isWhitelisted();
	}

	@Override
	public void setWhitelisted(boolean bln)
	{
		base.setWhitelisted(bln);
	}

	@Override
	public GameMode getGameMode()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setGameMode(GameMode gm)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public int getExperience()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setExperience(int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public int getLevel()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setLevel(int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public int getTotalExperience()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setTotalExperience(int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public float getExhaustion()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setExhaustion(float f)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public float getSaturation()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setSaturation(float f)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public int getFoodLevel()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setFoodLevel(int i)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public Location getBedSpawnLocation()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public boolean isSprinting()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setSprinting(boolean bln)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void setPlayerListName(String name)
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public String getPlayerListName()
	{
		throw new UnsupportedOperationException("Not supported yet.");
	}
}