Skip to content

Commit

Permalink
修正图标丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Jan 22, 2025
1 parent 359285c commit b2a3396
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ dependencies {

implementation fg.deobf("curse.maven:iron-chests-228756:${iron_chests_id}")

// implementation fg.deobf("net.conczin:immersive_melodies:${immersive_melodies_version}")

runtimeOnly fg.deobf("curse.maven:carry-on-274259:${carry_on_id}")

runtimeOnly "curse.maven:kotlin-for-forge-351264:${kotlin_id}"
Expand All @@ -190,7 +188,6 @@ dependencies {
runtimeOnly fg.deobf("curse.maven:enchantment-descriptions-250419:${enchantment_descriptions_id}")

implementation fg.deobf('curse.maven:timeless-and-classics-zero-1028108:5722012')
// implementation fg.deobf("curse.maven:timeless-and-classics-zero-1028108:6069384-sources-6069403")

implementation fg.deobf("maven.modrinth:simple-hats:1.18.2-0.3.2-forge")
implementation fg.deobf("maven.modrinth:curios:1.18.2-5.0.9.2-forge")
Expand All @@ -202,10 +199,6 @@ dependencies {
runtimeOnly fg.deobf("maven.modrinth:embeddium:0.3.18+mc1.18.2")
runtimeOnly fg.deobf('maven.modrinth:oculus:1.18.2-1.6.4')

// runtimeOnly fg.deobf("maven.modrinth:common-network:1.0.5-1.20.1")
// runtimeOnly fg.deobf("maven.modrinth:just-more-cakes:1.18.1-forge")
// runtimeOnly fg.deobf("maven.modrinth:spawn-animations:1.10+mod-forge")

annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RegisterClientReloadListenersEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.apache.commons.lang3.time.StopWatch;
Expand All @@ -35,6 +36,16 @@ public static void onRegister(RegisterClientReloadListenersEvent event) {
event.registerReloadListener(new ReloadResourceEvent());
}

@SubscribeEvent
public static void onTextureStitchEventPre(TextureStitchEvent.Pre event) {
if (BLOCK_ATLAS_TEXTURE.equals(event.getAtlas().location())) {
event.addSprite(TANK_INPUT_SLOT);
event.addSprite(TANK_OUTPUT_SLOT);
event.addSprite(EMPTY_MAINHAND_SLOT);
event.addSprite(EMPTY_BACK_SHOW_SLOT);
}
}

public static void asyncReloadAllPack() {
CompletableFuture.supplyAsync(() -> {
reloadAllPack();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.tartaricacid.touhoulittlemaid.inventory.container;

import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid;
import com.github.tartaricacid.touhoulittlemaid.client.event.ReloadResourceEvent;
import com.github.tartaricacid.touhoulittlemaid.inventory.handler.BaubleItemHandler;
import com.mojang.datafixers.util.Pair;
import net.minecraft.core.Direction;
Expand All @@ -27,8 +28,6 @@

public abstract class MaidMainContainer extends AbstractMaidContainer {
public static final int PLAYER_INVENTORY_SIZE = 36;
private static final ResourceLocation EMPTY_MAINHAND_SLOT = new ResourceLocation("item/empty_slot_sword");
private static final ResourceLocation EMPTY_BACK_SHOW_SLOT = new ResourceLocation(TouhouLittleMaid.MOD_ID, "slot/empty_back_show_slot");
private static final ResourceLocation[] TEXTURE_EMPTY_SLOTS = new ResourceLocation[]{EMPTY_ARMOR_SLOT_BOOTS, EMPTY_ARMOR_SLOT_LEGGINGS, EMPTY_ARMOR_SLOT_CHESTPLATE, EMPTY_ARMOR_SLOT_HELMET};
private static final EquipmentSlot[] SLOT_IDS = new EquipmentSlot[]{EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET};

Expand All @@ -49,7 +48,7 @@ private void addMaidHandInv() {
@Override
@OnlyIn(Dist.CLIENT)
public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
return Pair.of(BLOCK_ATLAS, EMPTY_MAINHAND_SLOT);
return Pair.of(BLOCK_ATLAS, ReloadResourceEvent.EMPTY_MAINHAND_SLOT);
}
}));
hand.ifPresent((handler) -> addSlot(new SlotItemHandler(handler, 1, 121, 77) {
Expand Down Expand Up @@ -106,7 +105,7 @@ private void addMainDefaultInv() {
addSlot(new SlotItemHandler(inv, i, 143 + 18 * i, 37) {
@Override
public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
return Pair.of(BLOCK_ATLAS, EMPTY_BACK_SHOW_SLOT);
return Pair.of(BLOCK_ATLAS, ReloadResourceEvent.EMPTY_BACK_SHOW_SLOT);
}
});
}
Expand Down

0 comments on commit b2a3396

Please sign in to comment.