Skip to content

Commit

Permalink
Update and move back to Forge 1.20.2-48.0.23 (from NeoForge) until it…
Browse files Browse the repository at this point in the history
… is stable

- Temporary deactivation of The One Probe support until it is ported to 1.20.2
- Temporary deactivation of Immersive Engineering support until it is ported to 1.20.2
- deactivate game tests, because they are not working yet
  • Loading branch information
cech12 committed Oct 23, 2023
1 parent d0773ce commit 158809c
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 76 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/cicd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ jobs:
uses: cech12/MinecraftModActions/.github/workflows/build.yml@main
with:
java-version: 17
gametest:
needs: build
name: Game Test
uses: cech12/MinecraftModActions/.github/workflows/gametest.yml@main
with:
java-version: 17
# gametest:
# needs: build
# name: Game Test
# uses: cech12/MinecraftModActions/.github/workflows/gametest.yml@main
# with:
# java-version: 17
codeql:
needs: build
name: CodeQL
uses: cech12/MinecraftModActions/.github/workflows/codeql-analysis.yml@main
with:
java-version: 17
publish-github:
needs: [ gametest, codeql ]
# needs: [ gametest, codeql ]
needs: codeql
if: startsWith(github.ref, 'refs/tags/')
name: Publish Github
uses: cech12/MinecraftModActions/.github/workflows/publish-github.yml@main
Expand All @@ -48,10 +49,9 @@ jobs:
java-version: 17
curseforge-id: 363593
game-versions: |
1.20.1
1.20.2
release-type: release
loaders: |
neoforge
forge
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -65,10 +65,9 @@ jobs:
java-version: 17
modrinth-id: yzHyAUSI
game-versions: |
1.20.1
1.20.2
release-type: release
loaders: |
neoforge
forge
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ 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.20.2-2.2.0.0] - 2023-10-23
### Changed
- update and move back to Forge 1.20.2-48.0.23 (from NeoForge) until it is stable
- Temporary deactivation of The One Probe support until it is ported to 1.20.2
- Temporary deactivation of Immersive Engineering support until it is ported to 1.20.2
- deactivate game tests, because they are not working yet

## [1.20.1-2.1.1.0] - 2023-09-24
### Added
- Added Russian translation (thanks to FishermanHMeM) #26
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle' version '[6.0,6.2)'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+' //only to use immersive engineering
}

Expand Down Expand Up @@ -115,19 +115,19 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.neoforged:forge:${project.minecraft_version}-${project.forge_version}"
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"

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

implementation fg.deobf("mcjty.theoneprobe:theoneprobe:$top_version") {transitive = false}
//implementation fg.deobf("mcjty.theoneprobe:theoneprobe:$top_version") {transitive = false}

//Immersive Engineering
runtimeOnly fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:${project.immersive_engineering_version}")
compileOnly fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:${project.immersive_engineering_version}:api")
//runtimeOnly fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:${project.immersive_engineering_version}")
//compileOnly fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:${project.immersive_engineering_version}:api")
}

