Skip to content

Instantly share code, notes, and snippets.

@superblaubeere27
Last active December 8, 2018 16:15
Show Gist options
  • Save superblaubeere27/f1806c1f9fcdb69fb1d287f522fb0669 to your computer and use it in GitHub Desktop.
Save superblaubeere27/f1806c1f9fcdb69fb1d287f522fb0669 to your computer and use it in GitHub Desktop.
ClientBase Commands

Setup

JVM-Args: -Dfml.coreMods.load=net.superblaubeere27.clientbase.injection.MixinLoader Please replace net.superblaubeere27.clientbase.injection.MixinLoader with the full class name of MixinLoader (if you moved the class)

IntelliJ IDEA

Gradle setup command: gradlew -Dorg.gradle.jvmargs=-Xmx5G setupDecompWorkspace idea genIntelliJRuns build

Eclipse

Gradle setup command: gradlew -Dorg.gradle.jvmargs=-Xmx5G setupDecompWorkspace eclipse build

Export

Gradle build command: gradlew clean build

package net.superblaubeere27.clientbase.modules.modules.fun;
import com.darkmagician6.eventapi.EventTarget;
import com.darkmagician6.eventapi.types.EventType;
import net.minecraft.util.MathHelper;
import net.superblaubeere27.clientbase.events.MotionUpdateEvent;
import net.superblaubeere27.clientbase.modules.Module;
import net.superblaubeere27.clientbase.modules.ModuleCategory;
import net.superblaubeere27.clientbase.utils.Utils;
import net.superblaubeere27.clientbase.valuesystem.BooleanValue;
import net.superblaubeere27.clientbase.valuesystem.ModeValue;
import net.superblaubeere27.clientbase.valuesystem.NumberValue;
public class Derp extends Module {
private ModeValue mode = new ModeValue("Mode", "Beyblade", "Beyblade", "Random");
private NumberValue<Float> speed = new NumberValue<>("Speed", 10f, 1f, 180f);
private BooleanValue silent = new BooleanValue("Silent", false);
public Derp() {
super("Derp", "Makes you do weird stuff", ModuleCategory.FUN);
}
@EventTarget
public void onMotionUpdate(MotionUpdateEvent event) {
if (!getState() || event.getEventType() != (silent.getObject() ? EventType.PRE : EventType.POST)) return;
if (mode.getObject() == 0) { // 0 is the index of "Beyblade"
event.setYaw(MathHelper.wrapAngleTo180_float(event.getYaw() + speed.getObject()));
} else if (mode.getObject() == 1) { // 0 is the index of "Random"
event.setYaw(Utils.random(-180, 180));
event.setPitch(Utils.random(-90, 90));
}
if (!silent.getObject()) {
mc.thePlayer.rotationYaw = event.getYaw();
mc.thePlayer.rotationPitch = event.getPitch();
}
}
}
package net.superblaubeere27.clientbase.command.commands;
import net.minecraft.client.Minecraft;
import net.superblaubeere27.clientbase.command.Command;
import net.superblaubeere27.clientbase.utils.ChatUtils;
import java.util.ArrayList;
import java.util.List;
public class WhoAmICommand extends Command {
public WhoAmICommand() {
super("whoami", "wai", "ign", "ingamename", "username", "name");
}
@Override
public void run(String alias, String[] args) {
ChatUtils.info(Minecraft.getMinecraft().getSession().getUsername());
}
@Override
public List<String> autocomplete(int arg, String[] args) {
return new ArrayList<>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment