statistics, block placed and interacted events, stats event test
This commit is contained in:
1 parent
860c9b6d21
commit
d7ca974f1a
12 files changed
+210
-7
No files matched your search
@@ -29,6 +29,7 @@ import net.minecraft.entity.mob.MobEntityWithAi;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.predicate.entity.EntityPredicates;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
@@ -93,6 +94,25 @@ public class EntityValue extends Value
|
||||
return entity;
|
||||
}
|
||||
|
||||
public static ServerPlayerEntity getPlayerByValue(MinecraftServer server, Value value)
|
||||
{
|
||||
ServerPlayerEntity player = null;
|
||||
if (value instanceof EntityValue)
|
||||
{
|
||||
Entity e = ((EntityValue) value).getEntity();
|
||||
if (e instanceof ServerPlayerEntity)
|
||||
{
|
||||
player = (ServerPlayerEntity) e;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String playerName = value.getString();
|
||||
player = server.getPlayerManager().getPlayer(playerName);
|
||||
}
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,11 @@ public class ThreadValue extends Value
|
||||
return taskFuture.getNow(Value.NULL).getString();
|
||||
}
|
||||
|
||||
public Value getValue()
|
||||
{
|
||||
return taskFuture.getNow(Value.NULL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user