Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Update to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 20, 2023
1 parent 15b7896 commit c2f7a06
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 353 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ eclipse
.metadata
.project
run-data
runs/
365 changes: 147 additions & 218 deletions build.gradle

Large diffs are not rendered by default.

102 changes: 41 additions & 61 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,61 +1,41 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false


## Environment Properties

# The Minecraft version must agree with the Neo version to get a valid artifact
minecraft_version=1.20.1
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=47.1.65
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[47.1,)
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[47,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
#
# | Channel | Version | |
# |-----------|----------------------|--------------------------------------------------------------------------------|
# | official | MCVersion | Official field/method names from Mojang mapping files |
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
#
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
# See more information here: https://github.com/neoforged/NeoForm/blob/main/Mojang.md
#
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
mapping_channel=official
# The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel.
mapping_version=1.20.1


## Mod Properties

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=mo_glass
# The human-readable display name for the mod.
mod_name=Mo Glass
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0-or-later
# The mod version. See https://semver.org/
mod_version=1.7-MC1.20.1-Forge
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=net.wurstclient.glass
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=Alexander01998
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Adds glass stairs and glass slabs to Minecraft.
# Pack version - this changes each minecraft release, in general.
pack_format_number=15
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
#org.gradle.jvmargs=
org.gradle.daemon=false
org.gradle.debug=false

## Environment Properties

# The Minecraft version must agree with the Neo version to get a valid artifact
minecraft_version=1.20.2
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.2,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.2.86
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[20.2,)
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[1,)

## Mod Properties

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=mo_glass
# The human-readable display name for the mod.
mod_name=Mo Glass
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0-or-later
# The mod version. See https://semver.org/
mod_version=1.7-MC1.20.2-NeoForge
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=net.wurstclient.glass
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=Alexander01998
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Adds glass stairs and glass slabs to Minecraft.
# Pack version - this changes each minecraft release, in general.
pack_format_number=18
24 changes: 11 additions & 13 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
14 changes: 7 additions & 7 deletions src/main/java/net/wurstclient/glass/MoGlass.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
package net.wurstclient.glass;

import net.minecraft.world.item.CreativeModeTabs;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.RegistryObject;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.registries.DeferredBlock;

@Mod(MoGlass.MODID)
@Mod.EventBusSubscriber(modid = MoGlass.MODID,
Expand Down Expand Up @@ -45,13 +45,13 @@ public static void onBuildCreativeTabContents(
// stairs
event.accept(MoGlassBlocks.GLASS_STAIRS);
event.accept(MoGlassBlocks.TINTED_GLASS_STAIRS);
for(RegistryObject<StainedGlassStairsBlock> stairs : MoGlassBlocks.STAINED_GLASS_STAIRS)
for(DeferredBlock<StainedGlassStairsBlock> stairs : MoGlassBlocks.STAINED_GLASS_STAIRS)
event.accept(stairs);

// slabs
event.accept(MoGlassBlocks.GLASS_SLAB);
event.accept(MoGlassBlocks.TINTED_GLASS_SLAB);
for(RegistryObject<StainedGlassSlabBlock> slab : MoGlassBlocks.STAINED_GLASS_SLABS)
for(DeferredBlock<StainedGlassSlabBlock> slab : MoGlassBlocks.STAINED_GLASS_SLABS)
event.accept(slab);
}
}
101 changes: 50 additions & 51 deletions src/main/java/net/wurstclient/glass/MoGlassBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;

public enum MoGlassBlocks
{
;

public static final DeferredRegister<Block> BLOCKS =
DeferredRegister.create(ForgeRegistries.BLOCKS, MoGlass.MODID);
public static final DeferredRegister.Blocks BLOCKS =
DeferredRegister.createBlocks(MoGlass.MODID);

public static final DeferredRegister<Item> ITEMS =
DeferredRegister.create(ForgeRegistries.ITEMS, MoGlass.MODID);
public static final DeferredRegister.Items ITEMS =
DeferredRegister.createItems(MoGlass.MODID);

public static final RegistryObject<Block> GLASS_SLAB =
public static final DeferredBlock<Block> GLASS_SLAB =
registerBlock("glass_slab",
() -> new GlassSlabBlock(BlockBehaviour.Properties.of()
.instrument(NoteBlockInstrument.HAT).strength(0.3F)
Expand All @@ -47,7 +46,7 @@ public enum MoGlassBlocks
.isSuffocating(MoGlassBlocks::never)
.isViewBlocking(MoGlassBlocks::never)));

public static final RegistryObject<Block> GLASS_STAIRS =
public static final DeferredBlock<Block> GLASS_STAIRS =
registerBlock("glass_stairs",
() -> new GlassStairsBlock(BlockBehaviour.Properties.of()
.instrument(NoteBlockInstrument.HAT).strength(0.3F)
Expand All @@ -57,7 +56,7 @@ public enum MoGlassBlocks
.isSuffocating(MoGlassBlocks::never)
.isViewBlocking(MoGlassBlocks::never)));

public static final RegistryObject<Block> TINTED_GLASS_SLAB =
public static final DeferredBlock<Block> TINTED_GLASS_SLAB =
registerBlock("tinted_glass_slab",
() -> new TintedGlassSlabBlock(BlockBehaviour.Properties
.copy(Blocks.GLASS).mapColor(MapColor.COLOR_GRAY).noOcclusion()
Expand All @@ -66,7 +65,7 @@ public enum MoGlassBlocks
.isSuffocating(MoGlassBlocks::never)
.isViewBlocking(MoGlassBlocks::never)));

public static final RegistryObject<Block> TINTED_GLASS_STAIRS =
public static final DeferredBlock<Block> TINTED_GLASS_STAIRS =
registerBlock("tinted_glass_stairs",
() -> new TintedGlassStairsBlock(BlockBehaviour.Properties
.copy(Blocks.GLASS).mapColor(MapColor.COLOR_GRAY).noOcclusion()
Expand All @@ -75,93 +74,93 @@ public enum MoGlassBlocks
.isSuffocating(MoGlassBlocks::never)
.isViewBlocking(MoGlassBlocks::never)));

public static final ArrayList<RegistryObject<StainedGlassSlabBlock>> STAINED_GLASS_SLABS =
public static final ArrayList<DeferredBlock<StainedGlassSlabBlock>> STAINED_GLASS_SLABS =
new ArrayList<>();

public static final ArrayList<RegistryObject<StainedGlassStairsBlock>> STAINED_GLASS_STAIRS =
public static final ArrayList<DeferredBlock<StainedGlassStairsBlock>> STAINED_GLASS_STAIRS =
new ArrayList<>();

public static final RegistryObject<StainedGlassSlabBlock> WHITE_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> WHITE_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.WHITE);
public static final RegistryObject<StainedGlassSlabBlock> ORANGE_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> ORANGE_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.ORANGE);
public static final RegistryObject<StainedGlassSlabBlock> MAGENTA_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> MAGENTA_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.MAGENTA);
public static final RegistryObject<StainedGlassSlabBlock> LIGHT_BLUE_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> LIGHT_BLUE_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.LIGHT_BLUE);
public static final RegistryObject<StainedGlassSlabBlock> YELLOW_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> YELLOW_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.YELLOW);
public static final RegistryObject<StainedGlassSlabBlock> LIME_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> LIME_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.LIME);
public static final RegistryObject<StainedGlassSlabBlock> PINK_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> PINK_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.PINK);
public static final RegistryObject<StainedGlassSlabBlock> GRAY_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> GRAY_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.GRAY);
public static final RegistryObject<StainedGlassSlabBlock> LIGHT_GRAY_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> LIGHT_GRAY_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.LIGHT_GRAY);
public static final RegistryObject<StainedGlassSlabBlock> CYAN_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> CYAN_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.CYAN);
public static final RegistryObject<StainedGlassSlabBlock> PURPLE_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> PURPLE_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.PURPLE);
public static final RegistryObject<StainedGlassSlabBlock> BLUE_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> BLUE_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.BLUE);
public static final RegistryObject<StainedGlassSlabBlock> BROWN_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> BROWN_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.BROWN);
public static final RegistryObject<StainedGlassSlabBlock> GREEN_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> GREEN_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.GREEN);
public static final RegistryObject<StainedGlassSlabBlock> RED_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> RED_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.RED);
public static final RegistryObject<StainedGlassSlabBlock> BLACK_STAINED_GLASS_SLAB =
public static final DeferredBlock<StainedGlassSlabBlock> BLACK_STAINED_GLASS_SLAB =
createStainedGlassSlab(DyeColor.BLACK);

