summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorSizableShrimp <sizableshrimp@sizableshrimp.me>2022-11-22 13:32:47 -0600
committerSizableShrimp <sizableshrimp@sizableshrimp.me>2022-12-08 01:45:22 -0600
commitd2f2e9451193cff9298af470301b99214cfac6ce (patch)
tree5974c3fef2b0229aa3e26346888dd465a1fff24e /src/main
parentdce91156092d972859ac430b5f68233e524ea0b0 (diff)
Forge 1.19.3
Created a CreativeModeTabEvent to register creative mode tabs and populate entries per tab Moved datapack registries to DataPackRegistryEvent.NewRegistry event instead of tying them to ForgeRegistry Made it easier for mods to datagen datapack builtin entries with DatapackBuiltinEntriesProvider Provided access to lookupProvider for datagen Updated dependencies to match versions used by vanilla and update JarJar to 0.3.18 Added a test mod for the new CreativeModeTabEvent Throws better error message for Forge registries in tag datagen Deleted ForgeRegistryTagsProvider Updated ClientChatReceivedEvent and ServerChatEvent for Mojang changes Added patches for both sign related methods in ModelLayers Changed RegisterShadersEvent to use ResourceProvider Migrated old Mojang math types to JOML Co-authored-by: Marc Hermans <marc.hermans@ldtteam.com> Co-authored-by: LexManos <LexManos@gmail.com> Co-authored-by: sciwhiz12 <arnoldnunag12@gmail.com> Co-authored-by: coehlrich <coehlrich@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/example/examplemod/ExampleMod.java14
-rw-r--r--src/main/resources/pack.mcmeta4
2 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java
index 803db87..e4013ff 100644
--- a/src/main/java/com/example/examplemod/ExampleMod.java
+++ b/src/main/java/com/example/examplemod/ExampleMod.java
@@ -3,7 +3,7 @@ package com.example.examplemod;
import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.world.item.BlockItem;
-import net.minecraft.world.item.CreativeModeTab;
+import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
@@ -11,15 +11,13 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.CreativeModeTabEvent;
+import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
-import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
-import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
-import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
@@ -42,7 +40,7 @@ public class ExampleMod
// Creates a new Block with the id "examplemod:example_block", combining the namespace and path
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of(Material.STONE)));
// Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path
- public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_BUILDING_BLOCKS)));
+ public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties()));
public ExampleMod()
{
@@ -58,6 +56,10 @@ public class ExampleMod
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
+
+ // Register the item to a creative tab
+ modEventBus.addListener((CreativeModeTabEvent.BuildContents event) -> event.registerSimple(CreativeModeTabs.BUILDING_BLOCKS,
+ EXAMPLE_BLOCK_ITEM.get()));
}
private void commonSetup(final FMLCommonSetupEvent event)
diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta
index b643e13..aa7bb5d 100644
--- a/src/main/resources/pack.mcmeta
+++ b/src/main/resources/pack.mcmeta
@@ -1,8 +1,8 @@
{
"pack": {
"description": "examplemod resources",
- "pack_format": 9,
- "forge:resource_pack_format": 9,
+ "pack_format": 12,
+ "forge:resource_pack_format": 12,
"forge:data_pack_format": 10
}
}