Skip to content

Commit

Permalink
update to 1.19.3 (not compatible with earlier 1.19.x) (#77)
Browse files Browse the repository at this point in the history
* update to 1.19.3 (not compatible with earlier 1.19.x)

Co-authored-by: Andrew Grant <[email protected]>
  • Loading branch information
topia and Andrew6rant authored Jan 27, 2023
1 parent 37f249b commit aa66541
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 33 deletions.
6 changes: 4 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.0-SNAPSHOT'
id 'maven-publish'
id "me.shedaniel.unified-publishing" version "0.1.+"
}
Expand All @@ -12,9 +12,11 @@ version = project.mod_version
group = project.maven_group

repositories {
maven { url 'https://jitpack.io' }
maven { url = "https://storage.googleapis.com/devan-maven/" }
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.terraformersmc.com/releases/" }

// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
Expand All @@ -31,7 +33,7 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

include "net.devtech:Stacc:1.3.2"
include "net.devtech:Stacc:${project.stacc_version}"
modRuntimeOnly(include("net.devtech:Stacc:${project.stacc_version}"))

modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.6
loader_version=0.14.8
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.3
loader_version=0.14.11

# Mod Properties
mod_version = 3.0.2-1.19.x
mod_version = 3.0.2-1.19.3
maven_group = io.github.Andrew6rant
archives_base_name = stacker

# Dependencies
fabric_version=0.58.5+1.19.1
modmenu_version=4.0.0
cloth_config_version=7.0.72
stacc_version=1.3.4
fabric_version=0.69.1+1.19.3
modmenu_version=5.0.0
cloth_config_version=9.0.94
stacc_version=1.4.0
13 changes: 6 additions & 7 deletions src/main/java/io/github/Andrew6rant/stacker/Stacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.minecraft.item.Item;
import net.minecraft.tag.TagKey;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand All @@ -19,8 +20,6 @@
import java.util.Set;
import java.util.stream.Collectors;

import static net.minecraft.util.registry.Registry.ITEM_KEY;

public class Stacker implements ModInitializer {
private static final Logger LOGGER = LogManager.getLogger("Stacker");
private static Stacker stacker;
Expand All @@ -40,7 +39,7 @@ public void onInitialize() {
public static void loadStacker(String configMsg) {
LOGGER.info("Stacker: Attempting to "+configMsg+" config...");
Set<String> invalidSet = new HashSet<>();
for (Item item : Registry.ITEM) {
for (Item item : Registries.ITEM) {
if (!item.isDamageable()) {
Stacker.setMax(item, stackerConfig.getConfig().maxStacker);
}
Expand Down Expand Up @@ -88,15 +87,15 @@ public static Integer overrideItem(Item item, List<String> overrideList, Set<Str
if (isValid(overrideEntry, splitEntry, invalidSet)) {
List<TagKey<Item>> itemStream = item.getRegistryEntry().streamTags().collect(Collectors.toList());
for (TagKey<Item> tagKey : itemStream) {
if (item.getRegistryEntry().isIn(TagKey.of(ITEM_KEY, new Identifier(splitEntry[0], splitEntry[1])))) {
if (item.getRegistryEntry().isIn(TagKey.of(RegistryKeys.ITEM, new Identifier(splitEntry[0], splitEntry[1])))) {
return Integer.parseInt(splitEntry[2]);
}
}
}
} else {
String[] splitEntry = overrideEntry.trim().split(":"); // split into three parts: tag id, item name, max count
if (isValid(overrideEntry, splitEntry, invalidSet)) {
if (Registry.ITEM.getId(item).toString().equalsIgnoreCase(splitEntry[0] + ":" + splitEntry[1])) {
if (Registries.ITEM.getId(item).toString().equalsIgnoreCase(splitEntry[0] + ":" + splitEntry[1])) {
return Integer.parseInt(splitEntry[2]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import io.github.Andrew6rant.stacker.StackerConfig;
import me.shedaniel.autoconfig.AutoConfig;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(targets = "net/minecraft/block/dispenser/DispenserBehavior$8")
public class DispenserBehaviorMixin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package io.github.Andrew6rant.stacker.mixin;

import io.github.Andrew6rant.stacker.Stacker;
import io.github.Andrew6rant.stacker.StackerConfig;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.item.Item;
import org.apache.commons.lang3.Validate;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Environment(EnvType.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package io.github.Andrew6rant.stacker.mixin;

import io.github.Andrew6rant.stacker.Stacker;
import io.github.Andrew6rant.stacker.StackerConfig;
import net.minecraft.item.Item;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.*;

@Mixin(Item.Settings.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package io.github.Andrew6rant.stacker.mixin;

import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.screen.AbstractFurnaceScreenHandler;
import net.minecraft.screen.slot.FurnaceFuelSlot;
import net.minecraft.screen.slot.Slot;
import org.spongepowered.asm.mixin.Mixin;

import net.fabricmc.loader.api.FabricLoader;

@Mixin(FurnaceFuelSlot.class)
public abstract class LimitFurnaceStackMixin extends Slot {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.Andrew6rant.stacker.util;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;

public class ItemsHelper {

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": [
"1.19.x"
"1.19.3"
],
"java": ">=17",
"cloth-config2": ">=7.0.72"
"cloth-config2": ">=9.0.94"
},
"custom": {
"modmenu": [
Expand Down

0 comments on commit aa66541

Please sign in to comment.