Skip to content

Commit

Permalink
feat: update to mc 1.18.1
Browse files Browse the repository at this point in the history
Signed-off-by: AlasDiablo <[email protected]>
  • Loading branch information
AlasDiablo committed Dec 18, 2021
1 parent 9df0ddb commit 92527a0
Show file tree
Hide file tree
Showing 22 changed files with 428 additions and 461 deletions.
92 changes: 65 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,53 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

def build_number = '77'
// ***************************************** //
// //
// Standard versioning system //
// //
// ***************************************** //
def majorVersion = 7
def minorVersion = 2
def buildVersion = 77
def isExperimental = true
version = "6.7.2.${build_number}"
version = "${majorVersion}.${minorVersion}.${buildVersion}"
if (isExperimental) {
version += '-experimental'
}

// ***************************************** //
// //
// Janoeo versioning system //
// //
// ***************************************** //
def isJanoeo = true
def janoeoProjectVersion = 6
if (isJanoeo) {
version = "${janoeoProjectVersion}.${version}"
}

group = 'fr.alasdiablo.janoeo.foundation'
archivesBaseName = 'Janoeo Foundation'

java.toolchain.languageVersion = JavaLanguageVersion.of(16)
def manifestAttributes = [
"Specification-Title" : "Janoeo Foundation",
"Specification-Vendor" : "AlasDiablo, Safyrus",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "AlasDiablo, Safyrus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
]

def outputFolder = file(rootProject.getRootDir().getPath() + '/output')

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

def deobfSourceClassifier

