mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	STOP DOING MIXINS (on Forge)
BYTECODE WAS NOT SUPPOSED TO BE REWRITTEN
YEARS OF DEBUGGING REMAPPING FAILURES yet NO ACTUAL SOLUTION FOUND.
Wanted to use Mixins for anyway for a laugh? We had a tool for that: it
was called "FABRIC LOOM".
"Yes, please produce completely broken jars for no discernable reason"
Statements dreamed up by the utterly Deranged.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This removes our two mixins used on Forge:
 - Breaking progress for cabled/wired modems.
 - Running client commands from chat click events. We now suggest the
   command on Forge instead.
Occasionally we get issues where the mixin annotation processor doesn't
write its tsrg file in time for the reobfJar/reobfJarJar task. I thought
we'd fixed that cb8e06af2a, but sometimes
we still produce missing jars - I have a feeling this might be to do
with incremental compilation.
We can maybe re-evaluate this on 1.20.4, where we don't need to worry
about remapping any more.
			
			
This commit is contained in:
		| @@ -385,7 +385,7 @@ public final class CommandComputerCraft { | ||||
|         var file = new File(ServerContext.get(source.getServer()).storageDir().toFile(), "computer/" + id); | ||||
|         if (!file.isDirectory()) return null; | ||||
| 
 | ||||
|         return link( | ||||
|         return clientLink( | ||||
|             text("\u270E"), | ||||
|             "/" + CLIENT_OPEN_FOLDER + " " + id, | ||||
|             Component.translatable("commands.computercraft.dump.open_path") | ||||
|   | ||||
| @@ -5,6 +5,7 @@ | ||||
| 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; | ||||
| @@ -54,6 +55,13 @@ public final class ChatHelpers { | ||||
|         return link(component, new ClickEvent(ClickEvent.Action.RUN_COMMAND, command), toolTip); | ||||
|     } | ||||
| 
 | ||||
|     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); | ||||
|     } | ||||
| 
 | ||||
|     public static Component link(Component component, ClickEvent click, Component toolTip) { | ||||
|         var style = component.getStyle(); | ||||
| 
 | ||||
|   | ||||
| @@ -389,4 +389,13 @@ 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