tasks.named('processResources', ProcessResources).configure {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

## Environment Properties
minecraft_version=1.20.1
minecraft_version_range=[1.20.1,1.21)
forge_version=47.1.54
forge_version_range=[47.1.0,)
loader_version_range=[47,)
minecraft_version=1.20.2
minecraft_version_range=[1.20.2,1.21)
forge_version=48.0.23
forge_version_range=[48.0.23,)
loader_version_range=[48,)

## Mod Properties
mod_id=brickfurnace
mod_version=2.1.1.0
mod_version=2.2.0.0
mod_group_id=cech12.brickfurnace
mod_name=Brick Furnace
mod_authors=Cech12
Expand All @@ -22,8 +22,8 @@ mod_issue_tracker=https://github.com/cech12/BrickFurnace/issues
mod_description=A mod which adds Brick Furnaces.

# jei
jei_version=15.2.0.23
jei_version_range=[15.2.0.23,)
jei_version=16.0.0.28
jei_version_range=[16.0.0.28,)

#the one probe
top_version=1.20.0-9.0.0-1
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'NeoForge'
url 'https://maven.neoforged.net'
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cech12/brickfurnace/BrickFurnaceMod.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cech12.brickfurnace;

import cech12.brickfurnace.compat.TOPCompat;
//import cech12.brickfurnace.compat.TOPCompat;
import cech12.brickfurnace.init.ModBlockEntityTypes;
import cech12.brickfurnace.init.ModBlocks;
import cech12.brickfurnace.init.ModItems;
Expand Down Expand Up @@ -40,7 +40,7 @@ public BrickFurnaceMod() {
ServerConfig.loadConfig(ServerConfig.SERVER_CONFIG, FMLPaths.GAMEDIR.get().resolve(FMLConfig.defaultConfigPath()).resolve(MOD_ID + "-server.toml"));
//The One Probe registration.
if (ModList.get().isLoaded("theoneprobe") && !ModList.get().isLoaded("topaddons")) {
TOPCompat.register();
//TOPCompat.register();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import cech12.brickfurnace.config.ServerConfig;
import net.minecraft.core.BlockPos;
import net.minecraft.world.inventory.ContainerData;
import net.minecraft.world.item.crafting.*;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.AbstractFurnaceBlock;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.util.Mth;
Expand Down Expand Up @@ -46,7 +44,7 @@ public AbstractBrickFurnaceBlockEntity(BlockEntityType<?> blockEntityTypeIn,
public static final int FUEL = 1;
public static final int OUTPUT = 2;

protected AbstractCookingRecipe curRecipe;
protected RecipeHolder<? extends AbstractCookingRecipe> curRecipe;
protected ItemStack failedMatch = ItemStack.EMPTY;

private boolean isBurning() {
Expand All @@ -66,7 +64,7 @@ public static void tick(Level level, BlockPos pos, BlockState state, AbstractBri

ItemStack fuel = entity.items.get(FUEL);
if (entity.isBurning() || !fuel.isEmpty() && !entity.items.get(INPUT).isEmpty()) {
AbstractCookingRecipe irecipe = entity.getRecipe();
RecipeHolder<? extends AbstractCookingRecipe> irecipe = entity.getRecipe();
boolean valid = entity.canBurn(irecipe);
if (!entity.isBurning() && valid) {
entity.dataAccess.set(BURN_TIME, entity.getBurnDuration(fuel)); //changed because of private variable
Expand Down Expand Up @@ -108,9 +106,9 @@ else if (!fuel.isEmpty()) {
}
}

private boolean canBurn(@Nullable Recipe<?> recipe) {
private boolean canBurn(@Nullable RecipeHolder<?> recipe) {
if (!this.items.get(0).isEmpty() && recipe != null) {
ItemStack recipeOutput = recipe.getResultItem(this.getLevel().registryAccess());
ItemStack recipeOutput = recipe.value().getResultItem(this.getLevel().registryAccess());
if (!recipeOutput.isEmpty()) {
ItemStack output = this.items.get(OUTPUT);
if (output.isEmpty()) return true;
Expand All @@ -121,10 +119,10 @@ private boolean canBurn(@Nullable Recipe<?> recipe) {
return false;
}

private void smeltItem(@Nullable Recipe<?> recipe) {
private void smeltItem(@Nullable RecipeHolder<?> recipe) {
if (recipe != null && this.canBurn(recipe)) {
ItemStack itemstack = this.items.get(0);
ItemStack itemstack1 = recipe.getResultItem(this.getLevel().registryAccess());
ItemStack itemstack1 = recipe.value().getResultItem(this.getLevel().registryAccess());
ItemStack itemstack2 = this.items.get(2);
if (itemstack2.isEmpty()) {
this.items.set(2, itemstack1.copy());
Expand All @@ -145,29 +143,29 @@ private void smeltItem(@Nullable Recipe<?> recipe) {
}

private int getTotalCookTime() {
AbstractCookingRecipe rec = getRecipe();
RecipeHolder<? extends AbstractCookingRecipe> rec = getRecipe();
if (rec == null) {
return 200;
} else if (this.specificRecipeType.getClass().isInstance(rec.getType())) {
return rec.getCookingTime();
} else if (this.specificRecipeType.getClass().isInstance(rec.value().getType())) {
return rec.value().getCookingTime();
}
return (int) (rec.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get());
return (int) (rec.value().getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get());
}

public AbstractCookingRecipe getRecipe() {
public RecipeHolder<? extends AbstractCookingRecipe> getRecipe() {
ItemStack input = this.getItem(INPUT);
if (input.isEmpty() || input == failedMatch) {
return null;
}
if (this.level != null && curRecipe != null && curRecipe.matches(this, level)) {
if (this.level != null && curRecipe != null && curRecipe.value().matches(this, level)) {
return curRecipe;
} else {
AbstractCookingRecipe rec = null;
RecipeHolder<? extends AbstractCookingRecipe> rec = null;
if (this.level != null) {
rec = this.level.getRecipeManager().getRecipeFor(this.specificRecipeType, this, this.level).orElse(null);
if (rec == null && ServerConfig.VANILLA_RECIPES_ENABLED.get()) {
rec = this.level.getRecipeManager().getRecipesFor(this.vanillaRecipeType, this, this.level)
.stream().filter(abstractCookingRecipe -> ServerConfig.isRecipeNotBlacklisted(abstractCookingRecipe.getId())).findFirst().orElse(null);
.stream().filter(abstractCookingRecipe -> ServerConfig.isRecipeNotBlacklisted(abstractCookingRecipe.id())).findFirst().orElse(null);
}
}
if (rec == null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cech12/brickfurnace/compat/EventHandler.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cech12.brickfurnace.compat;

import cech12.brickfurnace.compat.immersiveengineering.ImmersiveEngineering;
//import cech12.brickfurnace.compat.immersiveengineering.ImmersiveEngineering;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand All @@ -15,7 +15,7 @@ public class EventHandler {
@SubscribeEvent
public static void onCapabilitiesAttachBlockEntity(AttachCapabilitiesEvent<BlockEntity> event) {
if (ModList.get().isLoaded("immersiveengineering")) {
ImmersiveEngineering.onCapabilitiesAttachBlockEntity(event);
//ImmersiveEngineering.onCapabilitiesAttachBlockEntity(event);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cech12/brickfurnace/compat/TOPCompat.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cech12.brickfurnace.compat;

/*
import cech12.brickfurnace.BrickFurnaceMod;
import cech12.brickfurnace.blockentity.AbstractBrickFurnaceBlockEntity;
import mcjty.theoneprobe.api.CompoundText;
Expand Down Expand Up @@ -72,3 +72,4 @@ public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player play
}
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cech12.brickfurnace.compat.immersiveengineering;

/*
import blusunrize.immersiveengineering.api.tool.ExternalHeaterHandler;
import cech12.brickfurnace.blockentity.AbstractBrickFurnaceBlockEntity;
import cech12.brickfurnace.blockentity.BrickFurnaceBlockEntity;
Expand Down Expand Up @@ -82,3 +82,4 @@ public void setFurnaceActive() {
}
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cech12.brickfurnace.compat.immersiveengineering;

/*
import blusunrize.immersiveengineering.api.tool.ExternalHeaterHandler;
import blusunrize.immersiveengineering.api.utils.CapabilityUtils;
import cech12.brickfurnace.BrickFurnaceMod;
Expand Down Expand Up @@ -42,3 +42,4 @@ public <T2> LazyOptional<T2> getCapability(@Nonnull Capability<T2> cap, @Nullabl
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
import net.minecraft.world.item.crafting.SimpleCookingSerializer;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.resources.ResourceLocation;

import javax.annotation.Nonnull;

public class BrickBlastingRecipe extends AbstractCookingRecipe {

public static final SimpleCookingSerializer<BrickBlastingRecipe> SERIALIZER = new SimpleCookingSerializer<>(BrickBlastingRecipe::new, 100);

public BrickBlastingRecipe(ResourceLocation p_i50031_1_, String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.BLASTING.get(), p_i50031_1_, p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
public BrickBlastingRecipe(String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.BLASTING.get(), p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
}

public static BrickBlastingRecipe convert(@Nonnull BlastingRecipe recipe, RegistryAccess registryAccess) {
return new BrickBlastingRecipe(recipe.getId(), recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
return new BrickBlastingRecipe(recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
import net.minecraft.world.item.crafting.SmeltingRecipe;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.resources.ResourceLocation;

import javax.annotation.Nonnull;

public class BrickSmeltingRecipe extends AbstractCookingRecipe {

public static final SimpleCookingSerializer<BrickSmeltingRecipe> SERIALIZER = new SimpleCookingSerializer<>(BrickSmeltingRecipe::new, 200);

public BrickSmeltingRecipe(ResourceLocation p_i50031_1_, String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.SMELTING.get(), p_i50031_1_, p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
public BrickSmeltingRecipe(String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.SMELTING.get(), p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
}

public static BrickSmeltingRecipe convert(@Nonnull SmeltingRecipe recipe, RegistryAccess registryAccess) {
return new BrickSmeltingRecipe(recipe.getId(), recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
return new BrickSmeltingRecipe(recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.SmokingRecipe;
import net.minecraft.resources.ResourceLocation;

import javax.annotation.Nonnull;

public class BrickSmokingRecipe extends AbstractCookingRecipe {

public static final SimpleCookingSerializer<BrickSmokingRecipe> SERIALIZER = new SimpleCookingSerializer<>(BrickSmokingRecipe::new, 100);

public BrickSmokingRecipe(ResourceLocation p_i50031_1_, String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.SMOKING.get(), p_i50031_1_, p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
public BrickSmokingRecipe(String p_i50031_2_, CookingBookCategory category, Ingredient p_i50031_3_, ItemStack p_i50031_4_, float p_i50031_5_, int p_i50031_6_) {
super(ModRecipeTypes.SMOKING.get(), p_i50031_2_, category, p_i50031_3_, p_i50031_4_, p_i50031_5_, p_i50031_6_);
}

public static BrickSmokingRecipe convert(@Nonnull SmokingRecipe recipe, RegistryAccess registryAccess) {
return new BrickSmokingRecipe(recipe.getId(), recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
return new BrickSmokingRecipe(recipe.getGroup(), recipe.category(), recipe.getIngredients().get(0), recipe.getResultItem(registryAccess), recipe.getExperience(), (int) (recipe.getCookingTime() * ServerConfig.COOK_TIME_FACTOR.get()));
}

@Override
Expand Down
Loading

0 comments on commit 158809c

Please sign in to comment.