Skip to content

Commit

Permalink
Merge pull request #22 from GamingCrew69/1.20.1
Browse files Browse the repository at this point in the history
Update to 1.20.1
  • Loading branch information
Quizer9O8 authored Dec 25, 2023
2 parents 9b7ed5e + 21a515c commit 7a6744f
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 234 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.19.4-1.3.1'
version = '1.20.1-1.3.1'
group = 'com.quizer9o8.strata' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'strata'

Expand All @@ -35,7 +35,7 @@ minecraft {
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.4'
mappings channel: 'official', version: '1.20.1'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

Expand Down Expand Up @@ -128,7 +128,7 @@ dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.19.4-45.2.0'
minecraft 'net.minecraftforge:forge:1.20.1-47.2.0'

// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
Expand Down
36 changes: 21 additions & 15 deletions src/main/java/com/quizer9o8/strata/CreativeTabs.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
package com.quizer9o8.strata;

import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import static com.quizer9o8.strata.list.BlockList.*;

@Mod.EventBusSubscriber(modid = Strata.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class CreativeTabs {
public static CreativeModeTab IGNEOUS_TAB;
public static CreativeModeTab METAMORPHIC_TAB;
public static CreativeModeTab SEDIMENTARY_TAB;
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Strata.MOD_ID);

//This registers the Creative tabs
@SubscribeEvent
public static void registerCreativeModeTabs(CreativeModeTabEvent.Register event) {
IGNEOUS_TAB = event.registerCreativeModeTab(new ResourceLocation(Strata.MOD_ID, "igneous"), builder -> builder
public static final RegistryObject<CreativeModeTab>
IGNEOUS_TAB = CREATIVE_MODE_TABS.register("igneous", ()-> CreativeModeTab.builder()
.icon(() -> new ItemStack(AA.get()))
.title(Component.translatable("itemGroup.igneous"))
.displayItems((featureFlags, output) -> {
Expand Down Expand Up @@ -374,8 +373,10 @@ public static void registerCreativeModeTabs(CreativeModeTabEvent.Register event)
output.accept(POLISHED_PHONOLITE_SLAB.get());
output.accept(POLISHED_PHONOLITE_STAIRS.get());
})
);
METAMORPHIC_TAB = event.registerCreativeModeTab(new ResourceLocation(Strata.MOD_ID, "metamorphic"), builder -> builder
.build());

public static final RegistryObject<CreativeModeTab>
METAMORPHIC_TAB = CREATIVE_MODE_TABS.register("metamorphic", ()-> CreativeModeTab.builder()
.icon(() -> new ItemStack(AMPHIBOLITE.get()))
.title(Component.translatable("itemGroup.metamorphic"))
.displayItems((featureFlags, output) -> {
Expand Down Expand Up @@ -770,8 +771,10 @@ public static void registerCreativeModeTabs(CreativeModeTabEvent.Register event)
output.accept(POLISHED_SOAPSTONE_SLAB.get());
output.accept(POLISHED_SOAPSTONE_STAIRS.get());
})
);
SEDIMENTARY_TAB = event.registerCreativeModeTab(new ResourceLocation(Strata.MOD_ID, "sedimentary"), builder -> builder
.build());

public static final RegistryObject<CreativeModeTab>
SEDIMENTARY_TAB = CREATIVE_MODE_TABS.register("sedimentary", ()-> CreativeModeTab.builder()
.icon(() -> new ItemStack(LIMESTONE.get()))
.title(Component.translatable("itemGroup.sedimentary"))
.displayItems((featureFlags, output) -> {
Expand Down Expand Up @@ -1166,6 +1169,9 @@ public static void registerCreativeModeTabs(CreativeModeTabEvent.Register event)
output.accept(POLISHED_SHALE_SLAB.get());
output.accept(POLISHED_SHALE_STAIRS.get());
})
);
.build());

public static void register(IEventBus eventBus) {
CREATIVE_MODE_TABS.register(eventBus);
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/quizer9o8/strata/Strata.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public Strata()

modEventBus.addListener(this::clientSetup);

CreativeTabs.register(modEventBus);

BlockList.BLOCKS.register(modEventBus);
ItemList.ITEMS.register(modEventBus);
}
Expand Down
Loading

0 comments on commit 7a6744f

Please sign in to comment.