mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-20 00:13:21 +02:00
parent
85cc76a022
commit
34c20ac753
3 changed files with 7 additions and 7 deletions
|
@ -37,7 +37,7 @@ public class Logic {
|
|||
// check if the block is in the right y level limits from the config
|
||||
if (!checkYLimits(player, blockPos)) return false;
|
||||
|
||||
ServerWorld serverWorld = player.getServerWorld();
|
||||
ServerWorld serverWorld = player.getWorld();
|
||||
|
||||
Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class Logic {
|
|||
public static boolean sit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) {
|
||||
if (!canSit(player, blockPos, hitResult)) return false;
|
||||
// assets
|
||||
ServerWorld serverWorld = player.getServerWorld();
|
||||
ServerWorld serverWorld = player.getWorld();
|
||||
Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult);
|
||||
// shouldn't be null because we already checked, but do another check to clear IDE errors
|
||||
assert sitHeight != null;
|
||||
|
@ -77,7 +77,7 @@ public class Logic {
|
|||
* @return true if sitting was successful
|
||||
*/
|
||||
public static boolean sitLooking(ServerPlayerEntity player) {
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getWorld(),player,
|
||||
Utl.getPlayerReach(player)),null);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ public class Logic {
|
|||
// get the new entity
|
||||
DisplayEntity.TextDisplayEntity sitEntity = Data.getSpawnList().get(player);
|
||||
// spawn and ride the entity
|
||||
player.getServerWorld().spawnEntity(sitEntity);
|
||||
player.getWorld().spawnEntity(sitEntity);
|
||||
player.startRiding(sitEntity);
|
||||
// add the entity to the list
|
||||
Data.addSitEntity(player, sitEntity);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue