Skip to content

Commit

Permalink
Update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Dec 8, 2023
1 parent ecdec60 commit 3575429
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/1.20.3_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '**.properties'
- '**/src/**'
branches:
- "1.20.3"
- "1.20.4"
types: [ opened, synchronize, reopened ]
jobs:
validate-gradle:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/1.20.3_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '**.properties'
- '**/src/**'
branches:
- "1.20.3"
- "1.20.4"
workflow_dispatch:
inputs:
norelease:
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ unifiedPublishing {
curseforge {
token = CURSE_API_KEY
id = rootProject.curseforge_id
gameVersions.addAll "Java 17", "1.20.3-Snapshot"//, project.minecraft_version
gameVersions.addAll "Java 17", "1.20.4-Snapshot", project.minecraft_version
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package dev.architectury.core.item.forge.imitator;

import dev.architectury.hooks.forgelike.ForgeLikeHooks;
import dev.architectury.injectables.annotations.PlatformOnly;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.ItemStack;
Expand All @@ -32,13 +34,15 @@
public class ArchitecturyBucketItem extends BucketItem {
public ArchitecturyBucketItem(Supplier<? extends Fluid> fluid, Properties properties) {
super(fluid, properties);
ForgeLikeHooks.registerBucketItemCapability(this);
}

public final Fluid getContainedFluid() {
return getFluid();
}

@Override
@PlatformOnly(PlatformOnly.FORGE)
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) {
return this.getClass() == ArchitecturyBucketItem.class ? new FluidBucketWrapper(stack) : super.initCapabilities(stack, nbt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.mojang.serialization.Codec;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraftforge.common.world.BiomeModifier;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -33,4 +34,9 @@ public class ForgeLikeHooks {
public static void registerBiomeModifier(ResourceLocation id, Supplier<Codec<? extends BiomeModifier>> codecSupplier) {
throw new AssertionError();
}

@ExpectPlatform
public static void registerBucketItemCapability(Item item) {
throw new AssertionError();
}
}
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
org.gradle.jvmargs=-Xmx6G
org.gradle.daemon=false

platforms=fabric
platforms=fabric,forge,neoforge

minecraft_version=1.20.3-pre1
supported_version=1.20.3-pre1
minecraft_version=1.20.4
supported_version=1.20.4

artifact_type=beta
artifact_type=release

archives_base_name=architectury
archives_base_name_snapshot=architectury-snapshot
base_version=11.0
maven_group=dev.architectury

fabric_loader_version=0.14.23
fabric_api_version=0.90.11+1.20.3
fabric_loader_version=0.15.1
fabric_api_version=0.91.1+1.20.4
mod_menu_version=7.0.0

forge_version=48.0.38
neoforge_version=20.2.59-beta
forge_version=49.0.3
neoforge_version=20.4.3-beta

curseforge_id=419699
modrinth_id=lhGA9TYQ
2 changes: 1 addition & 1 deletion minecraftforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ unifiedPublishing {
displayName = "[MinecraftForge $rootProject.supported_version] v$project.version"
releaseType = "$rootProject.artifact_type"
changelog = releaseChangelog()
gameVersions = ["1.20.2"]
gameVersions = ["1.20.4"]
gameLoaders = ["forge"]
mainPublication renameJarForPublication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import dev.architectury.platform.hooks.EventBusesHooks;
import dev.architectury.utils.ArchitecturyConstants;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraftforge.common.world.BiomeModifier;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegisterEvent;
Expand All @@ -39,4 +40,7 @@ public static void registerBiomeModifier(ResourceLocation id, Supplier<Codec<? e
});
});
}

public static void registerBucketItemCapability(Item item) {
}
}
2 changes: 1 addition & 1 deletion minecraftforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ side = "BOTH"
[[dependencies.architectury]]
modId = "forge"
mandatory = true
versionRange = "[48,)"
versionRange = "[49,)"
ordering = "NONE"
side = "BOTH"
2 changes: 1 addition & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ unifiedPublishing {
displayName = "[NeoForge $rootProject.supported_version] v$project.version"
releaseType = "$rootProject.artifact_type"
changelog = releaseChangelog()
gameVersions = ["1.20.2"]
gameVersions = ["1.20.4"]
gameLoaders = ["neoforge"]
mainPublication renameJarForPublication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@
import com.mojang.serialization.Codec;
import dev.architectury.platform.hooks.forge.EventBusesHooksImpl;
import dev.architectury.utils.ArchitecturyConstants;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
import net.neoforged.neoforge.common.world.BiomeModifier;
import net.neoforged.neoforge.fluids.capability.wrappers.FluidBucketWrapper;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import net.neoforged.neoforge.registries.RegisterEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.function.Supplier;

public class ForgeLikeHooksImpl {
private static final Logger LOGGER = LogManager.getLogger(ForgeLikeHooksImpl.class);

public static void registerBiomeModifier(ResourceLocation id, Supplier<Codec<? extends BiomeModifier>> codecSupplier) {
EventBusesHooksImpl.whenAvailable(ArchitecturyConstants.MOD_ID, bus -> {
bus.<RegisterEvent>addListener(event -> {
Expand All @@ -39,4 +48,16 @@ public static void registerBiomeModifier(ResourceLocation id, Supplier<Codec<? e
});
});
}

public static void registerBucketItemCapability(Item item) {
EventBusesHooksImpl.whenAvailable(ArchitecturyConstants.MOD_ID, bus -> {
bus.<RegisterCapabilitiesEvent>addListener(event -> {
if (BuiltInRegistries.ITEM.containsValue(item)) {
event.registerItem(Capabilities.FluidHandler.ITEM, (stack, ctx) -> new FluidBucketWrapper(stack), item);
} else {
LOGGER.warn("Tried to register a bucket item capability for an item that is not registered: {}", item);
}
});
});
}
}
4 changes: 2 additions & 2 deletions neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ license = "LGPL-3"
[[dependencies.architectury]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.2,)"
versionRange = "[1.20.3,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.architectury]]
modId = "neoforge"
mandatory = true
versionRange = "[20.2.58,)"
versionRange = "[20.3,)"
ordering = "NONE"
side = "BOTH"

Expand Down
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (JavaVersion.current().ordinal() + 1 < 17) {

include("common")
include("fabric")
//include("forge")
//include("minecraftforge")
//include("neoforge")
include("forge")
include("minecraftforge")
include("neoforge")
include("testmod-common")
include("testmod-fabric")
//include("testmod-forge")
//include("testmod-neoforge")
include("testmod-forge")
include("testmod-neoforge")

rootProject.name = "architectury"
6 changes: 0 additions & 6 deletions testmod-forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ plugins {
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath

mods {
forge {
sourceSet project(":minecraftforge").sourceSets.main
}
}

forge {
mixinConfig "architectury.mixins.json"
}
Expand Down

0 comments on commit 3575429

Please sign in to comment.