Skip to content

Commit

Permalink
port
Browse files Browse the repository at this point in the history
  • Loading branch information
Faboslav committed Jul 11, 2024
1 parent 2fc5264 commit 41034ee
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 22 deletions.
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ subprojects {

dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings "net.fabricmc:yarn:${yarn_mappings}"
mappings loom.layered {
it.mappings "net.fabricmc:yarn:${yarn_mappings}"
it.mappings "dev.architectury:yarn-mappings-patch-neoforge:${yarn_mappings_patch}"
}
}
}

Expand Down Expand Up @@ -40,7 +43,7 @@ allprojects {
"friendsAndFoesVersion": friendsandfoes_version
]

filesMatching(['fabric.mod.json', 'META-INF/mods.toml']) {
filesMatching(['fabric.mod.json', 'META-INF/neoforge.mods.toml']) {
expand expandProps
}

Expand All @@ -55,13 +58,13 @@ allprojects {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutArmorStandProcessorHelper;
import com.faboslav.friendsandfoes.beekeeperhut.world.processor.StructureEntityProcessor;
import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import net.minecraft.structure.StructurePlacementData;
import net.minecraft.structure.StructureTemplate;
import net.minecraft.structure.processor.StructureProcessorType;
Expand All @@ -18,8 +19,7 @@
*/
public final class BeekeeperHutArmorStandProcessor extends StructureEntityProcessor
{
public static final BeekeeperHutArmorStandProcessor INSTANCE = new BeekeeperHutArmorStandProcessor();
public static final Codec<BeekeeperHutArmorStandProcessor> CODEC = Codec.unit(() -> INSTANCE);
public static final MapCodec<BeekeeperHutArmorStandProcessor> CODEC = MapCodec.unit(BeekeeperHutArmorStandProcessor::new);

@Override
public StructureTemplate.StructureEntityInfo processEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutItemFrameProcessorHelper;
import com.faboslav.friendsandfoes.beekeeperhut.world.processor.StructureEntityProcessor;
import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import net.minecraft.structure.StructurePlacementData;
import net.minecraft.structure.StructureTemplate;
import net.minecraft.structure.StructureTemplate.StructureEntityInfo;
Expand All @@ -19,8 +20,7 @@
*/
public final class BeekeeperHutItemFrameProcessor extends StructureEntityProcessor
{
public static final BeekeeperHutItemFrameProcessor INSTANCE = new BeekeeperHutItemFrameProcessor();
public static final Codec<BeekeeperHutItemFrameProcessor> CODEC = Codec.unit(() -> INSTANCE);
public static final MapCodec<BeekeeperHutItemFrameProcessor> CODEC = MapCodec.unit(BeekeeperHutItemFrameProcessor::new);

@Override
public StructureEntityInfo processEntity(
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
]
},
"depends": {
"java": ">=17",
"java": ">=21",
"minecraft": ">=${minMinecraftVersion}",
"fabricloader": ">=${fabricLoaderVersion}",
"fabric": ">=${fabricApiVersion}",
Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ mod_description=An addon for the Friends&Foes mod, adding a beekeeper hut struct
maven_group=com.faboslav.friendsandfoes.beekeeperhut

# Minecraft
minecraft_version=1.20.4
min_minecraft_version=1.20.3
minecraft_version=1.20.6
min_minecraft_version=1.20.5

#Mappings
yarn_mappings=1.20.4+build.3:v2
yarn_mappings=1.20.6+build.1:v2
yarn_mappings_patch=1.20.5+build.3

# Architectury
enabled_platforms=fabric,neoforge
Expand All @@ -26,8 +27,8 @@ mixin_extras_version=0.3.6
friendsandfoes_version=2.0.11

# Fabric https://fabricmc.net/versions.html
fabric_loader_version=0.15.3
fabric_api_version=0.92.0+1.20.4
fabric_loader_version=0.15.11
fabric_api_version=0.98.0+1.20.6

# Neoforge https://projects.neoforged.net/neoforged/neoforge
neoforge_version=20.4.237
neoforge_version=20.6.119
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import com.faboslav.friendsandfoes.beekeeperhut.BeekeeperHut;
import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.RegistryHelperImpl;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;

@Mod(BeekeeperHut.MOD_ID)
public final class BeekeeperHutNeoForge
{
public BeekeeperHutNeoForge() {
public BeekeeperHutNeoForge(ModContainer modContainer, IEventBus modEventBus) {
BeekeeperHut.init();

IEventBus modEventBus = net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus();
RegistryHelperImpl.STRUCTURE_PROCESSOR_TYPES.register(modEventBus);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.StructureEntityProcessorTypesImpl;
import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutArmorStandProcessorHelper;
import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import net.minecraft.structure.StructurePlacementData;
import net.minecraft.structure.StructureTemplate;
import net.minecraft.structure.processor.StructureProcessor;
Expand All @@ -13,8 +14,7 @@

public final class BeekeeperHutArmorStandProcessor extends StructureProcessor
{
public static final BeekeeperHutArmorStandProcessor INSTANCE = new BeekeeperHutArmorStandProcessor();
public static final Codec<BeekeeperHutArmorStandProcessor> CODEC = Codec.unit(() -> INSTANCE);
public static final MapCodec<BeekeeperHutArmorStandProcessor> CODEC = MapCodec.unit(BeekeeperHutArmorStandProcessor::new);

@Override
public StructureTemplate.StructureEntityInfo processEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.StructureEntityProcessorTypesImpl;
import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutItemFrameProcessorHelper;
import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import net.minecraft.structure.StructurePlacementData;
import net.minecraft.structure.StructureTemplate;
import net.minecraft.structure.processor.StructureProcessor;
Expand All @@ -13,8 +14,7 @@

public final class BeekeeperHutItemFrameProcessor extends StructureProcessor
{
public static final BeekeeperHutItemFrameProcessor INSTANCE = new BeekeeperHutItemFrameProcessor();
public static final Codec<BeekeeperHutItemFrameProcessor> CODEC = Codec.unit(() -> INSTANCE);
public static final MapCodec<BeekeeperHutItemFrameProcessor> CODEC = MapCodec.unit(BeekeeperHutItemFrameProcessor::new);

@Override
public StructureTemplate.StructureEntityInfo processEntity(
Expand Down

0 comments on commit 41034ee

Please sign in to comment.