Skip to content

Commit

Permalink
Multiple things in this commit as I lost the other commits...
Browse files Browse the repository at this point in the history
Add back Crops, Cotton and Barley return
Perform a clean up to certain registration code
Switch to Mantles registraton of wood objects to make life easier in the long run. (Adds wood, stairs, slabs, planks, signs etc)
  • Loading branch information
Alexander Behrhof committed Jul 13, 2021
1 parent e9d968e commit c64aa71
Show file tree
Hide file tree
Showing 60 changed files with 1,421 additions and 627 deletions.
20 changes: 20 additions & 0 deletions .github/1-16-issue-report.md
@@ -0,0 +1,20 @@
---
name: 1.16 Issue Report
about: Report an issue with the 1.16 version of Minecraft
title: ''
labels: 1.16, Bug, Unreviewed
assignees: ''

---

**Issue description:**

**If crashed, link to crash report (use a site such as pastebin):**

**Versions:**
* Minecraft:
* Forge:
* Mantle:
* Natura:

**Can it be reproduced with *just* Natura? If not, list the other mods *required* to reproduce the issue.**
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

5 changes: 5 additions & 0 deletions .github/config.yml
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: SlimeKnights Discord
url: https://discord.gg/njGrvuh
about: Join our discord to discuss new features or to discuss behavior that may not be a bug.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@ Heyo, Redwood trees! Chop them all day long~

## Setting up a Workspace/Compiling from Source
Note: Git MUST be installed and in the system path to use our scripts.
* Setup: Run [gradle]in the repository root: `gradlew[.bat] [setupDevWorkspace|setupDecompWorkspace] [eclipse|idea]`
* Setup: Run [gradle]in the repository root: `gradlew[.bat] [eclipse]` or import build.gradle into intellij
* Build: Run [gradle]in the repository root: `gradlew[.bat] build`
* If obscure Gradle issues are found try running `gradlew clean` and `gradlew cleanCache`

Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Expand Up @@ -9,10 +9,11 @@

buildscript {
repositories {
maven { url = 'https://libraries.minecraft.net/' }
mavenCentral()
maven { url = 'https://maven.minecraftforge.net/' }
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
Expand All @@ -22,7 +23,7 @@ buildscript {
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.0.9', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.7', changing: true
classpath "io.freefair.gradle:lombok-plugin:4.+"
}
}
Expand All @@ -34,11 +35,10 @@ apply plugin: 'maven-publish'
apply plugin: "io.freefair.lombok"

repositories {
maven { url = 'https://libraries.minecraft.net/' }
mavenCentral()
maven { url = 'https://maven.minecraftforge.net/' }
mavenLocal()
maven { // Forge
name 'ForgeFS'
url 'https://files.minecraftforge.net/maven'
}
maven { // Mantle and JEI
name 'DVS1 Maven FS'
url 'https://dvs1.progwml6.com/files/maven'
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Expand Up @@ -10,14 +10,14 @@ minecraft_version=1.16.5
minecraft_range=[1.16.5,1.17)

# Forge Version Information
forge_version=36.1.6
forge_version=36.1.32
mappings_version=20210309-1.16.5
loader_range=[33.0,)
forge_range=[36.1.0,)

# Build Dependencies
mantle_version=1.6.92
mantle_range=[1.6.92,)
tconstruct_version=3.0.3.112
jei_version=1.16.5:7.6.4.+
mantle_version=1.6.115
mantle_range=[1.6.114,)
tconstruct_version=3.0.4.227
jei_version=1.16.5:7.7.0.+
probe_version=1.16-3.0.7-13
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
2 changes: 1 addition & 1 deletion gradlew
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Expand Up @@ -16,4 +16,4 @@ include 'api'
include 'services:webservice'
*/

rootProject.name = 'natura'
rootProject.name = 'Natura'
@@ -0,0 +1,66 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:block_state_property",
"block": "natura:cotton_crop",
"properties": {
"age": "4"
}
}
],
"name": "natura:cotton"
},
{
"type": "minecraft:item",
"name": "natura:cotton_crop"
}
]
}
]
},
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"parameters": {
"extra": 3,
"probability": 0.5714286
}
}
],
"name": "natura:cotton_crop"
}
],
"conditions": [
{
"condition": "minecraft:block_state_property",
"block": "natura:cotton_crop",
"properties": {
"age": "4"
}
}
]
}
],
"functions": [
{
"function": "minecraft:explosion_decay"
}
]
}
53 changes: 40 additions & 13 deletions src/main/java/com/progwml6/natura/Natura.java
Expand Up @@ -2,11 +2,10 @@

