Skip to content

Commit

Permalink
feat: ported to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Jun 15, 2024
1 parent 2c57ff4 commit 5a90374
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 317 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Just Hammers Changelog

## [21.0.0]

### Changed

- Ported to 1.21

### Fixed

- The hammers block outline would select fluids...

## [20.6.0]

### Changed
Expand Down
34 changes: 11 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
id 'pro.mikey.plugins.insaniam' version "0.1-SNAPSHOT"
}

architectury {
Expand Down Expand Up @@ -58,27 +59,28 @@ allprojects {
}
}

def changelogData = insaniamUtils.createChangelog {
file = file('CHANGELOG.md')
versionPattern = ~/## \[[^]]+]/
fallbackValue = "No changelog provided"
version = project.mod_version
}

publishMods {
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null
changelog = file("./CHANGELOG.md").text.replace("# Just Hammers Changelog", "").trim()
changelog = changelogData.replace("# Just Hammers Changelog", "").trim()
version = "${mod_version}"
type = STABLE

def fabricOptions = publishOptions {
file = project.provider { project(":fabric").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "[FABRIC][${minecraft_version}] ${project.name} ${mod_version}"
displayName = "[FABRIC] Just Hammers ${mod_version}"
modLoaders.add("fabric")
}

// def forgeOptions = publishOptions {
// file = project.provider { project(":forge").tasks.remapJar }.flatMap { it.archiveFile }
// displayName = "[FORGE][${minecraft_version}] ${project.name} ${mod_version}"
// modLoaders.add("forge")
// }

def neoForge = publishOptions {
file = project.provider { project(":neoforge").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "[NEOFORGE][${minecraft_version}] ${project.name} ${mod_version}"
displayName = "[NEOFORGE] Just Hammers ${mod_version}"
modLoaders.add("neoforge")
}

Expand All @@ -101,13 +103,6 @@ publishMods {
requires("fabric-api")
}

// curseforge("curseforgeForge") {
// from(curseForgeOptions, forgeOptions)
// requires {
// slug = "architectury-api"
// }
// }

curseforge("curseforgeNeoForge") {
from(curseForgeOptions, neoForge)
requires("architectury-api")
Expand All @@ -119,13 +114,6 @@ publishMods {
requires("fabric-api")
}

// modrinth("modrinthForge") {
// from(modrinthOptions, forgeOptions)
// requires {
// slug = "architectury-api"
// }
// }

modrinth("modrinthNeoforge") {
from(modrinthOptions, neoForge)
requires("architectury-api")
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loom {
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${rootProject.rei_version}"
// modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${rootProject.rei_version}"
}

publishing {
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/pro/mikey/justhammers/HammerTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
import net.minecraft.world.level.block.Block;

public interface HammerTags {
TagKey<Block> HAMMER_NO_SMASHY = TagKey.create(Registries.BLOCK, new ResourceLocation(Hammers.MOD_ID, "hammer_no_smashy"));
TagKey<Block> HAMMER_NO_SMASHY = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(Hammers.MOD_ID, "hammer_no_smashy"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Camera;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.*;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.shapes.Shapes;
Expand All @@ -17,7 +20,7 @@

public class SelectionOutlineRender {

public static void render(ClientLevel world, Camera camera, float v, PoseStack poseStack, MultiBufferSource consumers, GameRenderer gameRenderer, Matrix4f matrix4f, LightTexture lightTexture, LevelRenderer levelRenderer) {
public static void render(ClientLevel world, Camera camera, DeltaTracker v, PoseStack poseStack, MultiBufferSource consumers, GameRenderer gameRenderer, Matrix4f matrix4f, LightTexture lightTexture, LevelRenderer levelRenderer) {
// Get the player
if (world == null) {
return;
Expand Down Expand Up @@ -78,7 +81,9 @@ public static void render(ClientLevel world, Camera camera, float v, PoseStack p
continue;
}

if (world.getBlockState(pos).isAir()) {
BlockState blockState = world.getBlockState(pos);
FluidState fluidState = blockState.getFluidState();
if (blockState.isAir() || (!fluidState.isEmpty())) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"

modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rootProject.rei_version}"
// modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rootProject.rei_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void onInitializeClient() {
}

private boolean renderSelectionOutline(WorldRenderContext worldRenderContext, WorldRenderContext.BlockOutlineContext blockOutlineContext) {
SelectionOutlineRender.render(worldRenderContext.world(), worldRenderContext.camera(), worldRenderContext.tickDelta(), worldRenderContext.matrixStack(), worldRenderContext.consumers(), worldRenderContext.gameRenderer(), worldRenderContext.projectionMatrix(), worldRenderContext.lightmapTextureManager(), worldRenderContext.worldRenderer());
SelectionOutlineRender.render(worldRenderContext.world(), worldRenderContext.camera(), worldRenderContext.tickCounter(), worldRenderContext.matrixStack(), worldRenderContext.consumers(), worldRenderContext.gameRenderer(), worldRenderContext.projectionMatrix(), worldRenderContext.lightmapTextureManager(), worldRenderContext.worldRenderer());
return true;
}
}
8 changes: 4 additions & 4 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"ErrorMikey"
],
"contact": {
"homepage": "https://github.com/ErrorMikey/JustHammers",
"sources": "https://github.com/ErrorMikey/JustHammers"
"homepage": "https://github.com/nanite/JustHammers",
"sources": "https://github.com/nanite/JustHammers"
},
"license": "GPL3",
"environment": "*",
Expand All @@ -30,7 +30,7 @@
],
"depends": {
"fabric-api": ">=0.91.0",
"minecraft": ">=1.20.4",
"architectury": ">=11.0.9"
"minecraft": ">=1.21",
"architectury": ">=13.0.0"
}
}
103 changes: 0 additions & 103 deletions forge/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion forge/gradle.properties

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions forge/src/main/java/pro/mikey/justhammers/forge/HammersForge.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5a90374

Please sign in to comment.