From 9e3f9cb1808a0b55d9b11caa54f2f9bf398c801f Mon Sep 17 00:00:00 2001 From: Yoghurt4C Date: Mon, 21 Sep 2020 14:23:00 +0300 Subject: [PATCH] Removed code. --- .gitignore | 1 + build.gradle | 5 +++-- gradle.properties | 13 +++++++------ .../mods/ltr/compat/libcd/LTRLibCDInitializer.java | 12 +++++------- .../compat/libcd/LilTaterTradeOfferTweaker.java | 14 ++++++-------- .../data/ltr/diskettes/irritated_lil_tater.js | 10 ++++++++++ .../data/ltr/tweakers/irritated_lil_tater.js | 10 ---------- src/main/resources/fabric.mod.json | 2 +- 8 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 src/main/resources/data/ltr/diskettes/irritated_lil_tater.js delete mode 100644 src/main/resources/data/ltr/tweakers/irritated_lil_tater.js diff --git a/.gitignore b/.gitignore index 75d72b9..4abe3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build/ out/ classes/ +logs/ # idea diff --git a/build.gradle b/build.gradle index c11ed24..46f1e15 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ minecraft { repositories { maven { url = "https://maven.fabricmc.net/" } maven { url = "https://jitpack.io" } - maven { url "https://server.bbkr.space/artifactory/libs-release" } + //maven { url "https://server.bbkr.space/artifactory/libs-release" } flatDir { dirs "libs" @@ -43,7 +43,8 @@ dependencies { //modImplementation "ninjaphenix.ninjatips:NinjaTips:1.0.31.15" //modImplementation "java.io.github.giantnuker.fabric.tooltipwrap:tooltipwrap:1.0.2" modImplementation "com.github.Vexatos:Flamingo:${project.flamingo_version}" - //modImplementation "io.github.cottonmc:LibCD:${project.libcd_version}" + modImplementation "io.github.cottonmc:LibDP:${project.libcd_version}" + modImplementation "io.github.cottonmc:Parchment:${project.parchment_version}" modImplementation "com.github.lambdaurora:spruceui:${project.spruceui_version}" modImplementation "com.github.lambdaurora.LambdaControls:fabric:${project.lambdacontrols_version}" } diff --git a/gradle.properties b/gradle.properties index 98497e6..7cab5d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,21 +3,22 @@ org.gradle.jvmargs=-Xmx4G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.16.2-pre1 - yarn_mappings=1.16.2-pre1+build.5 - loader_version=0.9.0+build.204 + minecraft_version=1.16.2 + yarn_mappings=1.16.2+build.6 + loader_version=0.9.1+build.205 # Mod Properties - mod_version = 1.1.8 + mod_version = 1.1.9 #maven_group = net.fabricmc archives_base_name = LilTaterReloaded # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.16.3+build.390-1.16 + fabric_version=0.17.2+build.396-1.16 mod_menu_version=1.12.2+build.17 rei_version=5.0.1-unstable flamingo_version=v1.17 - libcd_version=2.4.1+1.16-pre2 + libcd_version=1.1.0+1.16.2-dev + parchment_version=1.1.01.16.2-dev spruceui_version=1.5.2 lambdacontrols_version=1.3.2 diff --git a/src/main/java/mods/ltr/compat/libcd/LTRLibCDInitializer.java b/src/main/java/mods/ltr/compat/libcd/LTRLibCDInitializer.java index f9b3ea6..248dd5f 100644 --- a/src/main/java/mods/ltr/compat/libcd/LTRLibCDInitializer.java +++ b/src/main/java/mods/ltr/compat/libcd/LTRLibCDInitializer.java @@ -1,13 +1,11 @@ -/* package mods.ltr.compat.libcd; -import io.github.cottonmc.libcd.api.LibCDInitializer; -import io.github.cottonmc.libcd.api.tweaker.TweakerManager; +import io.github.cottonmc.libdp.api.DriverInitializer; +import io.github.cottonmc.libdp.api.driver.DriverManager; -public class LTRLibCDInitializer implements LibCDInitializer { +public class LTRLibCDInitializer implements DriverInitializer { @Override - public void initTweakers(TweakerManager manager) { + public void init(DriverManager manager) { manager.addAssistant("mods.ltr.compat.libcd.LilTaterTradeOfferTweaker", new LilTaterTradeOfferTweaker()); } -} - */ \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/mods/ltr/compat/libcd/LilTaterTradeOfferTweaker.java b/src/main/java/mods/ltr/compat/libcd/LilTaterTradeOfferTweaker.java index daa8660..6057a11 100644 --- a/src/main/java/mods/ltr/compat/libcd/LilTaterTradeOfferTweaker.java +++ b/src/main/java/mods/ltr/compat/libcd/LilTaterTradeOfferTweaker.java @@ -1,10 +1,9 @@ -/* package mods.ltr.compat.libcd; -import blue.endless.jankson.JsonObject; -import io.github.cottonmc.libcd.api.tweaker.Tweaker; -import io.github.cottonmc.libcd.api.tweaker.recipe.RecipeParser; -import io.github.cottonmc.libcd.api.tweaker.recipe.RecipeTweaker; +import com.google.gson.JsonObject; +import io.github.cottonmc.libdp.api.driver.Driver; +import io.github.cottonmc.libdp.api.driver.recipe.RecipeDriver; +import io.github.cottonmc.libdp.api.driver.recipe.RecipeParser; import mods.ltr.registry.LilTaterTradeOffers; import net.minecraft.item.ItemStack; import net.minecraft.resource.ResourceManager; @@ -17,7 +16,7 @@ import static mods.ltr.registry.LilTaterTradeOffers.tradeOffers; -public class LilTaterTradeOfferTweaker implements Tweaker { +public class LilTaterTradeOfferTweaker implements Driver { @Override public void prepareReload(ResourceManager resourceManager) { @@ -43,7 +42,7 @@ public void addTradeOffer(String profession, int profession_level, Object buyObj ItemStack buy = RecipeParser.processItemStack(buyObj); ItemStack second_buy = RecipeParser.processItemStack(secondBuyObj); ItemStack sell = RecipeParser.processItemStack(sellObj); - String id = RecipeTweaker.INSTANCE.getRecipeId(sell).toString(); + String id = RecipeDriver.INSTANCE.getRecipeId(sell).toString(); VillagerProfession prof = Registry.VILLAGER_PROFESSION.get(new Identifier(profession)); if (prof == VillagerProfession.NONE) { throw new Exception(); } LilTaterTradeOffers.LTRTradeOfferFactory tradeOfferFactory = new LilTaterTradeOffers.LTRTradeOfferFactory(buy, second_buy, sell, maxUses, experience, multiplier); @@ -61,4 +60,3 @@ public void removeTradeOffer(String id) { } } } - */ \ No newline at end of file diff --git a/src/main/resources/data/ltr/diskettes/irritated_lil_tater.js b/src/main/resources/data/ltr/diskettes/irritated_lil_tater.js new file mode 100644 index 0000000..2556711 --- /dev/null +++ b/src/main/resources/data/ltr/diskettes/irritated_lil_tater.js @@ -0,0 +1,10 @@ +var DriverUtils = diskette.require("libdp.util.DriverUtils"); +var TradeOfferTweaker = diskette.require("mods.ltr.compat.libcd.LilTaterTradeOfferTweaker"); + +var irritater = DriverUtils.newStack("ltr:lil_tater", 1); + irritater.setName("Irritated Lil Tater"); +var potion = DriverUtils.newStack("minecraft:potion",1); + potion.setTagValue("Potion","minecraft:harming"); + +TradeOfferTweaker.addTradeOffer("minecraft:farmer", 3, + "ltr:lil_tater", potion, irritater, 4, 10, 0.05); \ No newline at end of file diff --git a/src/main/resources/data/ltr/tweakers/irritated_lil_tater.js b/src/main/resources/data/ltr/tweakers/irritated_lil_tater.js deleted file mode 100644 index f6e57b1..0000000 --- a/src/main/resources/data/ltr/tweakers/irritated_lil_tater.js +++ /dev/null @@ -1,10 +0,0 @@ -var TweakerUtils = libcd.require("libcd.util.TweakerUtils"); -var TradeOfferTweaker = libcd.require("mods.ltr.compat.libcd.LilTaterTradeOfferTweaker"); - -var irritater = TweakerUtils.createItemStack("ltr:lil_tater", 1); - irritater = TweakerUtils.setName(irritater,"Irritated Lil Tater"); -var potion = TweakerUtils.createItemStack("minecraft:potion",1); - potion = TweakerUtils.addNbtToStack(potion, "{Potion: \"minecraft:harming\"}"); - -TradeOfferTweaker.addTradeOffer("minecraft:farmer", 3, - "ltr:lil_tater", potion, irritater, 4, 10, 0.05); \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c27be41..f75fb48 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ "rei_plugins_v0": [ "mods.ltr.compat.rei.LilTaterReloadedREIPlugin" ], - "libcd": [ + "libdp": [ "mods.ltr.compat.libcd.LTRLibCDInitializer" ] },