SteamWar/FightSystem
Archiviert
13
1

Hotfix head rotation

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-03-31 20:48:31 +02:00
Ursprung 8bfade1604
Commit 7e731c6c87
2 geänderte Dateien mit 10 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -21,6 +21,8 @@ package de.steamwar.fightsystem.record;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_15_R1.block.CraftBlock; import org.bukkit.craftbukkit.v1_15_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
class RecordSystem_15 { class RecordSystem_15 {
private RecordSystem_15(){} private RecordSystem_15(){}
@ -28,4 +30,8 @@ class RecordSystem_15 {
static int blockToId(Block block){ static int blockToId(Block block){
return net.minecraft.server.v1_15_R1.Block.REGISTRY_ID.getId(((CraftBlock)block).getNMS()); return net.minecraft.server.v1_15_R1.Block.REGISTRY_ID.getId(((CraftBlock)block).getNMS());
} }
static int headRotation(Entity e){
return (int)(((CraftEntity)e).getHandle().getHeadRotation() * 256 / 360);
}
} }

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.fightsystem.record; package de.steamwar.fightsystem.record;
import de.steamwar.core.VersionedCallable; import de.steamwar.core.VersionedCallable;
import de.steamwar.core.VersionedRunnable;
import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
@ -29,7 +30,6 @@ import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
@ -107,7 +107,9 @@ public class RecordSystem {
Recorder.rDouble(location.getZ()); Recorder.rDouble(location.getZ());
Recorder.rFloat(location.getPitch()); Recorder.rFloat(location.getPitch());
Recorder.rFloat(location.getYaw()); Recorder.rFloat(location.getYaw());
Recorder.rByte((int)(((CraftEntity)e).getHandle().getHeadRotation() * 256 / 360)); VersionedRunnable.call(new VersionedRunnable(() -> {
Recorder.rByte(RecordSystem_15.headRotation(e));
}, 15));
Recorder.flush(); Recorder.flush();
} }