mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Remove canClickRunClientCommand
This was added in 4675583e1c to handle
Forge on longer supporting RUN_COMMAND for client-side commands.
However, the mixins are still present on NF/1.20.4, so we don't need
this!
			
			
This commit is contained in:
		| @@ -5,7 +5,6 @@ | ||||
| package dan200.computercraft.shared.command.text; | ||||
| 
 | ||||
| import dan200.computercraft.shared.computer.core.ServerComputer; | ||||
| import dan200.computercraft.shared.platform.PlatformHelper; | ||||
| import net.minecraft.ChatFormatting; | ||||
| import net.minecraft.core.BlockPos; | ||||
| import net.minecraft.network.chat.ClickEvent; | ||||
| @@ -56,10 +55,7 @@ public final class ChatHelpers { | ||||
|     } | ||||
| 
 | ||||
|     public static Component clientLink(MutableComponent component, String command, Component toolTip) { | ||||
|         var event = PlatformHelper.get().canClickRunClientCommand() | ||||
|             ? new ClickEvent(ClickEvent.Action.RUN_COMMAND, command) | ||||
|             : new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command); | ||||
|         return link(component, event, toolTip); | ||||
|         return link(component, new ClickEvent(ClickEvent.Action.RUN_COMMAND, command), toolTip); | ||||
|     } | ||||
| 
 | ||||
|     public static Component link(Component component, ClickEvent click, Component toolTip) { | ||||
|   | ||||
| @@ -375,13 +375,4 @@ public interface PlatformHelper extends dan200.computercraft.impl.PlatformHelper | ||||
|      * @see ServerPlayerGameMode#useItemOn(ServerPlayer, Level, ItemStack, InteractionHand, BlockHitResult) | ||||
|      */ | ||||
|     InteractionResult useOn(ServerPlayer player, ItemStack stack, BlockHitResult hit, Predicate<BlockState> canUseBlock); | ||||
| 
 | ||||
|     /** | ||||
|      * Whether {@link net.minecraft.network.chat.ClickEvent.Action#RUN_COMMAND} can be used to run client commands. | ||||
|      * | ||||
|      * @return Whether client commands can be triggered from chat components. | ||||
|      */ | ||||
|     default boolean canClickRunClientCommand() { | ||||
|         return true; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates