Backport updates
This commit is contained in:
parent
6cec3dcbbc
commit
728b2467a3
766 changed files with 32570 additions and 268 deletions
|
@ -17,8 +17,9 @@ import dev.zontreck.essentials.homes.Home;
|
|||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.essentials.configs.server.AEServerConfig;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector2;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.libzontreck.vectors.Vector2f;
|
||||
import dev.zontreck.libzontreck.vectors.Vector2i;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3d;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
@ -43,12 +44,7 @@ public class SetHomeCommand {
|
|||
private static int setHome(CommandSourceStack ctx, String homeName)
|
||||
{
|
||||
|
||||
CommandExecutionEvent exec = null;
|
||||
try {
|
||||
exec = new CommandExecutionEvent(ctx.getPlayerOrException(), "sethome");
|
||||
} catch (CommandSyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
var exec = new CommandExecutionEvent(ctx.getPlayer(), "sethome");
|
||||
if(MinecraftForge.EVENT_BUS.post(exec))
|
||||
{
|
||||
return 0;
|
||||
|
@ -64,7 +60,7 @@ public class SetHomeCommand {
|
|||
p = ctx.getPlayerOrException();
|
||||
|
||||
|
||||
if(TeleportActioner.isBlacklistedDimension(p.getLevel()))
|
||||
if(TeleportActioner.isBlacklistedDimension(p.serverLevel()))
|
||||
{
|
||||
ChatHelpers.broadcastTo(p, ChatHelpers.macro(Messages.ESSENTIALS_PREFIX + AEServerConfig.getInstance().messages.BlacklistedDimensionError), p.server);
|
||||
|
||||
|
@ -74,11 +70,10 @@ public class SetHomeCommand {
|
|||
Vec3 position = p.position();
|
||||
Vec2 rot = p.getRotationVector();
|
||||
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel());
|
||||
|
||||
BlockState bs = p.getLevel().getBlockState(dest.Position.moveDown().asBlockPos());
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3d(position), new Vector2f(rot), p.serverLevel());
|
||||
BlockState bs = p.serverLevel().getBlockState(dest.Position.moveDown().asBlockPos());
|
||||
|
||||
Home newhome = new Home(p, homeName, dest, new ItemStack(bs.getBlock().asItem()));
|
||||
Home newhome = new Home(p, homeName, dest, new ItemStack(p.getBlockStateOn().getBlock().asItem()));
|
||||
AriasEssentials.player_homes.get(p.getUUID()).add(newhome);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue