Search in sources :

Example 1 with PacketPlayOutScoreboardObjective

use of net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardObjective in project FireAPI by FireBlade-Serv.

the class FireScoreboard method getScoreboardObjective.

private PacketPlayOutScoreboardObjective getScoreboardObjective(int mode) throws IllegalArgumentException, IllegalAccessException {
    PacketPlayOutScoreboardObjective pso = new PacketPlayOutScoreboardObjective();
    Field name = FireReflection.getField(pso.getClass(), "a");
    name.set(pso, this.p.getName());
    Field display = FireReflection.getField(pso.getClass(), "b");
    display.set(pso, this.title);
    Field dtype = FireReflection.getField(pso.getClass(), "c");
    dtype.set(pso, EnumScoreboardHealthDisplay.INTEGER);
    Field smode = FireReflection.getField(pso.getClass(), "d");
    smode.set(pso, mode);
    return pso;
}
Also used : Field(java.lang.reflect.Field) PacketPlayOutScoreboardObjective(net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardObjective)

Aggregations

Field (java.lang.reflect.Field)1 PacketPlayOutScoreboardObjective (net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardObjective)1