Skip to content

Commit

Permalink
update mod to Forge 1.20.1-47.0.1 #21
Browse files Browse the repository at this point in the history
- Update compat with JEI to 1.20.1-15.0.0.17
- Update compat with The One Probe to 1.20.0-9.0.0
  • Loading branch information
cech12 committed Jun 19, 2023
1 parent edbe777 commit b1913c5
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cicd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:
push:
branches: [ "*" ]
tags: ["1.19*"]
tags: ["1.20*"]
pull_request:
branches: [ "*" ]

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
java-version: 17
curseforge-id: 436874
game-versions: |
1.19.4
1.20.1
release-type: release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -69,7 +69,7 @@ jobs:
java-version: 17
modrinth-id: IsSapAeq
game-versions: |
1.19.4
1.20.1
release-type: release
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
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.20.1-2.0.0.0] - 2023-06-19
- Update mod to Forge 1.20.1-47.0.1 #21
- Update compat with JEI to 1.20.1-15.0.0.17 #21
- Update compat with The One Probe to 1.20.0-9.0.0 #21

## [1.19.4-1.4.0.0] - 2023-04-04
- Update mod to Forge 1.19.4-45.0.40
- Update compat with The One Probe to 1.19.4-8.0.0
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_id=solarcooker
mod_version=1.4.0.0
minecraft_version=1.19.4
forge_version=45.0.40
mod_version=2.0.0.0
minecraft_version=1.20.1
forge_version=47.0.1

# jei
jei_version=13.0.0.1
jei_version=15.0.0.17

#the one probe
top_version=1.19.4-8.0.0-1
top_version=1.20.0-9.0.0-1
6 changes: 3 additions & 3 deletions src/main/java/cech12/solarcooker/SolarCookerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModList;
Expand Down Expand Up @@ -61,8 +61,8 @@ public static void onClientRegister(FMLClientSetupEvent event) {
}

@SubscribeEvent
public static void addItemsToTabs(CreativeModeTabEvent.BuildContents event) {
if (event.getTab() == CreativeModeTabs.FUNCTIONAL_BLOCKS) {
public static void addItemsToTabs(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.FUNCTIONAL_BLOCKS) {
event.accept(ModItems.SOLAR_COOKER);
event.accept(ModItems.REFLECTOR);
event.accept(ModItems.SHINING_DIAMOND_BLOCK);
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/cech12/solarcooker/block/ReflectorBlock.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package cech12.solarcooker.block;

import cech12.solarcooker.init.ModItems;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.ChatFormatting;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.core.BlockPos;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.network.chat.Component;
import net.minecraft.ChatFormatting;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -118,7 +118,7 @@ public ReflectorBlock(Properties properties) {

@Override
@Nonnull
public List<ItemStack> getDrops(@Nonnull BlockState state, @Nonnull LootContext.Builder context) {
public List<ItemStack> getDrops(@Nonnull BlockState state, @Nonnull LootParams.Builder context) {
List<ItemStack> drops = super.getDrops(state, context);
int count = getCount(state.getValue(TYPE));
if (!drops.isEmpty() && count > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ protected boolean canSmelt(@Nullable Recipe<?> recipe) {
if (!recipeOutput.isEmpty()) {
ItemStack output = this.items.get(OUTPUT);
if (output.isEmpty()) return true;
else if (!output.sameItem(recipeOutput)) return false;
else if (!ItemStack.isSameItem(output, recipeOutput)) return false;
else return output.getCount() + recipeOutput.getCount() <= output.getMaxStackSize();
}
}
Expand Down Expand Up @@ -454,7 +454,7 @@ public ItemStack removeItemNoUpdate(int index) {
@Override
public void setItem(int index, ItemStack stack) {
ItemStack itemstack = this.items.get(index);
boolean flag = !stack.isEmpty() && stack.sameItem(itemstack) && ItemStack.tagMatches(stack, itemstack);
boolean flag = !stack.isEmpty() && ItemStack.isSameItemSameTags(itemstack, stack);
this.items.set(index, stack);
if (stack.getCount() > this.getMaxStackSize()) {
stack.setCount(this.getMaxStackSize());
Expand Down Expand Up @@ -506,7 +506,7 @@ public Recipe<?> getRecipeUsed() {
}

public void awardUsedRecipesAndPopExperience(Player p_235645_1_) {
List<Recipe<?>> list = this.getRecipesToAwardAndPopExperience(p_235645_1_.level, p_235645_1_.position());
List<Recipe<?>> list = this.getRecipesToAwardAndPopExperience(p_235645_1_.level(), p_235645_1_.position());
p_235645_1_.awardRecipes(list);
this.usedRecipes.clear();
}
Expand Down
30 changes: 10 additions & 20 deletions src/main/java/cech12/solarcooker/client/SolarCookerScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import cech12.solarcooker.SolarCookerMod;
import cech12.solarcooker.inventory.SolarCookerContainer;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.network.chat.Component;
Expand All @@ -29,38 +27,30 @@ public void init() {
}

@Override
public void render(@Nonnull PoseStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) {
this.renderBackground(p_230430_1_);
super.render(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_);
this.renderTooltip(p_230430_1_, p_230430_2_, p_230430_3_);
public void render(@Nonnull GuiGraphics guiGraphics, int p_230430_2_, int p_230430_3_, float p_230430_4_) {
this.renderBackground(guiGraphics);
super.render(guiGraphics, p_230430_2_, p_230430_3_, p_230430_4_);
this.renderTooltip(guiGraphics, p_230430_2_, p_230430_3_);
}

@Override
protected void renderBg(@Nonnull PoseStack p_230450_1_, float partialTicks, int x, int y) {
protected void renderBg(@Nonnull GuiGraphics guiGraphics, float partialTicks, int x, int y) {
if (this.minecraft != null) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, guiTexture);
//draw gui
int left = this.leftPos;
int top = this.topPos;
this.blit(p_230450_1_, left, top, 0, 0, this.imageWidth, this.imageHeight);
guiGraphics.blit(guiTexture, left, top, 0, 0, this.imageWidth, this.imageHeight);
//draw flame
if (this.menu.isBurning()) {
this.blit(p_230450_1_, left + 56, top + 36, 176, 0, 14, 14);
guiGraphics.blit(guiTexture, left + 56, top + 36, 176, 0, 14, 14);
}
//draw progress
int progress = this.menu.getCookProgressionScaled();
this.blit(p_230450_1_, left + 79, top + 34, 176, 14, progress + 1, 16);
guiGraphics.blit(guiTexture, left + 79, top + 34, 176, 14, progress + 1, 16);
//draw sun
if (this.menu.isSunlit()) {
this.blit(p_230450_1_, left + 55, top + 52, 176, 31, 18, 18);
guiGraphics.blit(guiTexture, left + 55, top + 52, 176, 31, 18, 18);
}
}
}

@Override
protected boolean hasClickedOutside(double mouseX, double mouseY, int guiLeftIn, int guiTopIn, int mouseButton) {
return mouseX < (double)guiLeftIn || mouseY < (double)guiTopIn || mouseX >= (double)(guiLeftIn + this.imageWidth) || mouseY >= (double)(guiTopIn + this.imageHeight);
}
}
2 changes: 1 addition & 1 deletion src/main/java/cech12/solarcooker/compat/TOPCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player play
final int cookTimeTotal = nbt.getInt("CookTimeTotal");
if (cookTime > 0) {
iProbeInfo.progress(cookTime, cookTimeTotal, new ProgressStyle()
.suffix(Component.empty().append(" / " + cookTimeTotal))
.suffix(Component.literal(" / " + cookTimeTotal))
.alignment(ElementAlignment.ALIGN_CENTER)
);
}
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/cech12/solarcooker/init/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
Expand All @@ -19,8 +18,8 @@ public final class ModBlocks {

public static DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, SolarCookerMod.MOD_ID);

public static RegistryObject<Block> SOLAR_COOKER = BLOCKS.register("solar_cooker", () -> new SolarCookerBlock(BlockBehaviour.Properties.of(Material.WOOD).strength(2.5F, 3.5F).sound(SoundType.WOOD)));
public static RegistryObject<Block> REFLECTOR = BLOCKS.register("reflector", () -> new ReflectorBlock(BlockBehaviour.Properties.of(Material.WOOD).strength(2.0F).sound(SoundType.WOOD)));
public static RegistryObject<Block> SHINING_DIAMOND_BLOCK = BLOCKS.register("shining_diamond_block", () -> new ShiningDiamondBlock(BlockBehaviour.Properties.of(Material.METAL, MaterialColor.DIAMOND).requiresCorrectToolForDrops().strength(5.0F, 6.0F).sound(SoundType.METAL).lightLevel(state -> 15)));
public static RegistryObject<Block> SOLAR_COOKER = BLOCKS.register("solar_cooker", () -> new SolarCookerBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).strength(2.5F, 3.5F).sound(SoundType.WOOD)));
public static RegistryObject<Block> REFLECTOR = BLOCKS.register("reflector", () -> new ReflectorBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).strength(2.0F).sound(SoundType.WOOD)));
public static RegistryObject<Block> SHINING_DIAMOND_BLOCK = BLOCKS.register("shining_diamond_block", () -> new ShiningDiamondBlock(BlockBehaviour.Properties.of().mapColor(MapColor.DIAMOND).requiresCorrectToolForDrops().strength(5.0F, 6.0F).sound(SoundType.METAL).lightLevel(state -> 15)));

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public SolarCookerContainer(RecipeType<? extends AbstractCookingRecipe> specific
checkContainerSize(cooker, 2);
this.cooker = cooker;
cooker.startOpen(playerInventoryIn.player);
this.world = playerInventoryIn.player.level;
this.world = playerInventoryIn.player.level();

//add cooker inventory slots
this.addSlot(new Slot(cooker, 0, 56, 17));
Expand All @@ -49,7 +49,7 @@ public SolarCookerContainer(RecipeType<? extends AbstractCookingRecipe> specific

public SolarCookerContainer(RecipeType<? extends AbstractCookingRecipe> specificRecipeTypeIn, int id,
Inventory playerInventoryIn, BlockPos pos) {
this(specificRecipeTypeIn, id, playerInventoryIn, (AbstractSolarCookerBlockEntity) playerInventoryIn.player.level.getBlockEntity(pos));
this(specificRecipeTypeIn, id, playerInventoryIn, (AbstractSolarCookerBlockEntity) playerInventoryIn.player.level().getBlockEntity(pos));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public SolarCookerResultSlot(Player player, Container inventoryIn, int slotIndex
@Override
protected void checkTakeAchievements(@Nonnull ItemStack stack) {
super.checkTakeAchievements(stack);
if (!this.player.level.isClientSide && this.container instanceof AbstractSolarCookerBlockEntity) {
if (!this.player.level().isClientSide && this.container instanceof AbstractSolarCookerBlockEntity) {
((AbstractSolarCookerBlockEntity)this.container).awardUsedRecipesAndPopExperience(this.player);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void registerRecipes(@Nonnull IRecipeRegistration registration) {
if (ServerConfig.VANILLA_RECIPES_ENABLED.get()) {
registration.addRecipes(solarCookingCategory.getRecipeType(), manager.getAllRecipesFor(ServerConfig.getRecipeType()).stream()
.filter(recipe -> ServerConfig.isRecipeNotBlacklisted(recipe.getId()))
.map(recipe -> SolarCookingRecipe.convert(recipe, player.getLevel().registryAccess()))
.map(recipe -> SolarCookingRecipe.convert(recipe, player.level().registryAccess()))
.collect(Collectors.toList()));
}
}
Expand Down
10 changes: 5 additions & 5 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="[45,)"
loaderVersion="[47,)"
issueTrackerURL="https://github.com/cech12/BrickShears/issues"
license="The MIT License (MIT)"
[[mods]]
Expand All @@ -15,26 +15,26 @@ license="The MIT License (MIT)"
[[dependencies.solarcooker]]
modId="forge"
mandatory=true
versionRange="[45.0.40,)"
versionRange="[47.0.1,)"
ordering="NONE"
side="BOTH"
[[dependencies.solarcooker]]
modId="minecraft"
mandatory=true
versionRange="[1.19.4,1.20)"
versionRange="[1.20.1,)"
ordering="NONE"
side="BOTH"
[[dependencies.solarcooker]]
modId="jei"
mandatory=false
versionRange="[13.0.0.1,)"
versionRange="[15.0.0.17,)"
referralUrl="https://github.com/mezz/JustEnoughItems"
ordering="NONE"
side="BOTH"
[[dependencies.solarcooker]]
modId="theoneprobe"
mandatory=false
versionRange="[1.19.4-8.0.0,)"
versionRange="[1.20.0-9.0.0,)"
referralUrl="https://www.curseforge.com/minecraft/mc-mods/the-one-probe"
ordering="NONE"
side="BOTH"
6 changes: 3 additions & 3 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"pack": {
"description": "Solar Cooker resources",
"pack_format": 12,
"forge:resource_pack_format": 13,
"forge:data_pack_format": 12
"pack_format": 15,
"forge:resource_pack_format": 15,
"forge:data_pack_format": 15
}
}

0 comments on commit b1913c5

Please sign in to comment.