Skip to content

Commit

Permalink
forge 1.21.4
Browse files Browse the repository at this point in the history
fix loader metadata
  • Loading branch information
deirn committed Dec 7, 2024
1 parent 1fa30f1 commit 4280c26
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fabricApi = 0.110.5+1.21.4
modMenu = 10.0.0-alpha.3
trEnergy = 3.0.0

forge = 53.0.13
forge = 54.0.6
neo = 21.4.5-beta

architectury = 10.0.7
Expand Down
6 changes: 3 additions & 3 deletions platform/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
],

"depends" : {
"fabricloader": ">=0.16.7",
"fabric" : ">=0.105.4",
"minecraft" : ">=1.21.3",
"fabricloader": ">=0.16.9",
"fabric" : ">=0.110.5",
"minecraft" : ">=1.21.4",
"badpackets" : ">=0.8-0"
},
"breaks" : {
Expand Down
4 changes: 2 additions & 2 deletions platform/forge/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
cf.endpoint = minecraft.curseforge.com
cf.projectId = 455982
cf.releaseType = stable
cf.gameVersion = 1.21.3
cf.gameVersion = 1.21.4
cf.loader = Forge
cf.require = badpackets
cf.optional = jei, roughly-enough-items-hacks

# Modrinth
mr.projectId = 6AQIaxuO
mr.releaseType = stable
mr.gameVersion = 1.21.3
mr.gameVersion = 1.21.4
mr.loader = forge
mr.require = ftdbN0KK
mr.optional = 1PfY6b5p
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
public class ForgeApiService extends ApiService {

@Override
@SuppressWarnings("DataFlowIssue")
public IModInfo getModInfo(ItemStack stack) {
return ModInfo.get(stack.getItem().getCreatorModId(stack));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package mcp.mobius.waila.forge;

import mcp.mobius.waila.command.ServerCommand;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import org.jetbrains.annotations.Nullable;

public class ForgeServerCommand extends ServerCommand {

@Override
protected @Nullable String fillContainer(ServerLevel world, BlockPos pos, ServerPlayer player) {
var be = world.getBlockEntity(pos);
if (be == null) return "No BlockEntity at " + pos.toShortString();
var handler = be.getCapability(ForgeCapabilities.ITEM_HANDLER, null).resolve().orElse(null);
if (handler == null) return "No storage at " + pos.toShortString();
var offHandStack = player.getOffhandItem();

var size = handler.getSlots();
for (var i = 0; i < size; i++) {
var item = !offHandStack.isEmpty()
? offHandStack.getItem()
: BuiltInRegistries.ITEM.getRandom(world.random).orElseThrow().value();

handler.insertItem(i, new ItemStack(item, item.getDefaultMaxStackSize()), false);
}

return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.WailaConstants;
import mcp.mobius.waila.command.ServerCommand;
import mcp.mobius.waila.config.PluginConfig;
import mcp.mobius.waila.debug.DumpGenerator;
import mcp.mobius.waila.network.Packets;
Expand Down Expand Up @@ -61,7 +60,7 @@ static void tagReload(TagsUpdatedEvent event) {

@SubscribeEvent
static void registerCommands(RegisterCommandsEvent event) {
new ServerCommand().register(event.getDispatcher());
new ForgeServerCommand().register(event.getDispatcher());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
import mcp.mobius.waila.gui.screen.HomeScreen;
import mcp.mobius.waila.network.Packets;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
import net.minecraftforge.client.event.RegisterClientCommandsEvent;
import net.minecraftforge.client.event.RegisterClientReloadListenersEvent;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
Expand All @@ -40,8 +39,7 @@ static void addReloadListener(RegisterClientReloadListenersEvent event) {
}

static void registerConfigScreen() {
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new HomeScreen(screen)));
MinecraftForge.registerConfigScreen(HomeScreen::new);
}

@EventBusSubscriber(modid = WailaConstants.WAILA, value = Dist.CLIENT)
Expand Down
4 changes: 2 additions & 2 deletions platform/forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ logoFile = "wthit.png"
[[dependencies.wthit]]
modId = "forge"
mandatory = true
versionRange = "[53.0.13,)"
versionRange = "[54.0.6,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.wthit]]
modId = "minecraft"
mandatory = true
versionRange = "[1.21.3,)"
versionRange = "[1.21.4,)"
ordering = "NONE"
side = "BOTH"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import mcp.mobius.waila.api.data.FluidData.FluidDescriptionContext;
import mcp.mobius.waila.api.data.FluidData.FluidDescriptor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraftforge.fluids.FluidStack;
Expand All @@ -24,7 +24,7 @@ public void describeFluid(FluidDescriptionContext<Fluid> ctx, FluidDescription d
var extensions = IClientFluidTypeExtensions.of(type);

desc.name(type.getDescription(stack))
.sprite(Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(extensions.getStillTexture(stack)))
.sprite(Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(extensions.getStillTexture(stack)))
.tint(extensions.getTintColor(stack));
}

Expand Down
4 changes: 2 additions & 2 deletions platform/neo/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ logoFile = "wthit.png"
[[dependencies.wthit]]
modId = "neoforge"
type = "required"
versionRange = "[21.3.0-beta,)"
versionRange = "[21.4.5-beta,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.wthit]]
modId = "minecraft"
type = "required"
versionRange = "[1.21.3,)"
versionRange = "[1.21.4,)"
ordering = "NONE"
side = "BOTH"

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ platform("mojmap")

//platform("bukkit")
platform("fabric")
//platform("forge")
platform("forge")
platform("neo")
platform("textile")
//platform("quilt")

0 comments on commit 4280c26

Please sign in to comment.