21 lines
1020 B
Java
21 lines
1020 B
Java
|
package com.thebrokenrail.slightlyvanilla.mixin;
|
||
|
|
||
|
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
|
||
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||
|
import net.minecraft.util.math.BlockPos;
|
||
|
import net.minecraft.util.registry.RegistryKey;
|
||
|
import net.minecraft.world.World;
|
||
|
import org.spongepowered.asm.mixin.Mixin;
|
||
|
import org.spongepowered.asm.mixin.injection.At;
|
||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||
|
|
||
|
@Mixin(ServerPlayerEntity.class)
|
||
|
public class MixinServerPlayerEntity {
|
||
|
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;setSpawnPoint(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/util/math/BlockPos;FZZ)V"), method = "trySleep")
|
||
|
public void setSpawnPoint(ServerPlayerEntity obj, RegistryKey<World> dimension, BlockPos pos, float angle, boolean spawnPointSet, boolean bl) {
|
||
|
if (SlightlyVanilla.getConfig().bedsSetSpawn) {
|
||
|
obj.setSpawnPoint(dimension, pos, angle, spawnPointSet, bl);
|
||
|
}
|
||
|
}
|
||
|
}
|