Skip to content

Commit

Permalink
forge 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Mar 21, 2022
1 parent db2adef commit bb7c844
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 81 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
def ENV = System.getenv();

architectury {
common(false)
common()
}

tasks.withType(dokkaHtmlPartial.getClass()).configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class Taterzens {

public Taterzens(Platform platform) {
INSTANCE = this;
TATERZEN_TYPE = platform.registerTaterzenType();
platform.registerTaterzenType();

ModDiscovery.checkLoadedMods(platform);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.samo_lego.taterzens.platform;

import net.minecraft.commands.CommandSourceStack;
import net.minecraft.world.entity.EntityType;
import org.samo_lego.taterzens.npc.TaterzenNPC;

import java.nio.file.Path;

Expand Down Expand Up @@ -43,5 +41,5 @@ public abstract class Platform {
* Registers the taterzen entity type.
* @return the taterzen entity type that was registered.
*/
public abstract EntityType<TaterzenNPC> registerTaterzenType();
public abstract void registerTaterzenType();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.Registry;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import org.samo_lego.taterzens.fabric.mixin.MappedRegistryAccessor;
import org.samo_lego.taterzens.npc.TaterzenNPC;
Expand All @@ -16,6 +15,7 @@

import static net.minecraft.core.Registry.ITEM;
import static org.samo_lego.taterzens.Taterzens.NPC_ID;
import static org.samo_lego.taterzens.Taterzens.TATERZEN_TYPE;

public class FabricPlatform extends Platform {

Expand Down Expand Up @@ -55,8 +55,8 @@ public boolean checkPermission(CommandSourceStack commandSource, String permissi


@Override
public EntityType<TaterzenNPC> registerTaterzenType() {
return Registry.register(
public void registerTaterzenType() {
TATERZEN_TYPE = Registry.register(
Registry.ENTITY_TYPE,
NPC_ID,
FabricEntityTypeBuilder
Expand Down
5 changes: 3 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ dependencies {
shadowCommon("com.github.samolego.Config2Brigadier:config2brigadier-forge:${rootProject.c2b_version}") { transitive false }

// SGUI
modImplementation("com.github.samolego:forgified-sgui:${project.fsgui_version}")
shadowCommon("com.github.samolego:forgified-sgui:${project.fsgui_version}") { transitive false }
//modImplementation("com.github.samolego:forgified-sgui:${project.fsgui_version}")
//shadowCommon("com.github.samolego:forgified-sgui:${project.fsgui_version}") { transitive false }
modImplementation(shadowCommon("eu.pb4:sgui:${rootProject.sgui_version}") { transitive false })


common(project(path: ":common", configuration: "namedElements")) { transitive false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.samo_lego.taterzens.forge;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
Expand All @@ -12,6 +13,7 @@
import org.samo_lego.taterzens.npc.TaterzenNPC;

import static org.samo_lego.taterzens.Taterzens.MOD_ID;
import static org.samo_lego.taterzens.Taterzens.NPC_ID;
import static org.samo_lego.taterzens.Taterzens.TATERZEN_TYPE;

@Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
Expand All @@ -33,6 +35,11 @@ public static void entityAttributes(EntityAttributeCreationEvent event) {

@SubscribeEvent
public static void registerEntities(RegistryEvent.Register<EntityType<?>> event) {
TATERZEN_TYPE = (EntityType<TaterzenNPC>) EntityType.Builder
.of(TaterzenNPC::new, MobCategory.MISC)
.sized(0.6F, 1.8F)
.build(NPC_ID.toString())
.setRegistryName(NPC_ID.toString());
event.getRegistry().registerAll(TATERZEN_TYPE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

import net.minecraft.commands.CommandSourceStack;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.registries.RegistryManager;
import org.samo_lego.taterzens.npc.TaterzenNPC;
import org.samo_lego.taterzens.platform.Platform;

import java.nio.file.Path;

import static org.samo_lego.taterzens.Taterzens.NPC_ID;

public class ForgePlatform extends Platform {

private static final ResourceLocation ITEM_ID = new ResourceLocation("item");
Expand Down Expand Up @@ -41,11 +36,11 @@ public boolean checkPermission(CommandSourceStack source, String permissionNode,

@SuppressWarnings("unchecked")
@Override
public EntityType<TaterzenNPC> registerTaterzenType() {
return (EntityType<TaterzenNPC>) EntityType.Builder
public void registerTaterzenType() {
/*return (EntityType<TaterzenNPC>) EntityType.Builder
.of(TaterzenNPC::new, MobCategory.MISC)
.sized(0.6F, 1.8F)
.build(NPC_ID.toString())
.setRegistryName(NPC_ID.toString());
.setRegistryName(NPC_ID.toString());*/
}
}
57 changes: 0 additions & 57 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,60 +27,3 @@ mandatory = true
versionRange = "[1.18,)"
ordering = "NONE"
side = "SERVER"

# C2B Lib
modLoader = "javafml"
loaderVersion = "[37,)"
license = "LGPL-v3.0"

[[mods]]
modId = "config2brigadier"
version = "${c2b_version}"
displayName = "Config to Brigadier"
authors = "samo_lego"
description = '''
A library to automagically generate in-game command for config editing.
'''

[[dependencies.config2brigadier]]
modId = "forge"
mandatory = true
versionRange = "[37,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.config2brigadier]]
modId = "minecraft"
mandatory = true
versionRange = "[1.17.1,)"
ordering = "NONE"
side = "BOTH"

# Forgified SGUI
modLoader = "javafml"
loaderVersion = "[35,)"
license = "LGPL-v3.0"

[[mods]]
modId = "sgui"
version = "${sgui_version}"
displayName = "Server GUI lib"
authors = "patbox"
contributors="aws404, samo_lego"
description = '''
Library for creating server side guis!
'''

[[dependencies.sgui]]
modId = "forge"
mandatory = true
versionRange = "[35,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.sgui]]
modId = "minecraft"
mandatory = true
versionRange = "[1.17.1,)"
ordering = "NONE"
side = "BOTH"
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
minecraft_version=1.18.2-pre2
yarn_mappings=1.18.2-pre2+build.7
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.2
loader_version=0.13.3

#Fabric api
fabric_version=0.47.6+1.18.2
fabric_version=0.48.0+1.18.2

#Forge
forge_version=39.0.10
forge_version=40.0.19

# Mod Properties
mod_version = 1.8.4
Expand All @@ -20,4 +20,4 @@ archives_base_name = taterzens
# Dependencies
disguiselib_version = 1.2.1
c2b_version = 1.1.1
sgui_version = 1.0.0-rc5+1.18+pre5
sgui_version = 1.0.0+1.18.1
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pluginManagement {

include("common")
include("fabric")
//include("forge")
include("forge")

0 comments on commit bb7c844

Please sign in to comment.