Skip to content

Commit

Permalink
Updated NeoForge to stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Jul 31, 2024
1 parent f51bb09 commit 6931df5
Show file tree
Hide file tree
Showing 22 changed files with 675 additions and 95 deletions.
7 changes: 2 additions & 5 deletions TEMPLATE_LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
MIT License

Copyright (c) 2023 NeoForged project

This license applies to the template files as supplied by github.com/NeoForged/MDK

Copyright (c) 2024 Starexify

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
33 changes: 10 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@

Installation information
=======
<p align="center"><img width=85% src="https://raw.githubusercontent.com/Starexify/Cosmicore/1.21/src/main/resources/cosmicore_logo.png?token=GHSAT0AAAAAACTBPAKN3YXSWJCRIDHMQOYSZVHL2QA"></p>

This template repository can be directly cloned to get you started with a new
mod. Simply create a new repository cloned from this one, by following the
instructions at [github](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
<p align="center">
<a href="https://minecraft.curseforge.com/projects/cosmicore"><img alt="curseforge" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/curseforge_vector.svg"></a>
<a href="https://modrinth.com/mod/cosmicore"><img alt="modrinth" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg"></a>
</p>

Once you have your clone, simply open the repository in the IDE of your choice. The usual recommendation for an IDE is either IntelliJ IDEA or Eclipse.
<p align="center">
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/Starexify/Cosmicore?style=for-the-badge&color=1B3193&link=https%3A%2F%2Fgithub.com%2FStarexify%2FCosmicore%2Fissues">
<img alt="GitHub License" src="https://img.shields.io/github/license/Starexify/Cosmicore?style=for-the-badge&color=1B3193&link=https%3A%2F%2Fgithub.com%2FStarexify%2FCosmicore%2Fblob%2F1.21%2FLICENSE">
</p>

> **Note**: For Eclipse, use tasks in `Launch Group` instead of ones founds in `Java Application`. A preparation task must run before launching the game. NeoGradle uses launch groups to do these subsequently.
If at any point you are missing libraries in your IDE, or you've run into problems you can
run `gradlew --refresh-dependencies` to refresh the local cache. `gradlew clean` to reset everything
{this does not affect your code} and then start the process again.

Mapping Names:
============
By default, the MDK is configured to use the official mapping names from Mojang for methods and fields
in the Minecraft codebase. These names are covered by a specific license. All modders should be aware of this
license. For the latest license text, refer to the mapping file itself, or the reference copy here:
https://github.com/NeoForged/NeoForm/blob/main/Mojang.md

Additional Resources:
==========
Community Documentation: https://docs.neoforged.net/
NeoForged Discord: https://discord.neoforged.net/
<p align="center"><a href="https://minecraft.curseforge.com/projects/cosmicore"><img alt="CurseForge Downloads" src="http://cf.way2muchnoise.eu/full_cosmicore_downloads.svg?badge_style=flat"></a></p>
14 changes: 6 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
org.gradle.jvmargs=-Xmx2G
org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=false
org.gradle.debug=false

#read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
neogradle.subsystems.parchment.minecraftVersion=1.20.6
neogradle.subsystems.parchment.mappingsVersion=2024.05.01
neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.07.28
# Environment Properties
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
# The Minecraft version must agree with the Neo version to get a valid artifact
Expand All @@ -16,7 +16,7 @@ minecraft_version=1.21
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.21,1.21.1)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.0-beta
neo_version=21.0.146
# The Neo version range can use any version of Neo as bounds
neo_version_range=[21.0.0-beta,)
# The loader version range can only use the major version of FML as bounds
Expand All @@ -27,9 +27,7 @@ loader_version_range=[4,)
mod_id=mystic_shrubs
mod_name=Mystic Shrubs
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=0.1-1.21
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_version=1.0.0
mod_group_id=net.nova.mysticshrubs
mod_authors=ImVeryBad
mod_description=Bringing back the nostalgia
mod_description=Bringing back the nostalgia
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"type": "minecraft:block",
"functions": [
{
"function": "minecraft:explosion_decay"
}
],
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"block": "mystic_shrubs:mystic_shrub",
"condition": "minecraft:block_state_property",
"properties": {
"age": "1"
}
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.25,
"condition": "minecraft:random_chance"
}
],
"name": "mystic_shrubs:heart_drop"
},
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.6,
"condition": "minecraft:random_chance"
}
],
"name": "mystic_shrubs:emerald_shard"
},
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.7,
"condition": "minecraft:random_chance"
}
],
"name": "minecraft:arrow",
"weight": 2
}
],
"rolls": 1.0
}
],
"random_sequence": "mystic_shrubs:blocks/mystic_shrub"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"biomes": "#c:is_plains",
"features": "mystic_shrubs:mystic_shrub_placed",
"step": "vegetal_decoration"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:random_patch",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "mystic_shrubs:mystic_shrub",
"Properties": {
"age": "1"
}
}
}
}
},
"placement": [
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
}
]
},
"tries": 8,
"xz_spread": 4,
"y_spread": 3
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"feature": "mystic_shrubs:mystic_shrub",
"placement": [
{
"type": "minecraft:count",
"count": 3
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
32 changes: 22 additions & 10 deletions src/main/java/net/nova/mysticshrubs/MysticShrubs.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package net.nova.mysticshrubs;

import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Items;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.*;
import net.nova.mysticshrubs.init.ModBlocks;
import net.nova.mysticshrubs.init.ModItems;
import net.nova.mysticshrubs.init.ModSounds;
Expand All @@ -28,14 +26,28 @@ public MysticShrubs(IEventBus bus) {
bus.addListener(this::addCreative);
}

// Add items to the vanilla creative tabs
private void addCreative(BuildCreativeModeTabContentsEvent event) {
final ResourceKey<CreativeModeTab> tab = event.getTabKey();
if (tab.equals(CreativeModeTabs.INGREDIENTS)) {
event.getEntries().putAfter(Items.EMERALD.getDefaultInstance(), ModItems.EMERALD_PIECE.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
event.getEntries().putAfter(ModItems.EMERALD_PIECE.get().getDefaultInstance(), ModItems.EMERALD_SHARD.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
if (event.getTabKey().equals(CreativeModeTabs.INGREDIENTS)) {
event.getEntries().putAfter(keyToPutAfter(event, Items.EMERALD), ModItems.EMERALD_PIECE.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
event.getEntries().putAfter(keyToPutAfter(event, ModItems.EMERALD_PIECE.get()), ModItems.EMERALD_SHARD.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
}
if (tab.equals(CreativeModeTabs.NATURAL_BLOCKS)) {
event.getEntries().putAfter(Items.NETHER_WART.getDefaultInstance(), ModItems.MYSTICAL_SEED.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
if (event.getTabKey().equals(CreativeModeTabs.NATURAL_BLOCKS)) {
event.getEntries().putAfter(keyToPutAfter(event, Items.NETHER_WART), ModItems.MYSTICAL_SEED.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
}
}

private ItemStack keyToPutAfter(BuildCreativeModeTabContentsEvent event, Item item) {
for (var iter = event.getEntries().iterator(); iter.hasNext(); ) {
var stack = iter.next();
if (stack.getKey().getItem() == item) {
return stack.getKey();
}
}
return null;
}

public static ResourceLocation rl(String path) {
return ResourceLocation.fromNamespaceAndPath(MODID, path);
}
}
Loading

0 comments on commit 6931df5

Please sign in to comment.