diff --git a/gradle.properties b/gradle.properties index 089567e..c093202 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ version_minecraft=1.16.3 version_forge_minecraft=1.16.3-34.1.0 version_fml_mappings=20200723-1.16.1 version_jei=1.16.3:7.3.2.36 -version_engineersdecor=1.1.3-b3 +version_engineersdecor=1.1.3 diff --git a/meta/update.json b/meta/update.json index 9248e40..496aa28 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.16.3": { + "1.1.3": "[R] Release build v1.1.3.", "1.1.3-b3": "[A] Metal Sliding Door added (double door wing style).\n[A] Doors implicitly open/close adjacent wings of double doors.\n[A] Disabled injected buttons from other mods in container GUIs.\n[A] Mob spawning on Rebar/Gas Concrete inhibited (IE Concrete Compliancy).\n[M] Small Tree Cutter chopping improved (loosened tree volume search restrictions).", "1.1.3-b2": "[A] Crafting table shift/ctrl click item move actions tweaked to new metal slot design.\n[A] Factory Dropper and Block Placer now also support quick-move-all (shift-ctrl-click).\n[F] Fixed Small Lab Furnace speed boost factor (with IE Heater in aux slot).", "1.1.3-b1": "[A] The Factory Block Breaker can insert items into Hoppers underneath it (issue #121, winsrp).\n[F] Help tooltips manually wrapped.\n[F] Fixed Labeled Crate item name persistence (issue #127, ty inqie).\n[F] Help text typo fixed (issue #129, ty Smollet777).", @@ -15,7 +16,7 @@ "1.1.2-b1": "[U] Ported to MC1.16.2." }, "promos": { - "1.16.3-recommended": "1.1.2", - "1.16.3-latest": "1.1.3-b3" + "1.16.3-recommended": "1.1.3", + "1.16.3-latest": "1.1.3" } } \ No newline at end of file diff --git a/readme.md b/readme.md index a8eb18e..e7d7aad 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.16.3. ## Version history + - v1.1.3 [R] Release build v1.1.3. + - v1.1.3-b3 [A] Metal Sliding Door added (double door wing style). [A] Doors implicitly open/close adjacent wings of double doors. [A] Disabled injected buttons from other mods in container GUIs. diff --git a/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java b/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java index 7396661..4cf1deb 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java @@ -387,6 +387,9 @@ public class EdFluidBarrel return (nbt.isEmpty()) ? (FluidStack.EMPTY) : (FluidStack.loadFluidStackFromNBT(nbt)); } + public static ItemStack setFluid(ItemStack stack, FluidStack fs) + { write_fluid_nbt(stack, fs.writeToNBT(new CompoundNBT())); return stack; } + @Override public int getItemStackLimit(ItemStack stack) { return (!getFluid(stack).isEmpty()) ? 1 : super.getItemStackLimit(stack); } @@ -406,6 +409,18 @@ public class EdFluidBarrel @Override public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) { return new Fluidics.FluidContainerItemCapabilityWrapper(stack, capacity_, item_fluid_handler_transfer_rate_, (s)->read_fluid_nbt(s), (s,n)->write_fluid_nbt(s,n), e->true); } + + @Override + public boolean hasContainerItem(ItemStack stack) + { return true; } + + @Override + public ItemStack getContainerItem(ItemStack stack) + { + FluidStack fs = getFluid(stack); + fs.shrink(1000); + return setFluid(stack, fs); + } } } diff --git a/src/main/java/wile/engineersdecor/libmc/detail/DataFixing.java b/src/main/java/wile/engineersdecor/libmc/detail/DataFixing.java new file mode 100644 index 0000000..0506476 --- /dev/null +++ b/src/main/java/wile/engineersdecor/libmc/detail/DataFixing.java @@ -0,0 +1,66 @@ +/* + * @file DataFixing.java + * @author Stefan Wilhelm (wile) + * @copyright (C) 2020 Stefan Wilhelm + * @license MIT (see https://opensource.org/licenses/MIT) + * + * Data fixing and mapping correction functionality encapsulation. + */ +package wile.engineersdecor.libmc.detail; + +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.event.RegistryEvent.MissingMappings.Mapping; +import net.minecraftforge.registries.ForgeRegistries; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; + +public class DataFixing +{ + private static String modid = ""; + private static Map item_registry_renaming = new HashMap<>(); + private static Map block_registry_renaming = new HashMap<>(); + + public static void init(String mod_id, @Nullable Map item_renaming, @Nullable Map block_renaming) + { + modid = mod_id; + block_registry_renaming = new HashMap<>(); + item_registry_renaming = new HashMap<>(); + if(item_renaming!=null) item_registry_renaming.putAll(item_renaming); + if(block_renaming!=null) { block_registry_renaming.putAll(block_renaming); item_registry_renaming.putAll(block_renaming); } + } + + public static void onDataFixMissingItemMapping(net.minecraftforge.event.RegistryEvent.MissingMappings event) + { + // Handler registered in main mod event subscription. + for(Mapping mapping: event.getMappings()) { + if(mapping.key.getNamespace() != modid) continue; + final String rm = item_registry_renaming.getOrDefault(mapping.key.getPath(), ""); + if(rm.isEmpty()) continue; + final Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(modid, rm)); + if((item==null) || (item==Items.AIR)) continue; + mapping.remap(item); + } + } + + public static void onDataFixMissingBlockMapping(net.minecraftforge.event.RegistryEvent.MissingMappings event) + { + // Handler registered in main mod event subscription. + for(Mapping mapping: event.getMappings()) { + if(mapping.key.getNamespace() != modid) continue; + final String rm = block_registry_renaming.getOrDefault(mapping.key.getPath(), ""); + if(rm.isEmpty()) continue; + final Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(modid, rm)); + if((block==null) || (block==Blocks.AIR)) continue; + mapping.remap(block); + } + } + + // @todo: Find a way to register blockstate data fixing. + +} diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/old_industrial_planks_recipe_vmirrored.json b/src/main/resources/data/engineersdecor/recipes/dependent/old_industrial_planks_recipe_vmirrored.json new file mode 100644 index 0000000..dcce363 --- /dev/null +++ b/src/main/resources/data/engineersdecor/recipes/dependent/old_industrial_planks_recipe_vmirrored.json @@ -0,0 +1,52 @@ +{ + "type": "forge:conditional", + "recipes": [ + { + "conditions": [ + { + "type": "engineersdecor:optional", + "result": "engineersdecor:old_industrial_wood_planks", + "required": ["#forge:treated_wood"] + } + ], + "recipe": { + "type": "minecraft:crafting_shaped", + "pattern": [ + "WW", + "WC" + ], + "key": { + "C": { "item": "minecraft:charcoal" }, + "W": { "tag" : "forge:treated_wood" } + }, + "result": { + "item": "engineersdecor:old_industrial_wood_planks", + "count": 4 + } + } + }, + { + "conditions": [ + { + "type": "engineersdecor:optional", + "result": "engineersdecor:old_industrial_wood_planks" + } + ], + "recipe": { + "type": "minecraft:crafting_shaped", + "pattern": [ + "WW", + "WC" + ], + "key": { + "C": { "item": "minecraft:charcoal" }, + "W": { "tag": "minecraft:planks" } + }, + "result": { + "item": "engineersdecor:old_industrial_wood_planks", + "count": 4 + } + } + } + ] +} \ No newline at end of file