diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 14:44:52 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 14:44:59 +0800 |
| commit | 9f5a9eae9a7863412cc5eb433bf15e5ee71da616 (patch) | |
| tree | 0e6b0b94af061c5e9023b1ff19f339a6c30149be | |
| parent | 3e3e25855b9f6df507a7d4c8a07c64b9a502fae2 (diff) | |
| download | RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.tar.gz RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.tar.bz2 RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.zip | |
3.2.1
75 files changed, 2435 insertions, 1126 deletions
diff --git a/build.gradle b/build.gradle index e0d273c5b..d998b6d22 100755 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,6 @@ static def buildTime() { license { header rootProject.file('HEADER') include '**/*.java' - exclude '**/Scissors.java' } repositories { @@ -56,7 +55,7 @@ dependencies { modImplementation("me.shedaniel.cloth:config-2:${cloth_config_version}") { transitive = false } - modApi("me.shedaniel.cloth:fiber2cloth:1.2.0") { + modApi("me.shedaniel.cloth:fiber2cloth:1.2.1") { transitive = false } modApi "me.zeroeightsix:fiber:0.6.0-7" @@ -68,7 +67,7 @@ dependencies { include("me.shedaniel.cloth:config-2:${cloth_config_version}") { transitive = false } - include("me.shedaniel.cloth:fiber2cloth:1.2.0") { + include("me.shedaniel.cloth:fiber2cloth:1.2.1") { transitive = false } include "me.zeroeightsix:fiber:0.6.0-7" @@ -84,6 +83,15 @@ task sourcesJar(type: Jar, dependsOn: classes) { from sourceSets.main.allSource } +task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) { + classifier = "maven" + afterEvaluate { + input = file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar") +// archiveName = "${archivesBaseName}-${version}-maven.jar" + addNestedDependencies = false + } +} + publishing { publications { mavenJava(MavenPublication) { diff --git a/gradle.properties b/gradle.properties index 691d1fcce..dc5057377 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=3.1.8-unstable +mod_version=3.2.1-unstable minecraft_version=19w44a yarn_version=19w44a+build.3 fabricloader_version=0.6.3+build.168 diff --git a/src/main/java/com/zeitheron/hammercore/client/utils/Scissors.java b/src/main/java/com/zeitheron/hammercore/client/utils/Scissors.java deleted file mode 100644 index c32053447..000000000 --- a/src/main/java/com/zeitheron/hammercore/client/utils/Scissors.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.zeitheron.hammercore.client.utils; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.util.Window; -import org.lwjgl.opengl.GL11; - -/** - * This is originally the part of Hammer Lib, repacked in REI with permission. - * Adapted GL scissor for minecraft pixel resolution and adjusts (0;0) as left-top corner. - * - * @author Zeitheron - */ -public class Scissors { - /** - * Starts the scissor test - */ - public static void begin() { - GL11.glEnable(GL11.GL_SCISSOR_TEST); - } - - /** - * Setup the scissor bounds - * - * @param x the top left x coordinates - * @param y the top left y coordinates - * @param width the width of the bounds - * @param height the height of the bounds - */ - public static void scissor(int x, int y, int width, int height) { - Window window = MinecraftClient.getInstance().getWindow(); - - int sw = window.getWidth(); - int sh = window.getHeight(); - float dw = window.getScaledWidth(); - float dh = window.getScaledHeight(); - - x = Math.round(sw * (x / dw)); - y = Math.round(sh * (y / dh)); - - width = Math.round(sw * (width / dw)); - height = Math.round(sh * (height / dh)); - - GL11.glScissor(x, sh - height - y, width, height); - } - - /** - * Stops the scissor test - */ - public static void end() { - GL11.glDisable(GL11.GL_SCISSOR_TEST); - } -}
\ No newline at end of file diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index 1b6d91e5b..dc65ed688 100644 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -136,9 +136,10 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer { registerClothEvents(); discoverPluginEntries(); - FabricLoader.getInstance().getAllMods().stream().map(ModContainer::getMetadata).filter(metadata -> metadata.containsCustomValue("roughlyenoughitems:plugins")).forEach(modMetadata -> { - RoughlyEnoughItemsCore.LOGGER.error("[REI] REI plugin from " + modMetadata.getId() + " is not loaded because it is too old!"); - }); + for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) { + if (modContainer.getMetadata().containsCustomValue("roughlyenoughitems:plugins")) + RoughlyEnoughItemsCore.LOGGER.error("[REI] REI plugin from " + modContainer.getMetadata().getId() + " is not loaded because it is too old!"); + } ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, (packetContext, packetByteBuf) -> { ItemStack stack = packetByteBuf.readItemStack(); diff --git a/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/src/main/java/me/shedaniel/rei/api/ClientHelper.java index 458379457..b72e86ea0 100644 --- a/src/main/java/me/shedaniel/rei/api/ClientHelper.java +++ b/src/main/java/me/shedaniel/rei/api/ClientHelper.java @@ -55,28 +55,40 @@ public interface ClientHelper { void registerFabricKeyBinds(); /** - * Tries to cheat items using either packets or commands. + * Tries to cheat stack using either packets or commands. * * @param stack the stack to cheat in * @return whether it failed */ - boolean tryCheatingStack(ItemStack stack); + boolean tryCheatingEntry(EntryStack stack); + + default boolean tryCheatingStack(ItemStack stack) { + return tryCheatingEntry(EntryStack.create(stack)); + } /** - * Finds recipe for the item and opens the recipe screen. + * Finds recipe for the stack and opens the recipe screen. * * @param stack the stack to find recipe for * @return whether the stack has any recipes to show */ - boolean executeRecipeKeyBind(ItemStack stack); + boolean executeRecipeKeyBind(EntryStack stack); + + default boolean executeRecipeKeyBind(ItemStack stack) { + return executeRecipeKeyBind(EntryStack.create(stack)); + } /** - * Finds usage for the item and opens the recipe screen. + * Finds usage for the stack and opens the recipe screen. * * @param stack the stack to find usage for * @return whether the stack has any usages to show */ - boolean executeUsageKeyBind(ItemStack stack); + boolean executeUsageKeyBind(EntryStack stack); + + default boolean executeUsageKeyBind(ItemStack stack) { + return executeUsageKeyBind(EntryStack.create(stack)); + } FabricKeyBinding getFocusSearchFieldKeyBinding(); diff --git a/src/main/java/me/shedaniel/rei/api/Entry.java b/src/main/java/me/shedaniel/rei/api/Entry.java index fca8f9fd2..c0eb609bb 100644 --- a/src/main/java/me/shedaniel/rei/api/Entry.java +++ b/src/main/java/me/shedaniel/rei/api/Entry.java @@ -5,6 +5,7 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.api.annotations.ToBeRemoved; import me.shedaniel.rei.impl.FluidEntry; import me.shedaniel.rei.impl.ItemStackEntry; import net.minecraft.fluid.Fluid; @@ -12,7 +13,9 @@ import net.minecraft.item.ItemStack; import javax.annotation.Nullable; -public interface Entry { +@Deprecated +@ToBeRemoved +public interface Entry extends Cloneable { @SuppressWarnings("deprecation") static Entry create(ItemStack itemStack) { return new ItemStackEntry(itemStack); @@ -31,6 +34,18 @@ public interface Entry { @Nullable Fluid getFluid(); + Entry clone(); + + default EntryStack toEntryStack() { + if (getEntryType() == Type.ITEM) + return EntryStack.create(getItemStack()); + if (getEntryType() == Type.FLUID) + return EntryStack.create(getFluid()); + return EntryStack.empty(); + } + + boolean equalsEntry(Entry other, boolean checkTags); + public static enum Type { ITEM, FLUID } diff --git a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java index effd1c8a4..9a811a127 100644 --- a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java +++ b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java @@ -5,10 +5,13 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.api.annotations.ToBeRemoved; +import me.shedaniel.rei.utils.CollectionUtils; import net.minecraft.fluid.Fluid; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import java.util.Collections; import java.util.List; public interface EntryRegistry { @@ -18,7 +21,17 @@ public interface EntryRegistry { * * @return an unmodifiable item list */ - List<Entry> getEntryList(); + @Deprecated + default List<Entry> getEntryList() { + return Collections.unmodifiableList(getModifiableEntryList()); + } + + /** + * Gets the current modifiable stacks list + * + * @return a stacks list + */ + List<EntryStack> getStacksList(); /** * Gets the current modifiable item list @@ -26,7 +39,9 @@ public interface EntryRegistry { * @return an modifiable item list */ @Deprecated - List<Entry> getModifiableEntryList(); + default List<Entry> getModifiableEntryList() { + return CollectionUtils.map(getStacksList(), EntryStack::toEntry); + } /** * Gets all possible stacks from an item @@ -42,31 +57,66 @@ public interface EntryRegistry { * @param afterItem the stack to put after * @param stack the stack to register */ - void registerItemStack(Item afterItem, ItemStack stack); + @Deprecated + default void registerItemStack(Item afterItem, ItemStack stack) |
