Skip to content

Commit

Permalink
Update to 1.20.2 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCarlos26 authored Oct 23, 2023
1 parent 40e63b4 commit b21699e
Show file tree
Hide file tree
Showing 17 changed files with 201 additions and 229 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

name: Java CI with Gradle

concurrency:
group: "build-1.19"
concurrency:
group: "build-1.20"
cancel-in-progress: true

on:
push:
branches: [ master ]
paths-ignore:
- '*.md'


jobs:
build:
Expand All @@ -34,9 +34,8 @@ jobs:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-1.19"
automatic_release_tag: "latest-1.20.2"
prerelease: false
title: "1.19 Build"
title: "1.20.2 Build"
files: |
./build/libs/*.jar
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
Expand All @@ -26,7 +26,8 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Meteor
modImplementation "meteordevelopment:meteor-client:${project.meteor_version}"
modImplementation "meteordevelopment:meteor-client:${project.meteor_version}-SNAPSHOT"
modImplementation "baritone:fabric:${project.minecraft_version}-SNAPSHOT"
}

processResources {
Expand Down
15 changes: 6 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/versions.html)
minecraft_version=1.19.3
yarn_version=1.19.3+build.3
loader_version=0.14.11
# Fabric (https://fabricmc.net/develop/)
minecraft_version=1.20.2
yarn_version=1.20.2+build.4
loader_version=0.14.23

# Mod Properties
mod_version=0.1
maven_group=dummy.package
maven_group=tanuki.package
archives_base_name=tanuki-addon

# Dependency Versions

# Meteor (https://maven.meteordev.org/)
meteor_version=0.5.2-SNAPSHOT
meteor_version=0.5.5
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 20 additions & 21 deletions src/main/java/anticope/tanuki/Tanuki.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
package anticope.tanuki;

import anticope.tanuki.modules.*;
import com.mojang.logging.LogUtils;
import meteordevelopment.meteorclient.addons.GithubRepo;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Modules;
import anticope.tanuki.modules.*;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.item.Items;
import org.slf4j.Logger;


public class Tanuki extends MeteorAddon {
public static final Logger LOG = LogUtils.getLogger();
public static final Category CATEGORY = new Category("Tanuki", Items.BROWN_WOOL.getDefaultStack());

@Override
public void onInitialize() {
LOG.info("Initializing Tanuki");
public static final Logger LOG = LogUtils.getLogger();
public static final Category CATEGORY = new Category("Tanuki", Items.BROWN_WOOL.getDefaultStack());

Modules modules = Modules.get();
modules.add(new AntiCrystal());
modules.add(new AntiCrystalPhase());
modules.add(new AutoGriffer());
modules.add(new BedrockWalk());
modules.add(new Confetti());
modules.add(new FuckedDetector());
modules.add(new PauseOnUnloaded());
@Override
public void onInitialize() {
LOG.info("Initializing Tanuki");

Modules modules = Modules.get();
modules.add(new AntiCrystal());
modules.add(new AntiCrystalPhase());
modules.add(new AutoGriffer());
modules.add(new BedrockWalk());
modules.add(new Confetti());
modules.add(new FuckedDetector());
modules.add(new PauseOnUnloaded());
modules.add(new TanukiPacketFly());
}
}

@Override
public void onRegisterCategories() {
Modules.registerCategory(CATEGORY);
}
@Override
public void onRegisterCategories() {
Modules.registerCategory(CATEGORY);
}

@Override
public String getPackage() {
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/anticope/tanuki/mixin/ClientPlayerEntityMixin.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package anticope.tanuki.mixin;

import anticope.tanuki.events.PushOutOfBlockEvent;
import meteordevelopment.meteorclient.MeteorClient;
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;
import org.spongepowered.asm.mixin.injection.At;

import net.minecraft.client.network.ClientPlayerEntity;

import anticope.tanuki.events.PushOutOfBlockEvent;
import meteordevelopment.meteorclient.MeteorClient;

@Mixin(ClientPlayerEntity.class)
public class ClientPlayerEntityMixin {
@Inject(method = "pushOutOfBlocks", at = @At("HEAD"), cancellable = true)
private void onPushOutOfBlocks(double x, double d, CallbackInfo info) {
PushOutOfBlockEvent event = PushOutOfBlockEvent.get(x, d);
MeteorClient.EVENT_BUS.post(event);
if(event.isCancelled()) info.cancel();
if (event.isCancelled()) info.cancel();
}
}
8 changes: 3 additions & 5 deletions src/main/java/anticope/tanuki/mixin/TotemParticleMixin.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package anticope.tanuki.mixin;

import anticope.tanuki.modules.Confetti;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.particle.AnimatedParticle;
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.particle.TotemParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.Vec3d;
import anticope.tanuki.modules.Confetti;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -23,8 +22,8 @@ protected TotemParticleMixin(ClientWorld world, double x, double y, double z, Sp
@Inject(method = "<init>", at = @At("TAIL"))
private void onConfettiConstructor(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider, CallbackInfo ci) {
Confetti confetti = Modules.get().get(Confetti.class);
TotemParticle totemParticle = ((TotemParticle)(Object) this);
if(confetti.isActive()) {
TotemParticle totemParticle = ((TotemParticle) (Object) this);
if (confetti.isActive()) {
Vec3d colorOne = confetti.getColorOne();
Vec3d colorTwo = confetti.getColorTwo();
if (this.random.nextInt(4) == 0) {
Expand All @@ -34,5 +33,4 @@ private void onConfettiConstructor(ClientWorld world, double x, double y, double
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package anticope.tanuki.mixin.meteor;

import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura;
import net.minecraft.entity.player.PlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import net.minecraft.entity.player.PlayerEntity;

import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura;

@Mixin(CrystalAura.class)
public interface CrystalAuraAccessor {
@Accessor("bestTarget")
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/anticope/tanuki/mixin/meteor/ProfileMixin.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package anticope.tanuki.mixin.meteor;

import anticope.tanuki.modules.hud.ProfileHud;
import meteordevelopment.meteorclient.systems.profiles.Profile;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;

import meteordevelopment.meteorclient.systems.profiles.Profile;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Profile.class)
Expand Down
54 changes: 24 additions & 30 deletions src/main/java/anticope/tanuki/modules/AntiCrystal.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
package anticope.tanuki.modules;

import anticope.tanuki.Tanuki;
import com.google.common.collect.Streams;
import meteordevelopment.orbit.EventHandler;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.settings.EnumSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.utils.player.FindItemResult;
import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.meteorclient.utils.world.BlockUtils;

import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.item.Item;
import net.minecraft.item.Items;

import anticope.tanuki.Tanuki;

import java.util.Comparator;
import java.util.Optional;

Expand All @@ -32,46 +26,46 @@ public enum Mode {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
.name("mode")
.description("The mode at which AntiCrystal operates.")
.defaultValue(Mode.PressurePlate)
.build()
.name("mode")
.description("The mode at which AntiCrystal operates.")
.defaultValue(Mode.PressurePlate)
.build()
);

private final Setting<Double> range = sgGeneral.add(new DoubleSetting.Builder()
.name("range")
.description("The range to place Pressure Plates/Buttons.")
.min(1)
.max(10)
.defaultValue(1)
.build()
.name("range")
.description("The range to place Pressure Plates/Buttons.")
.min(1)
.max(10)
.defaultValue(1)
.build()
);

private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
.name("rotate")
.description("Rotate.")
.defaultValue(true)
.build()
.name("rotate")
.description("Rotate.")
.defaultValue(true)
.build()
);

public AntiCrystal() {
super(Tanuki.CATEGORY, "anti-crystal", "Stops End Crystals from doing damage to you.");
}

private static final Item[] BUTTONS = { Items.ACACIA_BUTTON, Items.BIRCH_BUTTON, Items.CRIMSON_BUTTON, Items.DARK_OAK_BUTTON, Items.JUNGLE_BUTTON, Items.OAK_BUTTON, Items.POLISHED_BLACKSTONE_BUTTON, Items.SPRUCE_BUTTON, Items.STONE_BUTTON, Items.WARPED_BUTTON };
private static final Item[] PLATES = { Items.ACACIA_PRESSURE_PLATE, Items.BIRCH_PRESSURE_PLATE, Items.CRIMSON_PRESSURE_PLATE, Items.DARK_OAK_PRESSURE_PLATE, Items.JUNGLE_PRESSURE_PLATE, Items.OAK_PRESSURE_PLATE, Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, Items.SPRUCE_PRESSURE_PLATE, Items.STONE_PRESSURE_PLATE, Items.WARPED_PRESSURE_PLATE};
private static final Item[] BUTTONS = {Items.ACACIA_BUTTON, Items.BIRCH_BUTTON, Items.CRIMSON_BUTTON, Items.DARK_OAK_BUTTON, Items.JUNGLE_BUTTON, Items.OAK_BUTTON, Items.POLISHED_BLACKSTONE_BUTTON, Items.SPRUCE_BUTTON, Items.STONE_BUTTON, Items.WARPED_BUTTON};
private static final Item[] PLATES = {Items.ACACIA_PRESSURE_PLATE, Items.BIRCH_PRESSURE_PLATE, Items.CRIMSON_PRESSURE_PLATE, Items.DARK_OAK_PRESSURE_PLATE, Items.JUNGLE_PRESSURE_PLATE, Items.OAK_PRESSURE_PLATE, Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, Items.SPRUCE_PRESSURE_PLATE, Items.STONE_PRESSURE_PLATE, Items.WARPED_PRESSURE_PLATE};

@EventHandler
private void onTick(TickEvent.Post event) {
assert mc.world != null;
assert mc.player != null;

Optional<EndCrystalEntity> crystalTarget = Streams.stream(mc.world.getEntities())
.filter(e -> (e instanceof EndCrystalEntity))
.filter(e -> e.distanceTo(mc.player) <= range.get() * 2)
.filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir())
.min(Comparator.comparingDouble(o -> o.distanceTo(mc.player)))
.map(e -> (EndCrystalEntity) e);
.filter(e -> (e instanceof EndCrystalEntity))
.filter(e -> e.distanceTo(mc.player) <= range.get() * 2)
.filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir())
.min(Comparator.comparingDouble(o -> o.distanceTo(mc.player)))
.map(e -> (EndCrystalEntity) e);

crystalTarget.ifPresent(crystal -> {

Expand Down
Loading

0 comments on commit b21699e

Please sign in to comment.