Skip to content

Commit

Permalink
Update to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Behrhof committed May 17, 2022
1 parent 9b215c5 commit b85d869
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 51 deletions.
84 changes: 52 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,36 @@ buildscript {
repositories {
mavenLocal()
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://libraries.minecraft.net/' }
mavenCentral()
jcenter()
maven {
name "Parchment"
url "https://maven.parchmentmc.org"
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.parchmentmc:librarian:1.+'
}
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.parchmentmc.librarian.forgegradle'

repositories {
mavenCentral()
mavenLocal()
maven { // Vanilla
name 'Vanilla'
url 'https://libraries.minecraft.net/'
}
maven { // Forge
name 'ForgeFS'
url 'https://maven.minecraftforge.net/'
}
maven {
name 'DVS1 Maven FS'
url 'https://dvs1.progwml6.com/files/maven'
Expand All @@ -26,8 +43,37 @@ group = "com.progwml6.ironchest"
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

task buildInfo {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
proc.waitFor()
if (proc.exitValue() == 0) {
ext.revision = proc.text.trim()
} else {
ext.revision = "GITBORK"
}

if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "DEV.${project.buildInfo.revision}"
}
}

version = "${minecraft_version}-${mod_version}.${project.buildInfo.buildNum}"

sourceSets {
main {
resources {
srcDirs "src/generated/resources"
//But exclude the cache of the generated data from what gets built
exclude '.cache'
}
}
}

minecraft {
mappings channel: 'official', version: mappings_version
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

Expand Down Expand Up @@ -97,6 +143,9 @@ minecraft {
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', '{assets_root}'

args '--mod', 'ironchest', '--all', '--output', file('src/generated/resources/')

mods {
Expand All @@ -108,42 +157,13 @@ minecraft {
}
}

task buildInfo {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
proc.waitFor()
if (proc.exitValue() == 0) {
ext.revision = proc.text.trim()
} else {
ext.revision = "GITBORK"
}

if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "DEV.${project.buildInfo.revision}"
}
}

version = "${minecraft_version}-${mod_version}.${project.buildInfo.buildNum}"

sourceSets {
main {
resources {
srcDirs "src/generated/resources"
//But exclude the cache of the generated data from what gets built
exclude '.cache'
}
}
}

dependencies {
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version

// compile against the JEI API but do not include it at runtime
//compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
// at runtime, use the full JEI jar
//runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
}

def modsTomlSpec = copySpec{
Expand Down
18 changes: 10 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Mod Version Information
mod_version=13.0
mod_version=13.1

# Minecraft Version Information
minecraft_version=1.18
minecraft_range=[1.18,1.19)
minecraft_base_version=1.18
minecraft_version=1.18.2
minecraft_range=[1.18.2,1.19)

# Forge Version Information
loader_range=[38,)
forge_version=38.0.10
forge_range=[38.0.10,)
forge_version=40.1.16
loader_range=[39.0,)
forge_range=[40.1.16,)
parchment_version=2022.03.13

# Mappings Information
mappings_version=1.18
mappings_version=1.18.2

# Build dependencies
jei_version=1.16.4:7.6.1.65
jei_version=9.5.3.153
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion src/main/java/com/progwml6/ironchest/IronChests.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public IronChests() {
modBus.addListener(this::setup);
modBus.addListener(this::gatherData);

DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
// Client setup
modBus.addListener(this::setupClient);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.ItemLike;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.Tags;
Expand All @@ -30,7 +31,7 @@

public class IronChestsRecipeProvider extends RecipeProvider implements IConditionBuilder {

public static final Tags.IOptionalNamedTag<Item> INGOTS_COPPER = tag("ingots/copper");
public static final TagKey<Item> INGOTS_COPPER = tag("ingots/copper");

public IronChestsRecipeProvider(DataGenerator generatorIn) {
super(generatorIn);
Expand Down Expand Up @@ -284,7 +285,7 @@ private static ResourceLocation location(String id) {
return new ResourceLocation(IronChests.MOD_ID, id);
}

private static Tags.IOptionalNamedTag<Item> tag(String name) {
return ItemTags.createOptional(new ResourceLocation("forge", name));
private static TagKey<Item> tag(String name) {
return ItemTags.create(new ResourceLocation("forge", name));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ protected IronChestMenu(@Nullable MenuType<?> menuType, int containerId, Invento

}

for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++) {
this.addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, chestType.ySize - 24));
for (int hotHarSlot = 0; hotHarSlot < 9; hotHarSlot++) {
this.addSlot(new Slot(playerInventory, hotHarSlot, leftCol + hotHarSlot * 18, chestType.ySize - 24));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class IronChestBlockItem extends BlockItem {
public IronChestBlockItem(Block block, Properties properties, Supplier<Callable<IronChestsTypes>> type, Supplier<Callable<Boolean>> trapped) {
super(block, properties);

IronChestsTypes tempType = DistExecutor.callWhenOn(Dist.CLIENT, type);
Boolean tempTrapped = DistExecutor.callWhenOn(Dist.CLIENT, trapped);
IronChestsTypes tempType = DistExecutor.unsafeCallWhenOn(Dist.CLIENT, type);
Boolean tempTrapped = DistExecutor.unsafeCallWhenOn(Dist.CLIENT, trapped);

this.type = tempType == null ? null : () -> tempType;
this.trapped = tempTrapped == null ? null : () -> tempTrapped;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public net.minecraft.world.entity.ai.goal.GoalSelector f_25345_ # goals
public net.minecraft.world.entity.ai.goal.GoalSelector f_25345_ # goals
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "Iron Chests Resources",
"pack_format": 8
"pack_format": 9
}
}

0 comments on commit b85d869

Please sign in to comment.