minecraft {
mappings channel: 'official', version: '1.17.1'
mappings channel: 'official', version: '1.18.1'
deobfSourceClassifier = getMappings().get()
runs {
client {
workingDirectory project.file('run')
Expand Down Expand Up @@ -68,33 +102,37 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.17.1-37.0.110'
implementation fg.deobf("curse.maven:diabololib-422014:3536336") // Diabolo Lib
// Compatibility check with mod
implementation fg.deobf("curse.maven:jei-238222:3438501") // JEI
implementation fg.deobf("curse.maven:jeresources-240630:3489131")
implementation fg.deobf("curse.maven:biomes-o-plenty-220318:3399675") // Biomes O' Plenty
implementation fg.deobf("curse.maven:catalogue-459701:3399552") // Catalogue
implementation fg.deobf("curse.maven:jade-324717:3439658") // Jade 🔍
// implementation fg.deobf("curse.maven:infinitylib-251396:3367362") // InfinityLib
// implementation fg.deobf("curse.maven:agricraft-225635:3379947") // Agricraft
// implementation fg.deobf("curse.maven:mantle-74924:3389377") // Mantle
// implementation fg.deobf("curse.maven:tinkers-construct-74072:3389395") // Tinkers Construct 3
// implementation fg.deobf("curse.maven:iron-chests-228756:3105315") // Iron Chests
minecraft 'net.minecraftforge:forge:1.18.1-39.0.5'
implementation 'curse.maven:diabololib-422014:3571204' // DiaboloLib
implementation fg.deobf('curse.maven:catalogue-459701:3559402') // Catalogue
implementation fg.deobf('curse.maven:jei-238222:3569553') // JEI
implementation fg.deobf('curse.maven:jer-240630:3562195') // JER
}

jar {
manifest.attributes([
"Specification-Title" : "Janoeo Foundation",
"Specification-Vendor" : "AlasDiablo, lIotaMiu, Safyrus",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" :"AlasDiablo, lIotaMiu, Safyrus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])

manifest.attributes(manifestAttributes)
destinationDirectory.set(file(rootProject.getRootDir().getPath() + '/output'))
}

jar.finalizedBy('reobfJar')

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
def archiveName = 'sources-' + deobfSourceClassifier
archiveClassifier.set(archiveName)
destinationDirectory.set(outputFolder)
}

task deobfJar(type: Jar) {
from sourceSets.main.output
def archiveName = 'deobf-' + deobfSourceClassifier
archiveClassifier.set(archiveName)
manifest.attributes(manifestAttributes)
destinationDirectory.set(outputFolder)
}

artifacts {
archives jar
archives sourcesJar
archives deobfJar
}
13 changes: 7 additions & 6 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## Summary

<details><summary><b>1.17.1</b></summary>
<details><summary><b>1.18.1</b></summary>

+ [6.7.2.77](#67277)

</details>

<details><summary><b>1.17.1</b></summary>

+ [6.6.2.76-experimental](#66276-experimental)
+ [6.6.1.74-experimental](#66174-experimental)
+ [6.6.0.73-experimental](#66073-experimental)
Expand Down Expand Up @@ -110,11 +115,7 @@

#### Update

+ forge from 37.0.33 to 37.0.45

#### Add

[...]
+ port mod to mc 1.18.1

### 6.6.2.76-experimental

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 6 additions & 7 deletions src/main/java/fr/alasdiablo/janoeo/foundation/Foundation.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package fr.alasdiablo.janoeo.foundation;

import fr.alasdiablo.diolib.gui.GroundItemGroup;
import fr.alasdiablo.diolib.item.GroundCreativeModeTab;
import fr.alasdiablo.janoeo.foundation.compatibility.JERCompat;
import fr.alasdiablo.janoeo.foundation.config.FoundationConfig;
import fr.alasdiablo.janoeo.foundation.data.*;
import fr.alasdiablo.janoeo.foundation.data.language.EnglishProvider;
import fr.alasdiablo.janoeo.foundation.data.language.FrenchProvider;
import fr.alasdiablo.janoeo.foundation.init.FoundationBlocks;
import fr.alasdiablo.janoeo.foundation.init.FoundationGeneration;
import fr.alasdiablo.janoeo.foundation.init.FoundationItems;
import fr.alasdiablo.janoeo.foundation.world.WorldGen;
import fr.alasdiablo.janoeo.foundation.world.gen.FoundationFeatures;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.data.DataGenerator;
import net.minecraft.world.item.CreativeModeTab;
Expand All @@ -18,6 +17,7 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.IEventBus;
Expand All @@ -37,14 +37,14 @@ public class Foundation {

public static final Logger logger = LogManager.getLogger(Registries.MOD_ID);

public static final CreativeModeTab ITEMS_GROUP = new GroundItemGroup("janoeo.foundation.item") {
public static final CreativeModeTab ITEMS_GROUP = new GroundCreativeModeTab("janoeo.foundation.item") {
@Override
public ItemStack makeIcon() {
return new ItemStack(Items.COAL);
}
};

public static final CreativeModeTab BLOCKS_GROUP = new GroundItemGroup("janoeo.foundation.block") {
public static final CreativeModeTab BLOCKS_GROUP = new GroundCreativeModeTab("janoeo.foundation.block") {
@Override
public ItemStack makeIcon() {
return new ItemStack(Blocks.COAL_BLOCK);
Expand Down Expand Up @@ -100,7 +100,6 @@ private void gatherData(GatherDataEvent event) {
}

private void setup(final FMLCommonSetupEvent commonSetupEvent) {
WorldGen.init();
this.initCompat();
}

Expand All @@ -113,7 +112,7 @@ private void initCompat() {
}

private void initFeatures(RegistryEvent.NewRegistry newRegistry) {
FoundationFeatures.init();
MinecraftForge.EVENT_BUS.addListener(FoundationGeneration::onBiomeLoading);
}

public static class Compat {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fr.alasdiablo.janoeo.foundation.block;

import fr.alasdiablo.diolib.generic.ExperienceRarity;
import fr.alasdiablo.diolib.generic.IDropExperience;
import fr.alasdiablo.diolib.block.ExperienceRarity;
import fr.alasdiablo.diolib.block.IDropExperience;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fr.alasdiablo.janoeo.foundation.block;

import fr.alasdiablo.diolib.generic.ExperienceRarity;
import fr.alasdiablo.diolib.generic.IDropExperience;
import fr.alasdiablo.diolib.block.ExperienceRarity;
import fr.alasdiablo.diolib.block.IDropExperience;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.RedStoneOreBlock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class JERCompat {
private static DistributionBase getDistribution(OreConfig config) {
DistributionBase distribution;
switch (config.getPlacement()) {
case "range" -> distribution = new DistributionSquare(
config.getCount(), config.getSize(), 0, config.getRange());
case "triangle" -> distribution = new DistributionTriangular(
(config.getTop() - config.getBottom()) / 2 + config.getBottom(),
config.getTop() - config.getBottom() / 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@

public class FoundationConfig {

public static final OreConfig TINY_COAL_ORE_CONFIG = new OreConfig(Registries.TINY_COAL_ORE, true).placementRange(17, 128, 20);
public static final OreConfig TINY_COPPER_ORE_CONFIG = new OreConfig(Registries.TINY_COPPER_ORE, true).placementUniform(10, 0, 96, 6);
public static final OreConfig TINY_DIAMOND_ORE_CONFIG = new OreConfig(Registries.TINY_DIAMOND_ORE, true).placementRange(8, 16, 4);
public static final OreConfig TINY_EMERALD_ORE_CONFIG = new OreConfig(Registries.TINY_EMERALD_ORE, true).placementUniform(2, 4, 31, 4);
public static final OreConfig TINY_GOLD_ORE_CONFIG = new OreConfig(Registries.TINY_GOLD_ORE, true).placementRange(9, 32, 2);
public static final OreConfig TINY_GOLD_ORE_EXTRA_CONFIG = new OreConfig(Registries.TINY_GOLD_ORE + "_extra", true).placementUniform(9, 32, 80, 20);
public static final OreConfig TINY_IRON_ORE_CONFIG = new OreConfig(Registries.TINY_IRON_ORE, true).placementRange(9, 64, 20);
public static final OreConfig TINY_LAPIS_ORE_CONFIG = new OreConfig(Registries.TINY_LAPIS_ORE, true).placementTriangle(7, 16, 16);
public static final OreConfig TINY_REDSTONE_ORE_CONFIG = new OreConfig(Registries.TINY_REDSTONE_ORE, true).placementRange(8, 16, 8);
public static final OreConfig BAUXITE_ORE_CONFIG = new OreConfig(Registries.BAUXITE_ORE, true).placementRange(10, 96, 6);
public static final OreConfig LEAD_ORE_CONFIG = new OreConfig(Registries.LEAD_ORE, true).placementRange(6, 48, 6);
public static final OreConfig NICKEL_ORE_CONFIG = new OreConfig(Registries.NICKEL_ORE, true).placementRange(6, 32, 4);
public static final OreConfig SILVER_ORE_CONFIG = new OreConfig(Registries.SILVER_ORE, true).placementRange(6, 28, 4);
public static final OreConfig TIN_ORE_CONFIG = new OreConfig(Registries.TIN_ORE, true).placementRange(10, 96, 6);
public static final OreConfig URANIUM_ORE_CONFIG = new OreConfig(Registries.URANIUM_ORE, true).placementRange(6, 28, 4);
public static final OreConfig TINY_BAUXITE_ORE_CONFIG = new OreConfig(Registries.TINY_BAUXITE_ORE, true).placementRange(10, 96, 6);
public static final OreConfig TINY_LEAD_ORE_CONFIG = new OreConfig(Registries.TINY_LEAD_ORE, true).placementRange(6, 48, 6);
public static final OreConfig TINY_NICKEL_ORE_CONFIG = new OreConfig(Registries.TINY_NICKEL_ORE, true).placementRange(6, 32, 4);
public static final OreConfig TINY_SILVER_ORE_CONFIG = new OreConfig(Registries.TINY_SILVER_ORE, true).placementRange(6, 28, 4);
public static final OreConfig TINY_TIN_ORE_CONFIG = new OreConfig(Registries.TINY_TIN_ORE, true).placementRange(10, 96, 6);
public static final OreConfig TINY_URANIUM_ORE_CONFIG = new OreConfig(Registries.TINY_URANIUM_ORE, true).placementRange(6, 28, 4);
private static final JsonConfigBuilder OVERWORLD_ORE_TINY_CONFIG = new JsonConfigBuilder("janoeo", "foundation", "overworld", "tiny");
private static final JsonConfigBuilder OVERWORLD_ORE_CONFIG = new JsonConfigBuilder("janoeo", "foundation", "overworld");
public static final OreConfig TINY_COAL_ORE_CONFIG = new OreConfig(Registries.TINY_COAL_ORE, true).placementUniform(17, -24, 180, 20);
public static final OreConfig TINY_COPPER_ORE_CONFIG = new OreConfig(Registries.TINY_COPPER_ORE, true).placementUniform(10, -16, 112, 6);
public static final OreConfig TINY_DIAMOND_ORE_CONFIG = new OreConfig(Registries.TINY_DIAMOND_ORE, true).placementUniform(8, -24, 16, 4);
public static final OreConfig TINY_EMERALD_ORE_CONFIG = new OreConfig(Registries.TINY_EMERALD_ORE, true).placementUniform(2, 4, 31, 4);
public static final OreConfig TINY_GOLD_ORE_CONFIG = new OreConfig(Registries.TINY_GOLD_ORE, true).placementUniform(9, -64, 32, 2);
public static final OreConfig TINY_GOLD_ORE_EXTRA_CONFIG = new OreConfig(Registries.TINY_GOLD_ORE + "_extra", true).placementUniform(
9, 32, 80, 20);
public static final OreConfig TINY_IRON_ORE_CONFIG = new OreConfig(Registries.TINY_IRON_ORE, true).placementUniform(9, -24, 180, 20);
public static final OreConfig TINY_LAPIS_ORE_CONFIG = new OreConfig(Registries.TINY_LAPIS_ORE, true).placementTriangle(7, 16, 16);
public static final OreConfig TINY_REDSTONE_ORE_CONFIG = new OreConfig(Registries.TINY_REDSTONE_ORE, true).placementUniform(8, -16, 16, 8);
public static final OreConfig BAUXITE_ORE_CONFIG = new OreConfig(Registries.BAUXITE_ORE, true).placementUniform(10, 0, 96, 6);
public static final OreConfig LEAD_ORE_CONFIG = new OreConfig(Registries.LEAD_ORE, true).placementUniform(6, 0, 48, 6);
public static final OreConfig NICKEL_ORE_CONFIG = new OreConfig(Registries.NICKEL_ORE, true).placementUniform(6, 0, 32, 4);
public static final OreConfig SILVER_ORE_CONFIG = new OreConfig(Registries.SILVER_ORE, true).placementUniform(6, -16, 28, 4);
public static final OreConfig TIN_ORE_CONFIG = new OreConfig(Registries.TIN_ORE, true).placementUniform(10, 0, 96, 6);
public static final OreConfig URANIUM_ORE_CONFIG = new OreConfig(Registries.URANIUM_ORE, true).placementUniform(6, -24, 28, 4);
public static final OreConfig TINY_BAUXITE_ORE_CONFIG = new OreConfig(Registries.TINY_BAUXITE_ORE, true).placementUniform(10, 0, 96, 6);
public static final OreConfig TINY_LEAD_ORE_CONFIG = new OreConfig(Registries.TINY_LEAD_ORE, true).placementUniform(6, 0, 48, 6);
public static final OreConfig TINY_NICKEL_ORE_CONFIG = new OreConfig(Registries.TINY_NICKEL_ORE, true).placementUniform(6, 0, 32, 4);
public static final OreConfig TINY_SILVER_ORE_CONFIG = new OreConfig(Registries.TINY_SILVER_ORE, true).placementUniform(6, -16, 28, 4);
public static final OreConfig TINY_TIN_ORE_CONFIG = new OreConfig(Registries.TINY_TIN_ORE, true).placementUniform(10, 0, 96, 6);
public static final OreConfig TINY_URANIUM_ORE_CONFIG = new OreConfig(Registries.TINY_URANIUM_ORE, true).placementUniform(6, -24, 28, 4);
private static final JsonConfigBuilder OVERWORLD_ORE_TINY_CONFIG = new JsonConfigBuilder("janoeo", "foundation", "overworld", "tiny");
private static final JsonConfigBuilder OVERWORLD_ORE_CONFIG = new JsonConfigBuilder("janoeo", "foundation", "overworld");

public static void init() throws IOException {
OVERWORLD_ORE_TINY_CONFIG.add(TINY_COAL_ORE_CONFIG).add(TINY_COPPER_ORE_CONFIG).add(TINY_DIAMOND_ORE_CONFIG).add(TINY_EMERALD_ORE_CONFIG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class OreConfig extends JsonConfig {
private String placement;
private boolean enable;
private int size;
private int range;
private int count;
private int bottom;
private int top;
Expand All @@ -20,20 +19,11 @@ public OreConfig(String name, boolean enable) {
this.enable = enable;
this.placement = "";
this.size = 0;
this.range = 0;
this.count = 0;
this.bottom = 0;
this.top = 0;
}

public OreConfig placementRange(int size, int range, int count) {
this.placement = "range";
this.size = size;
this.range = range;
this.count = count;
return this;
}

public OreConfig placementTriangle(int size, int bottom, int top) {
this.placement = "triangle";
this.size = size;
Expand All @@ -59,17 +49,7 @@ protected void read(final JsonObject json) {
this.placement = type.getAsString();
this.enable = enable.getAsBoolean();
switch (this.placement) {
case "range" -> {
this.size = placement.get("size").getAsInt();
this.range = placement.get("range").getAsInt();
this.count = placement.get("count").getAsInt();
}
case "triangle" -> {
this.size = placement.get("size").getAsInt();
this.bottom = placement.get("bottom").getAsInt();
this.top = placement.get("top").getAsInt();
}
case "uniform" -> {
case "triangle", "uniform" -> {
this.size = placement.get("size").getAsInt();
this.bottom = placement.get("bottom").getAsInt();
this.top = placement.get("top").getAsInt();
Expand All @@ -82,21 +62,12 @@ protected void read(final JsonObject json) {
@Override
protected JsonObject write() {
final JsonObject json = new JsonObject();
json.addProperty("__comment", "Type: ['triangle', 'uniform']");
json.addProperty("type", this.placement);
json.addProperty("enable", this.enable);
final JsonObject placement = new JsonObject();
switch (this.placement) {
case "range" -> {
placement.addProperty("size", this.size);
placement.addProperty("range", this.range);
placement.addProperty("count", this.count);
}
case "triangle" -> {
placement.addProperty("size", this.size);
placement.addProperty("bottom", this.bottom);
placement.addProperty("top", this.top);
}
case "uniform" -> {
case "triangle", "uniform" -> {
placement.addProperty("size", this.size);
placement.addProperty("bottom", this.bottom);
placement.addProperty("top", this.top);
Expand All @@ -112,6 +83,10 @@ protected String getName() {
return this.name;
}

public String name() {
return this.name;
}

public String getPlacement() {
return placement;
}
Expand All @@ -124,10 +99,6 @@ public int getSize() {
return size;
}

public int getRange() {
return range;
}

public int getCount() {
return count;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.alasdiablo.janoeo.foundation.data;

import fr.alasdiablo.diolib.data.DioBlockStateProvider;
import fr.alasdiablo.diolib.data.provider.DioBlockStateProvider;
import net.minecraft.data.DataGenerator;

import java.util.Arrays;
Expand Down
Loading

0 comments on commit 92527a0

Please sign in to comment.