import com.progwml6.natura.common.NaturaModule;
import com.progwml6.natura.common.config.Config;
import com.progwml6.natura.common.data.tags.NaturaBlockTagsProvider;
import com.progwml6.natura.common.data.tags.NaturaItemTagsProvider;
import com.progwml6.natura.common.data.tags.BlockTagProvider;
import com.progwml6.natura.common.data.tags.ItemTagProvider;
import com.progwml6.natura.common.data.loot.NaturaLootTableProvider;
import com.progwml6.natura.gadgets.NaturaGadgets;
import com.progwml6.natura.library.Util;
import com.progwml6.natura.shared.NaturaCommons;
import com.progwml6.natura.world.NaturaStructures;
import com.progwml6.natura.world.NaturaWorld;
Expand All @@ -16,6 +15,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.IEventBus;
Expand All @@ -30,17 +30,17 @@
import slimeknights.mantle.registration.RegistrationHelper;

import javax.annotation.Nullable;
import java.util.Locale;
import java.util.Random;

@SuppressWarnings("unused")
@Mod(Natura.modID)
@Mod(Natura.MOD_ID)
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class Natura {

public static final String modID = Util.MODID;
public static final Logger log = LogManager.getLogger(modID);

public static final Random random = new Random();
public static final String MOD_ID = "natura";
public static final Logger LOG = LogManager.getLogger(MOD_ID);
public static final Random RANDOM = new Random();

/* Instance of this mod, used for grabbing prototype fields */
public static Natura instance;
Expand Down Expand Up @@ -76,18 +76,18 @@ static void gatherData(final GatherDataEvent event) {
if (event.includeServer()) {
DataGenerator datagenerator = event.getGenerator();
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
NaturaBlockTagsProvider blockTags = new NaturaBlockTagsProvider(datagenerator, existingFileHelper);
BlockTagProvider blockTags = new BlockTagProvider(datagenerator, existingFileHelper);

datagenerator.addProvider(blockTags);
datagenerator.addProvider(new NaturaItemTagsProvider(datagenerator, blockTags, existingFileHelper));
datagenerator.addProvider(new ItemTagProvider(datagenerator, blockTags, existingFileHelper));
datagenerator.addProvider(new NaturaLootTableProvider(datagenerator));
}
}

@SubscribeEvent
static void configChanged(final ModConfig.ModConfigEvent configEvent) {
ModConfig config = configEvent.getConfig();
if (config.getModId().equals(modID)) {
if (config.getModId().equals(MOD_ID)) {
Config.clearCache(config.getSpec());
if (config.getSpec() == Config.SERVER_SPEC) {
configLoaded = true;
Expand All @@ -102,7 +102,7 @@ private static Block missingBlock(String name) {

@SubscribeEvent
void missingItems(final RegistryEvent.MissingMappings<Item> event) {
RegistrationHelper.handleMissingMappings(event, modID, name -> {
RegistrationHelper.handleMissingMappings(event, MOD_ID, name -> {
switch (name) {
case "bonemeal_bag":
return NaturaCommons.boneMealBag.get();
Expand All @@ -116,6 +116,33 @@ void missingItems(final RegistryEvent.MissingMappings<Item> event) {

@SubscribeEvent
void missingBlocks(final RegistryEvent.MissingMappings<Block> event) {
RegistrationHelper.handleMissingMappings(event, modID, Natura::missingBlock);
RegistrationHelper.handleMissingMappings(event, MOD_ID, Natura::missingBlock);
}

/* Utils */

/**
* Gets a resource location for Natura
* @param name Resource path
* @return Location for tinkers
*/
public static ResourceLocation getResource(String name) {
return new ResourceLocation(MOD_ID, name);
}

/**
* Returns the given Resource prefixed with natura resource location. Use this function instead of hardcoding
* resource locations.
*/
public static String resourceString(String res) {
return String.format("%s:%s", MOD_ID, res);
}

/**
* Prefixes the given unlocalized name with natura prefix. Use this when passing unlocalized names for a uniform
* namespace.
*/
public static String prefix(String name) {
return String.format("%s.%s", MOD_ID, name.toLowerCase(Locale.US));
}
}
30 changes: 10 additions & 20 deletions src/main/java/com/progwml6/natura/common/NaturaModule.java
Expand Up @@ -36,12 +36,12 @@
public abstract class NaturaModule {

// deferred register instances
protected static final BlockDeferredRegister BLOCKS = new BlockDeferredRegister(Natura.modID);
protected static final ItemDeferredRegister ITEMS = new ItemDeferredRegister(Natura.modID);
protected static final EntityTypeDeferredRegister ENTITIES = new EntityTypeDeferredRegister(Natura.modID);
protected static final DeferredRegister<Feature<?>> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, Natura.modID);
protected static final DeferredRegister<Structure<?>> STRUCTURE_FEATURES = DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, Natura.modID);
protected static final DeferredRegister<BlockStateProviderType<?>> BLOCK_STATE_PROVIDER_TYPES = DeferredRegister.create(ForgeRegistries.BLOCK_STATE_PROVIDER_TYPES, Natura.modID);
protected static final BlockDeferredRegister BLOCKS = new BlockDeferredRegister(Natura.MOD_ID);
protected static final ItemDeferredRegister ITEMS = new ItemDeferredRegister(Natura.MOD_ID);
protected static final EntityTypeDeferredRegister ENTITIES = new EntityTypeDeferredRegister(Natura.MOD_ID);
protected static final DeferredRegister<Feature<?>> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, Natura.MOD_ID);
protected static final DeferredRegister<Structure<?>> STRUCTURE_FEATURES = DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, Natura.MOD_ID);
protected static final DeferredRegister<BlockStateProviderType<?>> BLOCK_STATE_PROVIDER_TYPES = DeferredRegister.create(ForgeRegistries.BLOCK_STATE_PROVIDER_TYPES, Natura.MOD_ID);

// base block properties
protected static final Block.Properties GENERIC_SAND_BLOCK = builder(Material.SAND, ToolType.SHOVEL, SoundType.SAND).hardnessAndResistance(3.0f).slipperiness(0.8F);
Expand All @@ -52,7 +52,7 @@ public abstract class NaturaModule {
* Creative tab for items that do not fit in another tab
*/
@SuppressWarnings("WeakerAccess")
public static final ItemGroup TAB_GENERAL = new SupplierItemGroup(Natura.modID, "general", () -> new ItemStack(NaturaGadgets.stoneStick));
public static final ItemGroup TAB_GENERAL = new SupplierItemGroup(Natura.MOD_ID, "general", () -> new ItemStack(NaturaGadgets.stoneStick));

// base item properties
protected static final Item.Properties GENERAL_PROPS = new Item.Properties().group(TAB_GENERAL);
Expand Down Expand Up @@ -92,20 +92,10 @@ protected static Block.Properties builder(Material material, @Nullable ToolType
/**
* Creates a Natura resource location
*
* @param id Resource path
* @param poth Resource path
* @return Natura resource location
*/
protected static ResourceLocation location(String id) {
return new ResourceLocation(Natura.modID, id);
}

/**
* Creates a Natura resource location string
*
* @param id Resource path
* @return Natura resource location string
*/
protected static String locationString(String id) {
return Natura.modID + ":" + id;
protected static ResourceLocation resource(String path) {
return Natura.getResource(path);
}
}

0 comments on commit c64aa71

Please sign in to comment.