public static final RegistryObject<StainedGlassStairsBlock> WHITE_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> WHITE_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.WHITE);
public static final RegistryObject<StainedGlassStairsBlock> ORANGE_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> ORANGE_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.ORANGE);
public static final RegistryObject<StainedGlassStairsBlock> MAGENTA_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> MAGENTA_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.MAGENTA);
public static final RegistryObject<StainedGlassStairsBlock> LIGHT_BLUE_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> LIGHT_BLUE_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.LIGHT_BLUE);
public static final RegistryObject<StainedGlassStairsBlock> YELLOW_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> YELLOW_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.YELLOW);
public static final RegistryObject<StainedGlassStairsBlock> LIME_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> LIME_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.LIME);
public static final RegistryObject<StainedGlassStairsBlock> PINK_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> PINK_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.PINK);
public static final RegistryObject<StainedGlassStairsBlock> GRAY_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> GRAY_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.GRAY);
public static final RegistryObject<StainedGlassStairsBlock> LIGHT_GRAY_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> LIGHT_GRAY_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.LIGHT_GRAY);
public static final RegistryObject<StainedGlassStairsBlock> CYAN_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> CYAN_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.CYAN);
public static final RegistryObject<StainedGlassStairsBlock> PURPLE_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> PURPLE_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.PURPLE);
public static final RegistryObject<StainedGlassStairsBlock> BLUE_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> BLUE_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.BLUE);
public static final RegistryObject<StainedGlassStairsBlock> BROWN_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> BROWN_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.BROWN);
public static final RegistryObject<StainedGlassStairsBlock> GREEN_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> GREEN_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.GREEN);
public static final RegistryObject<StainedGlassStairsBlock> RED_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> RED_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.RED);
public static final RegistryObject<StainedGlassStairsBlock> BLACK_STAINED_GLASS_STAIRS =
public static final DeferredBlock<StainedGlassStairsBlock> BLACK_STAINED_GLASS_STAIRS =
createStainedGlassStairs(DyeColor.BLACK);

