Skip to content

Commit

Permalink
port to Forge 1.18-38.0.6
Browse files Browse the repository at this point in the history
- jei compatibility temporary deactivated
  • Loading branch information
cech12 committed Dec 4, 2021
1 parent 9920e15 commit 4dc8668
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Build

on:
push:
branches: [ "1.17" ]
branches: [ "1.18" ]
pull_request:
branches: [ "1.17" ]
branches: [ "1.18" ]

jobs:
build:
Expand All @@ -15,11 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v2
name: Cache MC Assets
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Publish
on:
push:
tags:
- "1.17*"
- "1.18*"

jobs:
publish:
Expand All @@ -15,11 +15,11 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v2
name: Cache MC Assets
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.18-1.0.1.1] - 2021-12-04
### Changed
- port to Forge 1.18-38.0.6
- jei compatibility temporary deactivated

## [1.17.1-1.0.1.1] - 2021-08-24
### Added
- jei compatibility readded
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ version = "${minecraft_version}-${mod_version}"
group = "cech12.${mod_id}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "${mod_id}"

// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
Expand Down Expand Up @@ -114,10 +114,11 @@ dependencies {
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"

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

// Example for how to get properties into the manifest for reading by the runtime..
Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ org.gradle.daemon=false

mod_id=solarcooker
mod_version=1.0.1.1
minecraft_version=1.17.1
forge_version=37.0.32
minecraft_version=1.18
forge_version=38.0.6

# TODO
# jei
jei_version=1.17.1:8.0.0.12
#jei_version=1.17.1:8.0.0.12

# mcjunitlib
# mcjunitlib_version=1.4.3-1.16.5

#Curseforge
curseforge_id=436874
curseforge_release=beta
curseforge_versions=1.17.1
curseforge_versions=1.18
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import net.minecraft.world.inventory.MenuType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.BlockPos;
import net.minecraftforge.common.extensions.IForgeContainerType;
import net.minecraftforge.common.extensions.IForgeMenuType;

public class ContainerTypes {

public final static ResourceLocation SOLAR_COOKER_ID = new ResourceLocation(SolarCookerMod.MOD_ID, "solarcooker");

public static MenuType<? extends AbstractContainerMenu> SOLAR_COOKER = IForgeContainerType.create((pWindowID, pInventory, pData) -> {
public static MenuType<? extends AbstractContainerMenu> SOLAR_COOKER = IForgeMenuType.create((pWindowID, pInventory, pData) -> {
BlockPos pos = pData.readBlockPos();
return new SolarCookerContainer(RecipeTypes.SOLAR_COOKING, pWindowID, pInventory, pos);
}).setRegistryName(SOLAR_COOKER_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Random;

import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.network.NetworkHooks;

public class SolarCookerBlock extends AbstractSolarCookerBlock {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cech12.solarcooker.jei;

/*
import cech12.solarcooker.SolarCookerMod;
import cech12.solarcooker.api.block.SolarCookerBlocks;
import cech12.solarcooker.api.crafting.RecipeTypes;
Expand Down Expand Up @@ -58,3 +58,4 @@ public void registerRecipeCatalysts(@Nonnull IRecipeCatalystRegistration registr
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cech12.solarcooker.jei;

/*
import cech12.solarcooker.api.block.SolarCookerBlocks;
import cech12.solarcooker.api.crafting.RecipeTypes;
import cech12.solarcooker.config.ServerConfig;
Expand Down Expand Up @@ -28,3 +28,4 @@ public Class<? extends SolarCookingRecipe> getRecipeClass() {
return SolarCookingRecipe.class;
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,23 @@ public void load(@Nonnull CompoundTag nbtIn) {
}

@Override
@Nonnull
public CompoundTag save(@Nonnull CompoundTag compound) {
super.save(compound);
protected void saveAdditional(@Nonnull CompoundTag compound) {
super.saveAdditional(compound);
compound.putInt("CookTime", this.cookTime);
compound.putInt("CookTimeTotal", this.cookTimeTotal);
ContainerHelper.saveAllItems(compound, this.items);
return compound;
}

@Override
@Nonnull
public CompoundTag getUpdateTag() {
return this.save(new CompoundTag());
return this.saveWithoutMetadata();
}

@Nullable
@Override
public ClientboundBlockEntityDataPacket getUpdatePacket() {
return new ClientboundBlockEntityDataPacket(this.worldPosition, 0, this.getUpdateTag());
return ClientboundBlockEntityDataPacket.create(this);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[37,)"
loaderVersion="[38,)"
issueTrackerURL="https://github.com/cech12/BrickShears/issues"
license="The MIT License (MIT)"
[[mods]]
Expand All @@ -15,13 +15,13 @@ license="The MIT License (MIT)"
[[dependencies.solarcooker]]
modId="forge"
mandatory=true
versionRange="[37.0.32,)"
versionRange="[38.0.6,)"
ordering="NONE"
side="BOTH"
[[dependencies.solarcooker]]
modId="minecraft"
mandatory=true
versionRange="[1.17.1,)"
versionRange="[1.18,)"
ordering="NONE"
side="BOTH"
[[dependencies.solarcooker]]
Expand Down
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": "Solar Cooker resources",
"pack_format": 7
"pack_format": 8
}
}

0 comments on commit 4dc8668

Please sign in to comment.