Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperalani authored Jan 17, 2024
2 parents a4a9cda + 5056a46 commit 063fa62
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 24 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
slug: "ptdye-plus"
loader: "forge"
mc_version: "1.19.2"
target_modpack_repo: "Yarden-zamir/Create-Prepare-to-Dye"
target_modpack_repo: "game-design-driven/Create-Prepare-to-Dye"

jobs:
tests:
Expand Down Expand Up @@ -39,12 +39,7 @@ jobs:
with:
tag_prefix: ""
custom_release_rules:
"dev:patch:Developer experience improvements and
changes,tweak:patch:Minor
tweaks,feat:minor:Features,fix:patch:Fixes,revert:patch:Reverted
Changes,docs:patch:Documentation and Localization,test:patch:Tests
and testing related changes,mods:patch:Mod list related
changes,ci:patch:Continuous Integration"
"dev:patch:Developer experience improvments and changes,tweak:patch:Minor tweaks,feat:minor:Features,fix:patch:Fixes,revert:patch:Reverted Changes,docs:patch:Documentation and Localization,test:patch:Tests and testing related changes,mods:patch:Modlist related changes,ci:patch:Continuous Integration"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
Expand All @@ -62,10 +57,14 @@ jobs:
uses: actions/checkout@v4
- name: Run update script
run: |
echo Update version files to ${{ needs.tag_and_release.outputs.new_tag }}
chmod +x ./update_version.sh
./update_version.sh ${{ steps.tag_version.outputs.new_tag }}
./update_version.sh ${{ needs.tag_and_release.outputs.new_tag }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: update version to ${{ needs.tag_and_release.outputs.new_tag }}
branch: main
build_and_release_on_modrinth_and_curseforge:
needs: [update_mod_version_files, tag_and_release, tests]
name: Build and release ${{ matrix.platform }}
Expand All @@ -78,6 +77,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update code
run: |
git pull origin main
- name: Gradle Build Action
uses: gradle/[email protected]
with:
Expand Down Expand Up @@ -106,7 +108,7 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish to Modrinth
if: matrix.platform == 'modrinth'
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3.0
with:
modrinth-id: ${{ vars.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
Expand All @@ -127,7 +129,7 @@ jobs:
https://api.modrinth.com/v2/project/${{ vars.MODRINTH_ID }}
- name: Publish to CurseForge
if: matrix.platform == 'curseforge'
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3.0
with:
curseforge-id: ${{ vars.CF_ID }}
curseforge-token: ${{ secrets.CF_API_TOKEN }}
Expand Down Expand Up @@ -157,8 +159,12 @@ jobs:
- name: Build Modpack modrinth
run:
packwiz update ${{ env.slug }}
- name: Wait for curseforge
run: |
echo Waiting 15 minutes for curseforge to approve the uploaded jar
- name: Build Modpack curseforge
run: |
sleep 900
cd curseforge
packwiz update ${{ env.slug }}
- name: Commit changes
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ Introducing a Java mod designed exclusively for the [Create: Prepare to Dye](htt
This mod includes code for features and bug fixes not achievable with KubeJS, the JavaScript framework used by the CPTD team.

Keep in mind that this mod is primarily tested for use within the CPTD modpack, and using it elsewhere may lead to unexpected behavior.

Key Features:
Key Features:

- Command to access the stonecutter GUI: /openStonecutter
- By using the "/openStonecutter" command, players can directly access the stonecutter's GUI, making it more convenient to craft devices.
- Key bind to open ponder based on what block the player is looking at, set to B by default
- Adds line to Jade tooltip on blocks that have a ponder indicating which button to press to open ponder

While the mod currently focuses on this stonecutter enhancement, expect future updates for more features to enhance your gameplay. Stay tuned!

<br>
<br>

#### For Devs:

- To download gradle dependencies click the `Reload All Gradle Projects` button (refresh/recycle icon) in the top left of the gradle task window (IntelliJ)
- Run the game by debugging the `runClient` gradle task and run `Build Project` or `CTRL+F9` to hotswap your code changes.

14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.spongepowered.mixin' version '0.7.+'
}

version = '+forge-1.19.2'
version = '1.3.11+forge-1.19.2'
group = 'com.kikis.ptdyeplus'
archivesBaseName = 'ptdyeplus'

Expand Down Expand Up @@ -94,6 +95,11 @@ minecraft {
}
}

mixin {
add sourceSets.main, "ptdyeplus.refmap.json"
config "ptdyeplus.mixins.json"
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

Expand Down Expand Up @@ -149,6 +155,9 @@ dependencies {
// Jade
implementation fg.deobf("curse.maven:jade-324717:${jade_id}")

// Wares
implementation fg.deobf("curse.maven:wares-839158:${wares_id}")

// KubeJS
implementation fg.deobf("dev.latvian.mods:kubejs-forge:${kubejs_version}")
implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")
Expand All @@ -162,6 +171,9 @@ dependencies {

// AE2 Things
compileOnly "dev.technici4n:AE2-Things:${ae2things_version}"

// Mixin
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

jar {
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ create_version = 0.5.1.e-44
flywheel_version = 0.6.10-20
registrate_version = MC1.19-1.1.5
jade_id = 4914105
wares_id = 4998846
quark_id = 4812006
quarkOddities_id = 3575623
kubejs_version = 1902.6.2-build.45
rhino_version = 1902.2.3-build.284
architectury_version = 6.5.85
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/kikis/ptdyeplus/PtdyePlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class PtdyePlus
{
public static final String ID = "ptdyeplus";
public static final Logger LOGGER = LogUtils.getLogger();

public static final int REACH_DISTANCE = 30;
public static final double REACH_DISTANCE_SQR = Math.pow(REACH_DISTANCE, 2);
private static final Minecraft minecraft = Minecraft.getInstance();
public PtdyePlus()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kikis.ptdyeplus.mixin.vanilla;

import com.kikis.ptdyeplus.PtdyePlus;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(AbstractFurnaceBlockEntity.class)
public class AbstractFurnaceBlockEntityMixin {
@ModifyConstant(method = "stillValid", constant = {@Constant(doubleValue = 64.0)})
public double validDistance(double value) {
return PtdyePlus.REACH_DISTANCE_SQR;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kikis.ptdyeplus.mixin.vanilla;

import com.kikis.ptdyeplus.PtdyePlus;
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(BrewingStandBlockEntity.class)
public class BrewingStandBlockEntityMixin {
@ModifyConstant(method = "stillValid", constant = {@Constant(doubleValue = 64.0)})
public double validDistance(double value) {
return PtdyePlus.REACH_DISTANCE_SQR;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kikis.ptdyeplus.mixin.vanilla;

import com.kikis.ptdyeplus.PtdyePlus;
import net.minecraft.world.level.block.entity.EnderChestBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(EnderChestBlockEntity.class)
public class EnderChestBlockEntityMixin {
@ModifyConstant(method = "stillValid", constant = {@Constant(doubleValue = 64.0)})
public double validDistance(double value) {
return PtdyePlus.REACH_DISTANCE_SQR;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kikis.ptdyeplus.mixin.vanilla;

import com.kikis.ptdyeplus.PtdyePlus;
import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(RandomizableContainerBlockEntity.class)
public class RandomizableContainerBlockEntityMixin {
@ModifyConstant(method = "stillValid", constant = {@Constant(doubleValue = 64.0)})
public double validDistance(double value) {
return PtdyePlus.REACH_DISTANCE_SQR;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.kikis.ptdyeplus.mixin.wares;

import com.kikis.ptdyeplus.PtdyePlus;
import io.github.mortuusars.wares.block.entity.DeliveryTableBlockEntity;
import net.minecraftforge.common.ForgeMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(DeliveryTableBlockEntity.class)
public class DeliveryTableBlockEntityMixin {
@ModifyConstant(method = "stillValid", constant = {@Constant(doubleValue = 64.0)})
public double validDistance(double value) {
return PtdyePlus.REACH_DISTANCE_SQR;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ modId="ptdyeplus" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="+forge-1.19.2" #mandatory
version="1.3.11+forge-1.19.2" #mandatory

# A display name for the mod
displayName="Ptdye Plus" #mandatory
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/ptdyeplus.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"required": true,
"priority": 1000,
"minVersion": "0.8",
"refmap": "ptdyeplus.refmap.json",
"package": "com.kikis.ptdyeplus.mixin",
"mixins": [
"vanilla.AbstractFurnaceBlockEntityMixin",
"vanilla.BrewingStandBlockEntityMixin",
"vanilla.EnderChestBlockEntityMixin",
"vanilla.RandomizableContainerBlockEntityMixin",
"wares.DeliveryTableBlockEntityMixin"
]
}
17 changes: 12 additions & 5 deletions update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ version="${unformattedVersion::-14}"
#minorRemoved="${version::-1}"
#minorIncreased="$(($minor + 1))"
#newVersion="$minorRemoved$minorIncreased"
newVersion="$1"
newVersion=$1

# Replace in build.gradle
find build.gradle -type f -exec sed -i "s/$version/$newVersion/g" {} \;
if [ $newVersion != "" ]
then
# Replace in build.gradle
find build.gradle -type f -exec sed -i "s/$version/$newVersion/g" {} \;

# Replace in mods.toml
find ./src/main/resources/META-INF/mods.toml -type f -exec sed -i "s/$version/$newVersion/g" {} \;

# Replace in mods.toml
find ./src/main/resources/META-INF/mods.toml -type f -exec sed -i "s/$version/$newVersion/g" {} \;
echo "Replaced $version with $newVersion"
else
echo "Error replacing version"
fi

0 comments on commit 063fa62

Please sign in to comment.