Skip to content

Commit

Permalink
- Added 2 more villager trading bookmark groups.
Browse files Browse the repository at this point in the history
  * The new groups are disabled by default and can be enabled in `Mod Settings`
  * You can also assign shortcuts in `Hotkeys`
- Added support for **Easy Villagers**.
  * All forge versions now support the trading blocks of **Easy Villagers**
  • Loading branch information
blackd committed Jun 29, 2023
1 parent a283e86 commit 24d8fdc
Show file tree
Hide file tree
Showing 28 changed files with 825 additions and 57 deletions.
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.anti_ad.mc.ipnext.buildsrc.loom_version
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream

val versionObj = Version("1", "10", "5",
val versionObj = Version("1", "10", "6",
preRelease = (System.getenv("IPNEXT_RELEASE") == null))


Expand Down Expand Up @@ -81,11 +81,13 @@ tasks.named<KotlinCompile>("compileKotlin") {
}
}

//group = "org.anti-ad.mc"

evaluationDependsOnChildren()

allprojects {
version = versionObj.toCleanString()
group = "org.anti-ad.mc"
// group = "org.anti-ad.mc"
ext.set("mod_artefact_version", versionObj.toCleanString())
ext.set("mod_artefact_is_release", versionObj.isRelease())
ext.set("libIPN_version", "3.0.2")
Expand Down Expand Up @@ -135,6 +137,7 @@ tasks.register<Copy>("copyPlatformJars") {
val isForge = it.name.startsWith("forge")
isFabric || isForge
}.forEach {
//group = "org.anti-ad.mc.platforms"
val isForge = !it.name.startsWith("fabric")
val taskName = if (isForge) { "shadowJar" } else { "remapJar" }
val jarTask = it.tasks.named<org.gradle.jvm.tasks.Jar>(taskName)
Expand Down
27 changes: 22 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<!-- latest begin -->
### 1.10.5

- Fixed crash when the FTB Quest screen is opened from the inventory screen and closed.
- Fixed game hanging when the inventory is full and fast trading is used.
- Fixed villager trades data not being stored properly on servers.
- Added workaround for Optifabric incompatibility introduced with the support for 1.20. Any future optifabric incompatibilities will be resolved with adding optifabric as incompatible mod in the mod description.
### 1.10.6

- Added 2 more villager trading bookmark groups.
* The new groups are disabled by default and can be enabled in `Mod Settings`
* You can also assign shortcuts in `Hotkeys`
- Added support for **Easy Villagers**.
* All forge versions now support the trading blocks of **Easy Villagers**

### End of Life Notice

- This is the last version that supports `Minecraft 1.16` both Forge and Fabric
- This is the last version that supports `Minecraft 1.19.4` both Forge and Fabric

**Bugs might get a fix depending on the severity.**

### WARNING

Expand All @@ -26,6 +35,14 @@ Any problems that are not reproducible on Fabric will be addressed with very low
<!-- latest end -->
<!-- rest begin -->

### 1.10.5

- Fixed crash when the FTB Quest screen is opened from the inventory screen and closed.
- Fixed game hanging when the inventory is full and fast trading is used.
- Fixed villager trades data not being stored properly on servers.
- Added workaround for Optifabric incompatibility introduced with the support for 1.20. Any future optifabric incompatibilities will be resolved with adding optifabric as incompatible mod in the mod description.


### 1.10.4

- "Disable all input user for locked slots" now disables and swap buttons (1-9)
Expand Down
6 changes: 2 additions & 4 deletions platforms/fabric-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ loom {
tasks.named<AntlrTask>("generateGrammarSource").configure {
val pkg = "org.anti_ad.mc.common.gen"
outputDirectory = file("build/generated-src/antlr/main/${pkg.replace('.', '/')}")
arguments = listOf(
"-visitor", "-package", pkg,
"-Xexact-output-dir"
)
arguments = listOf("-visitor", "-package", pkg,
"-Xexact-output-dir")
}

afterEvaluate {
Expand Down
2 changes: 1 addition & 1 deletion platforms/fabric-1.20/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ configure<CurseExtension> {
changelog = file("../../description/out/pandoc-release_notes.md")
releaseType = "release"
supported_minecraft_versions.forEach {
if (!it.toLowerCase().contains("pre")) {
if (!it.toLowerCase().contains("pre") && !it.toLowerCase().contains("shanpshot")) {
this.addGameVersion(it)
}
}
Expand Down
36 changes: 30 additions & 6 deletions platforms/forge-1.16/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ dependencies {
//api( fg.deobf("curse.maven:tconcept-74072:3695126"))
runtimeOnly( fg.deobf("curse.maven:ctm-267602:3137659"))
implementation(fg.deobf("curse.maven:chipped-456956:3717506"))

implementation(fg.deobf("curse.maven:easy-villagers-400514:3637981"))


}

tasks.named("compileKotlin") {
Expand Down Expand Up @@ -184,10 +188,8 @@ plugins.withId("idea") {
tasks.named<AntlrTask>("generateGrammarSource").configure {
val pkg = "org.anti_ad.mc.common.gen"
outputDirectory = file("build/generated-src/antlr/main/${pkg.replace('.', '/')}")
arguments = listOf(
"-visitor", "-package", pkg,
"-Xexact-output-dir"
)
arguments = listOf("-visitor", "-package", pkg,
"-Xexact-output-dir")
}

afterEvaluate {
Expand Down Expand Up @@ -377,7 +379,7 @@ configure<UserDevExtension> {
"mixin.debug.dumpTargetOnFailure" to "true"
))
arg("-mixin.config=mixins.ipnext.json")
args("--width=1280", "--height=720", "--username=DEV")
args("--width=1280", "--height=720", "--username=DEV2")
workingDirectory = project.file("run").canonicalPath
source(sourceSets["main"])
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
Expand All @@ -390,8 +392,30 @@ configure<UserDevExtension> {
sources(sourceSets.getByName("main"))
}
}

create("client", runConfig)
create("server", runConfig)

val runConfigServer = Action<RunConfig> {
properties(mapOf(
//"forge.logging.markers" to "SCAN,REGISTRIES,REGISTRYDUMP",
"forge.logging.console.level" to "debug",
"mixin.env.remapRefMap" to "true",
"mixin.env.refMapRemappingFile" to "${projectDir}/build/createSrgToMcp/output.srg",
"mixin.debug.verbose" to "true",
"mixin.debug.export" to "true",
"mixin.debug.dumpTargetOnFailure" to "true",
"bsl.debug" to "true"))
arg("--mixin.config=mixins.ipnext.json")
workingDirectory = project.file("run-server").canonicalPath
source(FilteringSourceSet(sourceSets["main"], "InventoryProfilesNext-common", logger))


jvmArg("--add-exports=java.base/sun.security.util=ALL-UNNAMED")
jvmArg("--add-opens=java.base/java.util.jar=ALL-UNNAMED")
//taskName = "plamenRunClient"
this.forceExit = false
}
create("server", runConfigServer)

//create("data", runConfig)
}
Expand Down
1 change: 1 addition & 0 deletions platforms/forge-1.16/src/integrations/easy-villagers-1.16
3 changes: 2 additions & 1 deletion platforms/forge-1.16/src/main/resources/mixins.ipnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"MixinPlayerInventory",
"MixinScreenHandler",
"MixinMerchantScreen",
"MixinPlayerInteractEntityC2SPacket"
"MixinPlayerInteractEntityC2SPacket",
"MixinTraderTileEntityBase"
],
"injectors": {
"defaultRequire": 1
Expand Down
34 changes: 29 additions & 5 deletions platforms/forge-1.18.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ dependencies {
runtimeOnly(fg.deobf("curse.maven:ctm-267602:3933537"))
compileOnly(fg.deobf("curse.maven:chipped-456956:4293291"))
}
//needed for Easy Villagers
run {
implementation(fg.deobf("curse.maven:easy-villagers-400514:3887794"))
}

}

tasks.named("compileKotlin") {
Expand Down Expand Up @@ -179,10 +184,8 @@ plugins.withId("idea") {
tasks.named<AntlrTask>("generateGrammarSource").configure {
val pkg = "org.anti_ad.mc.common.gen"
outputDirectory = file("build/generated-src/antlr/main/${pkg.replace('.', '/')}")
arguments = listOf(
"-visitor", "-package", pkg,
"-Xexact-output-dir"
)
arguments = listOf("-visitor", "-package", pkg,
"-Xexact-output-dir")
}

afterEvaluate {
Expand Down Expand Up @@ -390,7 +393,28 @@ configure<UserDevExtension> {

rcltName = action.taskName

create("server", runConfig)
val runConfigServer = Action<RunConfig> {
properties(mapOf(
//"forge.logging.markers" to "SCAN,REGISTRIES,REGISTRYDUMP",
"forge.logging.console.level" to "debug",
"mixin.env.remapRefMap" to "true",
"mixin.env.refMapRemappingFile" to "${projectDir}/build/createSrgToMcp/output.srg",
"mixin.debug.verbose" to "true",
"mixin.debug.export" to "true",
"mixin.debug.dumpTargetOnFailure" to "true",
"bsl.debug" to "true"))
arg("--mixin.config=mixins.ipnext.json")
workingDirectory = project.file("run-server").canonicalPath
source(FilteringSourceSet(sourceSets["main"], "InventoryProfilesNext-common", logger))


jvmArg("--add-exports=java.base/sun.security.util=ALL-UNNAMED")
jvmArg("--add-opens=java.base/java.util.jar=ALL-UNNAMED")
//taskName = "plamenRunClient"
this.forceExit = false
}

create("server", runConfigServer)
//create("data", runConfig)

all {
Expand Down
1 change: 1 addition & 0 deletions platforms/forge-1.18.2/src/integrations/easy-villagers
3 changes: 2 additions & 1 deletion platforms/forge-1.18.2/src/main/resources/mixins.ipnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"MixinPlayerInventory",
"MixinScreenHandler",
"MixinServerBoundInteractPacket",
"MixinMerchantScreen"
"MixinMerchantScreen",
"MixinTraderTileEntityBase"
],
"injectors": {
"defaultRequire": 1
Expand Down
3 changes: 2 additions & 1 deletion platforms/forge-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ configurations {

dependencies {
//runtimeOnly( fg.deobf("curse.maven:iron-furnaces-237664:4009901"))

//runtimeOnly( fg.deobf("curse.maven:iron-furnaces-237664:4009901"))
implementation(fg.deobf("curse.maven:easy-villagers-400514:4502611"))
}

tasks.named("compileKotlin") {
Expand Down
1 change: 1 addition & 0 deletions platforms/forge-1.19.4/src/integrations/easy-villagers
3 changes: 2 additions & 1 deletion platforms/forge-1.19.4/src/main/resources/mixins.ipnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"MixinScreenHandler",
"MixinItemGroup",
"MixinServerBoundInteractPacket",
"MixinMerchantScreen"
"MixinMerchantScreen",
"MixinTraderTileEntityBase"
],
"injectors": {
"defaultRequire": 1
Expand Down
2 changes: 2 additions & 0 deletions platforms/forge-1.19/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ dependencies {
runtimeOnly( fg.deobf("curse.maven:ctm-267602:4393695"))
runtimeOnly(fg.deobf("curse.maven:resourcefullib-570073:4378847"))
implementation(fg.deobf("curse.maven:chipped-456956:4463479"))

implementation(fg.deobf("curse.maven:easy-villagers-400514:4502586"))
}

tasks.named("compileKotlin") {
Expand Down
1 change: 1 addition & 0 deletions platforms/forge-1.19/src/integrations/easy-villagers
3 changes: 2 additions & 1 deletion platforms/forge-1.19/src/main/resources/mixins.ipnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"MixinPlayerInventory",
"MixinScreenHandler",
"MixinMerchantScreen",
"MixinServerBoundInteractPacket"
"MixinServerBoundInteractPacket",
"MixinTraderTileEntityBase"
],
"injectors": {
"defaultRequire": 1
Expand Down
1 change: 1 addition & 0 deletions platforms/forge-1.20/src/integrations/easy-villagers
3 changes: 2 additions & 1 deletion platforms/forge-1.20/src/main/resources/mixins.ipnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"MixinScreenHandler",
"MixinItemGroup",
"MixinServerBoundInteractPacket",
"MixinMerchantScreen"
"MixinMerchantScreen",
"MixinTraderTileEntityBase"
],
"injectors": {
"defaultRequire": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Inventory Profiles Next
*
* Copyright (c) 2022 Plamen K. Kosseff <p.kosseff@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.anti_ad.mc.ipnext.mixin;

import de.maxhenkel.easyvillagers.blocks.tileentity.TraderTileentityBase;
import net.minecraft.entity.player.PlayerEntity;
import org.anti_ad.mc.ipnext.event.villagers.VillagerTradeManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(TraderTileentityBase.class)
class MixinTraderTileEntityBase {


@Inject(at = @At("HEAD"), method = "Lde/maxhenkel/easyvillagers/blocks/tileentity/TraderTileentityBase;openTradingGUI(Lnet/minecraft/entity/player/PlayerEntity;)Z", remap = false)
public void openTradingGUI(PlayerEntity playerEntity, CallbackInfoReturnable<Boolean> cir) {
TraderTileentityBase self = (TraderTileentityBase)((Object)this);
VillagerTradeManager.INSTANCE.setCurrentVillager(self.getVillagerEntity());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Inventory Profiles Next
*
* Copyright (c) 2022 Plamen K. Kosseff <p.kosseff@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.anti_ad.mc.ipnext.mixin;

import de.maxhenkel.easyvillagers.blocks.tileentity.TraderTileentityBase;
import net.minecraft.world.entity.player.Player;
import org.anti_ad.mc.ipnext.event.villagers.VillagerTradeManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(TraderTileentityBase.class)
class MixinTraderTileEntityBase {


@Inject(at = @At("HEAD"), method = "Lde/maxhenkel/easyvillagers/blocks/tileentity/TraderTileentityBase;openTradingGUI(" +
"Lnet/minecraft/world/entity/player/Player;)Z", remap = false)
public void openTradingGUI(Player playerEntity, CallbackInfoReturnable<Boolean> cir) {
TraderTileentityBase self = (TraderTileentityBase)((Object)this);
VillagerTradeManager.INSTANCE.setCurrentVillager(self.getVillagerEntity());
}

}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/


rootProject.name = "InventoryProfilesNext"
//rootProject.name = "InventoryProfilesNext"


include("platforms:fabric-1.20")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ public enum IPNButton {
SHOW_EDITOR,
SETTINGS,
VILLAGER_DO_GLOBAL_TRADES,
VILLAGER_DO_GLOBAL_TRADES1,
VILLAGER_DO_GLOBAL_TRADES2,
VILLAGER_DO_LOCAL_TRADES,
VILLAGER_DO_LOCAL_TRADES1,
VILLAGER_DO_LOCAL_TRADES2,
VILLAGER_GLOBAL_BOOKMARK,
VILLAGER_LOCAL_BOOKMARK,
}
Loading

0 comments on commit 24d8fdc

Please sign in to comment.