Skip to content

Commit

Permalink
1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Dec 7, 2022
1 parent cd135aa commit 9f1feeb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subprojects {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.3:v2"))
//it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.3:v2"))
// https://lambdaurora.dev/tools/import_quilt.html
it.officialMojangMappings {
setNameSyntheticMembers(false)
Expand Down
2 changes: 1 addition & 1 deletion fabric-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories {

dependencies {
// Modmenu (for configuring the mod in-game)
modImplementation("com.terraformersmc:modmenu:${project.modmenu_version}")
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")

// Cloth Config
modImplementation("dev.isxander:yet-another-config-lib:${project.yacl_version}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
package org.samo_lego.clientstorage.fabric_client.inventory;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.samo_lego.clientstorage.fabric_client.casts.IRemoteStack;
import org.samo_lego.clientstorage.fabric_client.util.ItemDisplayType;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.*;

import static org.samo_lego.clientstorage.fabric_client.ClientStorageFabric.config;
import static org.samo_lego.clientstorage.fabric_client.util.StorageCache.FREE_SPACE_CONTAINERS;
Expand Down Expand Up @@ -55,7 +52,7 @@ public void sort() {
ItemStack itemA = stacksA.getFirst();
ItemStack itemB = stacksB.getFirst();

return Registry.ITEM.getId(itemA.getItem()) - Registry.ITEM.getId(itemB.getItem());
return Item.getId(itemA.getItem()) - Item.getId(itemB.getItem());
}
});
}
Expand Down Expand Up @@ -246,7 +243,7 @@ public void refreshSearchResults(String value) {
String namespace = search[0];
final var item = stackPair.getFirst();

boolean namespaceFltr = Registry.ITEM.getKey(item.getItem()).toString().startsWith(namespace);
boolean namespaceFltr = BuiltInRegistries.ITEM.getKey(item.getItem()).toString().startsWith(namespace);

if (namespaceFltr && search.length > 1) {
return item.getDisplayName().getString().toLowerCase(Locale.ROOT).contains(search[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import org.samo_lego.clientstorage.fabric_client.event.ContainerDiscovery;
import org.samo_lego.clientstorage.fabric_client.util.PlayerLookUtil;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

import static org.samo_lego.clientstorage.fabric_client.event.ContainerDiscovery.lastCraftingHit;


Expand All @@ -35,12 +32,12 @@ private static void setCarried(int pickSlot, ItemStack stack) {
//player.containerMenu.clicked(pickSlot, 0, ClickType.PICKUP, player);

// This is cursed but I couldn't manage to find the right place to execute this
CompletableFuture.delayedExecutor(150, TimeUnit.MILLISECONDS).execute(() -> {
/*CompletableFuture.delayedExecutor(150, TimeUnit.MILLISECONDS).execute(() -> {
Minecraft.getInstance().gameMode.handleInventoryMouseClick(player.containerMenu.containerId, pickSlot, 0, ClickType.PICKUP, player);
});
});*/

// Works but doesn't update the cursor
/*final var map = new Int2ObjectOpenHashMap<ItemStack>();
final var map = new Int2ObjectOpenHashMap<ItemStack>();
map.clear();
map.put(pickSlot, ItemStack.EMPTY);

Expand All @@ -50,7 +47,7 @@ private static void setCarried(int pickSlot, ItemStack stack) {
player.containerMenu.setCarried(stack);
player.inventoryMenu.setCarried(stack);
player.getInventory().removeItemNoUpdate(pickSlot);
System.out.println("Set carried stack to " + stack);*/
System.out.println("Set carried stack to " + stack);
}

public void onTake(ItemStack stack, ClickType clickType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.samo_lego.clientstorage.fabric_client.mixin.accessor;

import net.minecraft.client.gui.components.Widget;
import net.minecraft.client.gui.components.Renderable;
import net.minecraft.client.gui.screens.Screen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
Expand All @@ -10,5 +10,5 @@
@Mixin(Screen.class)
public interface AScreen {
@Accessor("renderables")
List<Widget> getRenderables();
List<Renderable> getRenderables();
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package org.samo_lego.clientstorage.fabric_client.mixin.screen;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.math.Matrix4f;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.world.inventory.Slot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.components.ImageButton;
import net.minecraft.client.gui.components.Widget;
import net.minecraft.client.gui.components.Renderable;
import net.minecraft.client.gui.components.events.ContainerEventHandler;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
Expand All @@ -17,11 +17,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.ClickType;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.inventory.CraftingMenu;
import net.minecraft.world.inventory.ResultSlot;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import org.samo_lego.clientstorage.fabric_client.casts.IRemoteStack;
import org.samo_lego.clientstorage.fabric_client.inventory.RemoteInventory;
Expand Down Expand Up @@ -126,9 +122,9 @@ private void init(CallbackInfo ci) {
if (!config.enabled) return;

// Move crafting book down for Y_MOVE
List<Widget> renderables = this.getRenderables();
List<Renderable> renderables = this.getRenderables();
this.recipeBook = (ImageButton) renderables.get(renderables.size() - 1);
this.recipeBook.y += Y_MOVE;
this.recipeBook.setY(Y_MOVE + this.recipeBook.getY());

this.searchBox = new EditBox(this.font, this.leftPos + 83, this.topPos - 35, 84, this.font.lineHeight, Component.translatable("itemGroup.search"));
final String activeFilter = RemoteInventory.getInstance().getActiveFilter();
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.4
loader_version=0.14.9
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
loader_version=0.14.11
#Fabric api
fabric_version=0.60.0+1.19.2
fabric_version=0.68.1+1.19.3
# Mod Properties
mod_version=1.3.0
mod_version=1.3.1
maven_group=org.samo_lego
archives_base_name=clientstorage
# Dependencies
modmenu_version=4.0.6
yacl_version=1.6.0
yacl_version=2.0.0

0 comments on commit 9f1feeb

Please sign in to comment.