* Add javadocs to many methods * Added built-in ways to generate BundledModules and documented them * Add Eclipse launch files to .gitignore and fix 11 warnings * Remove many unused imports * Remove some dead and unused code around app loading * Allow extensions to have client-side rules in their SettingsManager Also change tabs to spaces when those changed * Remove unnecessary classloader param in BundledModule * Change max tickwarp duration to Integer.MAX_VALUE * Move RulePrinter into the source so it can be managed by the IDE * Properly reset hopperCounters when changing worlds Also change tabs to spaces again and minor tweaks to javadocs * Run mergedocs even if Full.md was modified * Update src/main/java/carpet/commands/TickCommand.java Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
package carpet.mixins;
|
|
|
|
import carpet.CarpetServer;
|
|
import carpet.network.CarpetClient;
|
|
import carpet.settings.SettingsManager;
|
|
import net.minecraft.client.network.ClientPlayerEntity;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
|
|
@Mixin(ClientPlayerEntity.class)
|
|
public class ClientPlayerEntity_clientCommandMixin
|
|
{
|
|
@Inject(method = "sendChatMessage", at = @At("HEAD"))
|
|
private void inspectMessage(String string, CallbackInfo ci)
|
|
{
|
|
if (string.startsWith("/call"))
|
|
{
|
|
String command = string.substring(6);
|
|
CarpetClient.sendClientCommand(command);
|
|
}
|
|
if (CarpetServer.minecraft_server == null && !CarpetClient.isCarpet())
|
|
{
|
|
ClientPlayerEntity playerSource = (ClientPlayerEntity)(Object) this;
|
|
CarpetServer.settingsManager.inspectClientsideCommand(playerSource.getCommandSource(), string);
|
|
CarpetServer.extensions.forEach(e -> {
|
|
SettingsManager sm = e.customSettingsManager();
|
|
if (sm != null) sm.inspectClientsideCommand(playerSource.getCommandSource(), string);
|
|
});
|
|
}
|
|
}
|
|
}
|