Attempt more fixes
This commit is contained in:
parent
ddc7fa9952
commit
abfaa02ace
6 changed files with 24 additions and 20 deletions
|
@ -5,15 +5,20 @@ import com.zontreck.commands.homes.HomeCommand;
|
||||||
import com.zontreck.commands.homes.HomesCommand;
|
import com.zontreck.commands.homes.HomesCommand;
|
||||||
import com.zontreck.commands.homes.SetHomeCommand;
|
import com.zontreck.commands.homes.SetHomeCommand;
|
||||||
import com.zontreck.commands.items.ShareItemInChatCommand;
|
import com.zontreck.commands.items.ShareItemInChatCommand;
|
||||||
import com.zontreck.commands.items.TIABDebug;
|
|
||||||
import com.zontreck.commands.spawn.SetSpawnCommand;
|
import com.zontreck.commands.spawn.SetSpawnCommand;
|
||||||
import com.zontreck.commands.spawn.SpawnCommand;
|
import com.zontreck.commands.spawn.SpawnCommand;
|
||||||
import com.zontreck.commands.teleport.*;
|
import com.zontreck.commands.teleport.TPACommand;
|
||||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
import com.zontreck.commands.teleport.TPAHereCommand;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import com.zontreck.commands.teleport.TPAcceptCommand;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import com.zontreck.commands.teleport.TPCancelCommand;
|
||||||
|
import com.zontreck.commands.teleport.TPDenyCommand;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE)
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
|
import net.neoforged.fml.common.EventBusSubscriber.Bus;
|
||||||
|
import net.neoforged.neoforge.event.RegisterCommandsEvent;
|
||||||
|
|
||||||
|
@EventBusSubscriber(bus = Bus.GAME)
|
||||||
public class CommandRegistry
|
public class CommandRegistry
|
||||||
{
|
{
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -7,10 +7,11 @@ import com.zontreck.Messages;
|
||||||
import com.zontreck.events.CommandExecutionEvent;
|
import com.zontreck.events.CommandExecutionEvent;
|
||||||
import com.zontreck.libzontreck.profiles.Profile;
|
import com.zontreck.libzontreck.profiles.Profile;
|
||||||
import com.zontreck.libzontreck.util.ChatHelpers;
|
import com.zontreck.libzontreck.util.ChatHelpers;
|
||||||
|
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
|
|
||||||
public class DelHomeCommand {
|
public class DelHomeCommand {
|
||||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||||
|
@ -34,10 +35,11 @@ public class DelHomeCommand {
|
||||||
{
|
{
|
||||||
|
|
||||||
var exec = new CommandExecutionEvent(ctx.getPlayer(), "rmhome");
|
var exec = new CommandExecutionEvent(ctx.getPlayer(), "rmhome");
|
||||||
if(MinecraftForge.EVENT_BUS.post(exec))
|
if(NeoForge.EVENT_BUS.post(exec))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request homes
|
// Request homes
|
||||||
// String homeName = "";
|
// String homeName = "";
|
||||||
// CommandSourceStack ctx = ctx2.getSource();
|
// CommandSourceStack ctx = ctx2.getSource();
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package com.zontreck.events;
|
package com.zontreck.events;
|
||||||
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.neoforged.bus.api.Event;
|
||||||
|
|
||||||
|
|
||||||
@Cancelable
|
|
||||||
public class CommandExecutionEvent extends Event {
|
public class CommandExecutionEvent extends Event {
|
||||||
|
|
||||||
public UUID playerID;
|
public UUID playerID;
|
||||||
|
|
|
@ -2,13 +2,12 @@ package com.zontreck.events;
|
||||||
|
|
||||||
|
|
||||||
import com.zontreck.homes.Home;
|
import com.zontreck.homes.Home;
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.neoforged.bus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event may be cancelled if the home is in a invalid location, like in the middle of a claim they have no rights to
|
* This event may be cancelled if the home is in a invalid location, like in the middle of a claim they have no rights to
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
|
||||||
public class HomeCreatedEvent extends Event
|
public class HomeCreatedEvent extends Event
|
||||||
{
|
{
|
||||||
public Home home;
|
public Home home;
|
||||||
|
|
|
@ -2,7 +2,8 @@ package com.zontreck.events;
|
||||||
|
|
||||||
|
|
||||||
import com.zontreck.homes.Home;
|
import com.zontreck.homes.Home;
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
|
||||||
|
import net.neoforged.bus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event cannot be cancelled.
|
* This event cannot be cancelled.
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package com.zontreck.events;
|
package com.zontreck.events;
|
||||||
|
|
||||||
import com.zontreck.util.TeleportContainer;
|
import com.zontreck.util.TeleportContainer;
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
|
||||||
|
|
||||||
@Cancelable
|
import net.neoforged.bus.api.Event;
|
||||||
|
|
||||||
public class TeleportEvent extends Event
|
public class TeleportEvent extends Event
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue