Skip to content

Commit

Permalink
Updated to 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed May 5, 2024
1 parent 228844c commit 26d9c5c
Show file tree
Hide file tree
Showing 28 changed files with 199 additions and 166 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
with:
fetch-depth: 0
fetch-tags: true
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'oracle'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subprojects {

version = "${minecraft_version}-${mod_version}"

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

jar {
Expand Down Expand Up @@ -74,7 +74,7 @@ subprojects {

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release.set(17)
it.options.release.set(21)
}

processResources {
Expand All @@ -89,7 +89,7 @@ subprojects {
mod_discord_url : mod_discord_url,
mod_license : mod_license
]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', "*.mixins.json"]) {
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', "*.mixins.json"]) {
expand expandProps
}
inputs.properties(expandProps)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-01-19T10:21:08.5970511 Item Models: sereneseasons
// 1.20.6 2024-05-05T10:18:49.4009886 Item Models: sereneseasons
8131cb872e089e4f0ac2bccf3d4d7a25d7d92ec7 assets/sereneseasons/models/item/calendar.json
cb387a39c39a0f4665c565e7218cd4426875246a assets/sereneseasons/models/item/calendar_00.json
c154671ec34c7931bc05c47db4f69f21a5e413c7 assets/sereneseasons/models/item/calendar_01.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-01-19T10:21:08.5955455 Block States: sereneseasons
// 1.20.6 2024-05-05T10:18:49.3994883 Block States: sereneseasons
edf060403d4f871caf88b27e91d713ee2be4ebc1 assets/sereneseasons/blockstates/season_sensor.json
2797b7f59442c019e778d4e72e49c819153d75b3 assets/sereneseasons/models/block/season_sensor_autumn.json
607600cb666bf37bc704c834d7d0ffc585b405d0 assets/sereneseasons/models/block/season_sensor_spring.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// 1.20.6 2024-05-05T10:18:49.3999887 Recipes
e072858e57ee517a9ad673759ea337523f1faf58 data/sereneseasons/advancements/recipes/redstone/season_sensor.json
a6e2e9061195651e5a5ebe536429b983725e47a8 data/sereneseasons/advancements/recipes/tools/calendar.json
6dcfb1f16a07426dedd4bb0c22cf7e8875aaa637 data/sereneseasons/recipes/calendar.json
3a8122eb3cd03dfa946e5daabcc7c0a9813346e2 data/sereneseasons/recipes/season_sensor.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
{
"rewards": {
"recipes": [
"sereneseasons:season_sensor"
]
},
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "sereneseasons:season_sensor"
}
},
"has_calendar": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"sereneseasons:calendar"
]
"items": "sereneseasons:calendar"
}
]
}
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "sereneseasons:season_sensor"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_calendar"
]
]
],
"rewards": {
"recipes": [
"sereneseasons:season_sensor"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
{
"rewards": {
"recipes": [
"sereneseasons:calendar"
]
},
"parent": "minecraft:recipes/root",
"criteria": {
"has_clock": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"minecraft:clock"
]
"items": "minecraft:clock"
}
]
}
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "sereneseasons:calendar"
}
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_clock",
"has_the_recipe"
"has_the_recipe",
"has_clock"
]
],
"rewards": {
"recipes": [
"sereneseasons:calendar"
]
]
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"type": "crafting_shaped",
"pattern": [
"PPP",
"PCP",
"PPP"
],
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"C": {
"item": "minecraft:clock"
},
"P": {
"item": "minecraft:paper"
},
"C": {
"item": "minecraft:clock"
}
},
"pattern": [
"PPP",
"PCP",
"PPP"
],
"result": {
"item": "sereneseasons:calendar"
"count": 1,
"id": "sereneseasons:calendar"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"#": {
"item": "minecraft:cobblestone_slab"
},
"C": {
"item": "sereneseasons:calendar"
},
"G": {
"item": "minecraft:glass"
},
"Q": {
"item": "minecraft:quartz"
}
},
"pattern": [
"GGG",
"QCQ",
"###"
],
"result": {
"count": 1,
"id": "sereneseasons:season_sensor"
}
}
10 changes: 5 additions & 5 deletions common/src/main/java/sereneseasons/block/SeasonSensorBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,25 @@ public void updatePower(Level world, BlockPos pos)
}

@Override
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult rayTraceResult)
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult rayTraceResult)
{
if (player.mayBuild())
{
if (world.isClientSide)
if (level.isClientSide)
{
return InteractionResult.SUCCESS;
}
else
{
BlockState blockstate = state.cycle(SEASON);
world.setBlock(pos, blockstate, 4);
updatePower(world, pos);
level.setBlock(pos, blockstate, 4);
updatePower(level, pos);
return InteractionResult.SUCCESS;
}
}
else
{
return super.use(state, world, pos, player, hand, rayTraceResult);
return super.useWithoutItem(state, level, pos, player, rayTraceResult);
}
}

Expand Down
13 changes: 9 additions & 4 deletions common/src/main/java/sereneseasons/item/CalendarItem.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package sereneseasons.item;

import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.core.component.DataComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.saveddata.maps.MapId;
import sereneseasons.api.season.SeasonHelper;
import sereneseasons.init.ModConfig;
import sereneseasons.season.SeasonTime;
Expand All @@ -22,13 +25,15 @@ public CalendarItem(Properties p_41383_)
}

@Override
public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> tooltip, TooltipFlag flag)
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltip, TooltipFlag flag)
{
if (world != null)
Level level = Minecraft.getInstance().level;

if (level != null)
{
if (ModConfig.seasons.isDimensionWhitelisted(world.dimension()))
if (ModConfig.seasons.isDimensionWhitelisted(level.dimension()))
{
int seasonCycleTicks = SeasonHelper.getSeasonState(world).getSeasonCycleTicks();
int seasonCycleTicks = SeasonHelper.getSeasonState(level).getSeasonCycleTicks();
SeasonTime time = new SeasonTime(seasonCycleTicks);
int subSeasonDuration = ModConfig.seasons.subSeasonDuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
******************************************************************************/
package sereneseasons.season;

import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Mth;
import net.minecraft.world.level.saveddata.SavedData;
Expand All @@ -16,16 +17,18 @@ public class SeasonSavedData extends SavedData
public int seasonCycleTicks;

@Override
public CompoundTag save(CompoundTag nbt)
public CompoundTag save(CompoundTag nbt, HolderLookup.Provider provider)
{
nbt.putInt("SeasonCycleTicks", this.seasonCycleTicks);
return nbt;
}

public static SeasonSavedData load(CompoundTag nbt)
public static SeasonSavedData load(CompoundTag nbt, HolderLookup.Provider provider)
{
SeasonSavedData data = new SeasonSavedData();
data.seasonCycleTicks = Mth.clamp(nbt.getInt("SeasonCycleTicks"), 0, SeasonTime.ZERO.getCycleDuration());
return data;
}


}

This file was deleted.

2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "1.4-SNAPSHOT"
id "fabric-loom" version "1.6-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
}

Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"fabricloader": "*",
"fabric": "*",
"minecraft": "${minecraft_version}",
"java": ">=17",
"java": ">=21",
"glitchcore": ">=${glitchcore_version}"
},
"accessWidener": "${mod_id}.accesswidener",
Expand Down
Loading

0 comments on commit 26d9c5c

Please sign in to comment.