0.4.0 SNAPSHOT

This commit is contained in:
LOOHP
2021-02-19 23:33:21 +08:00
parent a0f45a5b17
commit 8d2b7ea0cb
32 changed files with 2345 additions and 140 deletions
+25
View File
@@ -2,13 +2,18 @@ package com.loohp.limbo;
import java.lang.reflect.Constructor;
import com.loohp.limbo.Entity.DataWatcher;
import com.loohp.limbo.Entity.Entity;
import com.loohp.limbo.Location.Location;
import com.loohp.limbo.Player.Player;
import com.loohp.limbo.Utils.GameMode;
import com.loohp.limbo.World.World;
@Deprecated
public class Unsafe {
private com.loohp.limbo.Player.Unsafe playerUnsafe;
private com.loohp.limbo.World.Unsafe worldUnsafe;
protected Unsafe() {
try {
@@ -16,6 +21,11 @@ public class Unsafe {
playerConstructor.setAccessible(true);
playerUnsafe = playerConstructor.newInstance();
playerConstructor.setAccessible(false);
Constructor<com.loohp.limbo.World.Unsafe> worldConstructor = com.loohp.limbo.World.Unsafe.class.getDeclaredConstructor();
worldConstructor.setAccessible(true);
worldUnsafe = worldConstructor.newInstance();
worldConstructor.setAccessible(false);
} catch (Exception e) {e.printStackTrace();}
}
@@ -28,5 +38,20 @@ public class Unsafe {
public void setPlayerEntityId(Player player, int entityId) {
playerUnsafe.a(player, entityId);
}
@Deprecated
public void removeEntity(World world, Entity entity) {
worldUnsafe.a(world, entity);
}
@Deprecated
public DataWatcher getDataWatcher(World world, Entity entity) {
return worldUnsafe.b(world, entity);
}
@Deprecated
public void setPlayerLocationSilently(Player player, Location location) {
playerUnsafe.a(player, location);
}
}