private static <T extends Block> RegistryObject<T> registerBlock(
private static <T extends Block> DeferredBlock<T> registerBlock(
String idPath, Supplier<T> block)
{
System.out.println("Registering block & item for mo_glass:" + idPath);
RegistryObject<T> result = BLOCKS.register(idPath, block);
DeferredBlock<T> result = BLOCKS.register(idPath, block);
ITEMS.register(idPath,
() -> new BlockItem(result.get(), new Item.Properties()));

return result;
}

private static RegistryObject<StainedGlassSlabBlock> createStainedGlassSlab(
private static DeferredBlock<StainedGlassSlabBlock> createStainedGlassSlab(
DyeColor color)
{
RegistryObject<StainedGlassSlabBlock> result =
DeferredBlock<StainedGlassSlabBlock> result =
registerBlock(color + "_stained_glass_slab",
() -> new StainedGlassSlabBlock(color,
BlockBehaviour.Properties.of().mapColor(color)
Expand All @@ -176,10 +175,10 @@ private static RegistryObject<StainedGlassSlabBlock> createStainedGlassSlab(
return result;
}

private static RegistryObject<StainedGlassStairsBlock> createStainedGlassStairs(
private static DeferredBlock<StainedGlassStairsBlock> createStainedGlassStairs(
DyeColor color)
{
RegistryObject<StainedGlassStairsBlock> result =
DeferredBlock<StainedGlassStairsBlock> result =
registerBlock(color + "_stained_glass_stairs",
() -> new StainedGlassStairsBlock(color,
BlockBehaviour.Properties.of().mapColor(color)
Expand Down
Loading

0 comments on commit c2f7a06

Please sign in to comment.