Skip to content

Commit

Permalink
Update to 1.20.2
Browse files Browse the repository at this point in the history
- Bumped versions, gradle, loom
- Removed unused imports, qualified static ones
  • Loading branch information
Big-Iron-Cheems committed Oct 15, 2023
1 parent 64712a3 commit b3baa3b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.ajoberstar.grgit' version '5.0.0'
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx4G

# Fabric (https://fabricmc.net/versions.html)
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.2
loader_version=0.14.21
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.23

# Mod Properties
mod_version=1.4.2
mod_version=1.4.3
maven_group=maxsuperman.addons
archives_base_name=villager-roller

meteor_version=0.5.4-SNAPSHOT
meteor_version=0.5.5-SNAPSHOT
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.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import maxsuperman.addons.roller.modules.VillagerRoller;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.systems.modules.Modules;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.lang.invoke.MethodHandles;

public class VillagerRollerAddon extends MeteorAddon {
public static final Logger LOG = LogManager.getLogger();
Expand All @@ -19,7 +16,7 @@ public void onInitialize() {
// Modules
Modules.get().add(new VillagerRoller());
}

@Override
public void onRegisterCategories() {
//Modules.registerCategory(CATEGORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.block.Blocks;
import net.minecraft.client.sound.PositionedSoundInstance;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.item.ItemStack;
Expand All @@ -41,6 +42,7 @@
import net.minecraft.nbt.NbtList;
import net.minecraft.registry.Registries;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
Expand All @@ -53,10 +55,6 @@
import java.nio.file.Files;
import java.util.*;

import static net.minecraft.enchantment.EnchantmentHelper.getIdFromNbt;
import static net.minecraft.enchantment.EnchantmentHelper.getLevelFromNbt;
import static net.minecraft.sound.SoundEvents.BLOCK_AMETHYST_CLUSTER_BREAK;

public class VillagerRoller extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgSound = settings.createGroup("Sound");
Expand All @@ -82,7 +80,7 @@ public class VillagerRoller extends Module {
private final Setting<List<SoundEvent>> sound = sgSound.add(new SoundEventListSetting.Builder()
.name("sound-to-play")
.description("Sound that will be played when desired trade is found if enabled")
.defaultValue(Collections.singletonList(BLOCK_AMETHYST_CLUSTER_BREAK))
.defaultValue(Collections.singletonList(SoundEvents.BLOCK_AMETHYST_CLUSTER_BREAK))
.build());

private final Setting<Double> soundPitch = sgSound.add(new DoubleSetting.Builder()
Expand Down Expand Up @@ -580,20 +578,20 @@ public Map<Identifier, Integer> getEnchants(ItemStack stack) {
NbtList list = stack.getNbt().getList("StoredEnchantments", NbtElement.COMPOUND_TYPE);
for(int i = 0; i < list.size(); ++i) {
NbtCompound c = list.getCompound(i);
Identifier id = getIdFromNbt(c);
Identifier id = EnchantmentHelper.getIdFromNbt(c);
if(id == null) {
continue;
}
ret.put(id, getLevelFromNbt(c));
ret.put(id, EnchantmentHelper.getLevelFromNbt(c));
}
list = stack.getNbt().getList("Enchantments", NbtElement.COMPOUND_TYPE);
for(int i = 0; i < list.size(); ++i) {
NbtCompound c = list.getCompound(i);
Identifier id = getIdFromNbt(c);
Identifier id = EnchantmentHelper.getIdFromNbt(c);
if(id == null) {
continue;
}
ret.put(id, getLevelFromNbt(c));
ret.put(id, EnchantmentHelper.getLevelFromNbt(c));
}
return ret;
}
Expand Down

0 comments on commit b3baa3b

Please sign in to comment.