From 48748a25c5581462f2360060239508e239c5977d Mon Sep 17 00:00:00 2001 From: stfwi Date: Sat, 17 Oct 2020 23:16:28 +0200 Subject: [PATCH] Metal Sliding Door added. Disabled injected buttons from other mods in container GUIs. Tree Cutter volume tracking restrictions relaxed to support trees with more branching. --- gradle.properties | 2 +- meta/update.json | 3 +- readme.md | 6 + .../java/wile/engineersdecor/ModContent.java | 69 +++++++---- .../blocks/EdCraftingTable.java | 4 +- .../engineersdecor/blocks/EdDoorBlock.java | 17 ++- .../wile/engineersdecor/blocks/EdDropper.java | 4 +- .../blocks/EdElectricalFurnace.java | 12 +- .../wile/engineersdecor/blocks/EdFurnace.java | 4 +- .../wile/engineersdecor/blocks/EdHopper.java | 4 +- .../engineersdecor/blocks/EdLabeledCrate.java | 4 +- .../wile/engineersdecor/blocks/EdPlacer.java | 14 +-- .../blocks/EdWasteIncinerator.java | 13 +- .../engineersdecor/detail/TreeCutting.java | 11 +- .../libmc/blocks/StandardBlocks.java | 17 +-- .../libmc/blocks/StandardDoorBlock.java | 101 +++++++++++++++- .../libmc/client/ContainerGui.java | 42 +++++++ .../libmc/detail/Auxiliaries.java | 1 - .../libmc/detail/TooltipDisplay.java | 2 - .../blockstates/metal_sliding_door.json | 37 ++++++ .../assets/engineersdecor/lang/en_us.json | 1 + .../assets/engineersdecor/lang/ru_ru.json | 1 + .../assets/engineersdecor/lang/zh_cn.json | 1 + ...etal_sliding_door_model_bottom_closed.json | 66 ++++++++++ .../metal_sliding_door_model_bottom_open.json | 70 +++++++++++ .../metal_sliding_door_model_inventory.json | 59 +++++++++ .../metal_sliding_door_model_top_closed.json | 113 ++++++++++++++++++ .../metal_sliding_door_model_top_open.json | 82 +++++++++++++ .../models/item/metal_sliding_door.json | 1 + .../metal_sliding_door_texture_bottom.png | Bin 0 -> 517 bytes .../door/metal_sliding_door_texture_side.png | Bin 0 -> 428 bytes .../door/metal_sliding_door_texture_top.png | Bin 0 -> 564 bytes .../blocks/metal_sliding_door.json | 20 ++++ .../metal_sliding_door_recipe.json | 30 +++++ 34 files changed, 732 insertions(+), 79 deletions(-) create mode 100644 src/main/java/wile/engineersdecor/libmc/client/ContainerGui.java create mode 100644 src/main/resources/assets/engineersdecor/blockstates/metal_sliding_door.json create mode 100644 src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_closed.json create mode 100644 src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_open.json create mode 100644 src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_inventory.json create mode 100644 src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_closed.json create mode 100644 src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_open.json create mode 100644 src/main/resources/assets/engineersdecor/models/item/metal_sliding_door.json create mode 100644 src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_bottom.png create mode 100644 src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_side.png create mode 100644 src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_top.png create mode 100644 src/main/resources/data/engineersdecor/loot_tables/blocks/metal_sliding_door.json create mode 100644 src/main/resources/data/engineersdecor/recipes/independent/metal_sliding_door_recipe.json diff --git a/gradle.properties b/gradle.properties index 547453b..089567e 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-b2 +version_engineersdecor=1.1.3-b3 diff --git a/meta/update.json b/meta/update.json index 97a8438..9248e40 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-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).", "1.1.2": "[U] Updated to Forge 1.16.3-34.1.0.\n[A] Added Factory Hopper insertion/extraction for entities like Minecarts (issue #125, ty boneskull).", @@ -15,6 +16,6 @@ }, "promos": { "1.16.3-recommended": "1.1.2", - "1.16.3-latest": "1.1.3-b2" + "1.16.3-latest": "1.1.3-b3" } } \ No newline at end of file diff --git a/readme.md b/readme.md index 001e278..a8eb18e 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,12 @@ Mod sources for Minecraft version 1.16.3. ## Version history + - 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. + [A] Mob spawning on Rebar/Gas Concrete inhibited (IE Concrete Compliancy). + [M] Small Tree Cutter chopping improved (loosened tree volume search restrictions). + - v1.1.3-b2 [A] Crafting table shift/ctrl click item move actions tweaked to new metal slot design. [A] Factory Dropper and Block Placer now also support quick-move-all (shift-ctrl-click). [F] Fixed Small Lab Furnace speed boost factor (with IE Heater in aux slot). diff --git a/src/main/java/wile/engineersdecor/ModContent.java b/src/main/java/wile/engineersdecor/ModContent.java index 65a9567..d5f3a52 100644 --- a/src/main/java/wile/engineersdecor/ModContent.java +++ b/src/main/java/wile/engineersdecor/ModContent.java @@ -12,15 +12,10 @@ */ package wile.engineersdecor; -import wile.engineersdecor.blocks.*; -import wile.engineersdecor.blocks.EdFurnace.FurnaceBlock; -import wile.engineersdecor.blocks.EdFurnace.FurnaceContainer; -import wile.engineersdecor.blocks.EdFurnace.FurnaceGui; -import wile.engineersdecor.blocks.EdFurnace.FurnaceTileEntity; -import wile.engineersdecor.items.EdItem; -import wile.engineersdecor.libmc.blocks.StandardBlocks; -import wile.engineersdecor.libmc.blocks.StandardBlocks.IStandardBlock; -import wile.engineersdecor.libmc.detail.Auxiliaries; +import net.minecraft.block.BlockState; +import net.minecraft.util.SoundEvents; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; import net.minecraft.block.material.MaterialColor; import net.minecraft.block.Block; import net.minecraft.block.SoundType; @@ -47,6 +42,16 @@ import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import org.apache.commons.lang3.ArrayUtils; +import wile.engineersdecor.blocks.*; +import wile.engineersdecor.blocks.EdFurnace.FurnaceBlock; +import wile.engineersdecor.blocks.EdFurnace.FurnaceContainer; +import wile.engineersdecor.blocks.EdFurnace.FurnaceGui; +import wile.engineersdecor.blocks.EdFurnace.FurnaceTileEntity; +import wile.engineersdecor.items.EdItem; +import wile.engineersdecor.libmc.blocks.StandardBlocks; +import wile.engineersdecor.libmc.blocks.StandardBlocks.IStandardBlock; +import wile.engineersdecor.libmc.detail.Auxiliaries; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -60,6 +65,10 @@ public class ModContent { private static final String MODID = ModEngineersDecor.MODID; + //-------------------------------------------------------------------------------------------------------------------- + + private static Boolean disallowSpawn(BlockState state, IBlockReader reader, BlockPos pos, EntityType entity) { return false; } + //-------------------------------------------------------------------------------------------------------------------- // Blocks //-------------------------------------------------------------------------------------------------------------------- @@ -134,86 +143,86 @@ public class ModContent public static final DecorBlock.Normal REBAR_CONCRETE_BLOCK = (DecorBlock.Normal)(new DecorBlock.Normal( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete")); public static final EdSlabBlock REBAR_CONCRETE_SLAB = (EdSlabBlock)(new EdSlabBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_slab")); public static final EdStairsBlock REBAR_CONCRETE_STAIRS = (EdStairsBlock)(new EdStairsBlock( DecorBlock.CFG_DEFAULT, REBAR_CONCRETE_BLOCK.getDefaultState(), - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_stairs")); public static final EdWallBlock REBAR_CONCRETE_WALL = (EdWallBlock)(new EdWallBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_wall")); public static final EdSlabSliceBlock HALFSLAB_REBARCONCRETE = (EdSlabSliceBlock)(new EdSlabSliceBlock( DecorBlock.CFG_CUTOUT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "halfslab_rebar_concrete")); // ------------------------------------------------------------------------------------------------------------------- public static final DecorBlock.Normal GAS_CONCRETE_BLOCK = (DecorBlock.Normal)(new DecorBlock.Normal( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "gas_concrete")); public static final EdSlabBlock GAS_CONCRETE_SLAB = (EdSlabBlock)(new EdSlabBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "gas_concrete_slab")); public static final EdStairsBlock GAS_CONCRETE_STAIRS = (EdStairsBlock)(new EdStairsBlock( DecorBlock.CFG_DEFAULT, REBAR_CONCRETE_BLOCK.getDefaultState(), - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "gas_concrete_stairs")); public static final EdWallBlock GAS_CONCRETE_WALL = (EdWallBlock)(new EdWallBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "gas_concrete_wall")); public static final EdSlabSliceBlock HALFSLAB_GASCONCRETE = (EdSlabSliceBlock)(new EdSlabSliceBlock( DecorBlock.CFG_CUTOUT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(1.5f, 10f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "halfslab_gas_concrete")); // ------------------------------------------------------------------------------------------------------------------- public static final DecorBlock.Normal REBAR_CONCRETE_TILE = (DecorBlock.Normal)(new DecorBlock.Normal( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile")); public static final EdSlabBlock REBAR_CONCRETE_TILE_SLAB = (EdSlabBlock)(new EdSlabBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile_slab")); public static final EdStairsBlock REBAR_CONCRETE_TILE_STAIRS = (EdStairsBlock)(new EdStairsBlock( DecorBlock.CFG_DEFAULT, REBAR_CONCRETE_TILE.getDefaultState(), - Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE) + Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(5f, 2000f).sound(SoundType.STONE).setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile_stairs")); // ------------------------------------------------------------------------------------------------------------------- public static final EdGlassBlock PANZERGLASS_BLOCK = (EdGlassBlock)(new EdGlassBlock( DecorBlock.CFG_TRANSLUCENT, - Block.Properties.create(Material.GLASS, MaterialColor.AIR).hardnessAndResistance(0.7f, 2000f).sound(SoundType.METAL).notSolid() + Block.Properties.create(Material.GLASS, MaterialColor.AIR).hardnessAndResistance(0.7f, 2000f).sound(SoundType.METAL).notSolid().setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "panzerglass_block")); public static final EdSlabBlock PANZERGLASS_SLAB = (EdSlabBlock)(new EdSlabBlock( DecorBlock.CFG_TRANSLUCENT, - Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(0.7f, 2000f).sound(SoundType.METAL).notSolid() + Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(0.7f, 2000f).sound(SoundType.METAL).notSolid().setAllowsSpawn(ModContent::disallowSpawn) )).setRegistryName(new ResourceLocation(MODID, "panzerglass_slab")); // ------------------------------------------------------------------------------------------------------------------- @@ -299,6 +308,14 @@ public class ModContent Auxiliaries.getPixeledAABB(0.5,1,0, 15.5,14.,2) )).setRegistryName(new ResourceLocation(MODID, "iron_hatch")); + public static final EdDoorBlock METAL_SLIDING_DOOR = (EdDoorBlock)(new EdDoorBlock( + DecorBlock.CFG_TRANSLUCENT|DecorBlock.CFG_HORIZIONTAL, + Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(1.5f, 12f).sound(SoundType.METAL).notSolid(), + Auxiliaries.getPixeledAABB(15,0,7, 16,16,9), + Auxiliaries.getPixeledAABB( 0,0,7, 16,16,9), + SoundEvents.BLOCK_IRON_DOOR_OPEN, SoundEvents.BLOCK_IRON_DOOR_CLOSE + )).setRegistryName(new ResourceLocation(MODID, "metal_sliding_door")); + // ------------------------------------------------------------------------------------------------------------------- public static final DecorBlock.Normal OLD_INDUSTRIAL_PLANKS = (DecorBlock.Normal)(new DecorBlock.Normal( @@ -324,7 +341,8 @@ public class ModContent public static final EdDoorBlock OLD_INDUSTRIAL_WOOD_DOOR = (EdDoorBlock)(new EdDoorBlock( DecorBlock.CFG_DEFAULT, - Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(1.5f, 12f).sound(SoundType.WOOD).notSolid() + Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(1.5f, 12f).sound(SoundType.WOOD).notSolid(), + SoundEvents.BLOCK_WOODEN_DOOR_OPEN, SoundEvents.BLOCK_WOODEN_DOOR_CLOSE )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_door")); // ------------------------------------------------------------------------------------------------------------------- @@ -921,6 +939,7 @@ public class ModContent METAL_RUNG_LADDER, METAL_RUNG_STEPS, TREATED_WOOD_LADDER, + METAL_SLIDING_DOOR, IRON_HATCH, OLD_INDUSTRIAL_PLANKS, OLD_INDUSTRIAL_SLAB, diff --git a/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java b/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java index f41b561..7d01a97 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java +++ b/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java @@ -34,7 +34,6 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.text.StringTextComponent; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.client.gui.widget.button.ImageButton; import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.renderer.ItemRenderer; @@ -48,6 +47,7 @@ import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.matrix.MatrixStack; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.libmc.client.ContainerGui; import wile.engineersdecor.libmc.detail.Auxiliaries; import wile.engineersdecor.libmc.detail.Inventories; import wile.engineersdecor.libmc.detail.Inventories.InventoryRange; @@ -1058,7 +1058,7 @@ public class EdCraftingTable //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class CraftingTableGui extends ContainerScreen + public static class CraftingTableGui extends ContainerGui { protected static final ResourceLocation BACKGROUND = new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/metal_crafting_table_gui.png"); protected final PlayerEntity player; diff --git a/src/main/java/wile/engineersdecor/blocks/EdDoorBlock.java b/src/main/java/wile/engineersdecor/blocks/EdDoorBlock.java index 193930b..bd893ce 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdDoorBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdDoorBlock.java @@ -4,19 +4,24 @@ * @copyright (C) 2020 Stefan Wilhelm * @license MIT (see https://opensource.org/licenses/MIT) * - * Door blocks. + * Blocks representing centered doors opening by sliding + * to the sides. */ package wile.engineersdecor.blocks; -import wile.engineersdecor.libmc.blocks.StandardDoorBlock; -import net.minecraft.util.Direction; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorldReader; +import net.minecraft.util.*; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.block.*; - +import wile.engineersdecor.libmc.blocks.StandardDoorBlock; public class EdDoorBlock extends StandardDoorBlock implements IDecorBlock { + public EdDoorBlock(long config, Block.Properties properties, AxisAlignedBB open_aabb, AxisAlignedBB closed_aabb, SoundEvent open_sound, SoundEvent close_sound) + { super(config, properties, open_aabb, closed_aabb, open_sound, close_sound); } + + public EdDoorBlock(long config, Block.Properties properties, SoundEvent open_sound, SoundEvent close_sound) + { super(config, properties, open_sound, close_sound); } + public EdDoorBlock(long config, Block.Properties properties) { super(config, properties); } } diff --git a/src/main/java/wile/engineersdecor/blocks/EdDropper.java b/src/main/java/wile/engineersdecor/blocks/EdDropper.java index f72daae..4dc37f3 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdDropper.java +++ b/src/main/java/wile/engineersdecor/blocks/EdDropper.java @@ -31,7 +31,6 @@ import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.Slot; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.util.math.shapes.ISelectionContext; @@ -53,6 +52,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.matrix.MatrixStack; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.libmc.client.ContainerGui; import wile.engineersdecor.libmc.detail.Auxiliaries; import wile.engineersdecor.libmc.detail.Inventories; import wile.engineersdecor.libmc.detail.Inventories.InventoryRange; @@ -885,7 +885,7 @@ public class EdDropper //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class DropperGui extends ContainerScreen + public static class DropperGui extends ContainerGui { protected final PlayerEntity player_; protected final TooltipDisplay tooltip_ = new TooltipDisplay(); diff --git a/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java b/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java index a2eb525..03ca6bd 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java +++ b/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java @@ -10,10 +10,6 @@ package wile.engineersdecor.blocks; import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.util.text.TranslationTextComponent; -import wile.engineersdecor.ModContent; -import wile.engineersdecor.ModEngineersDecor; -import wile.engineersdecor.libmc.detail.Inventories; -import wile.engineersdecor.libmc.detail.Networking; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraft.block.BlockState; @@ -41,7 +37,6 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.inventory.*; import net.minecraft.inventory.container.*; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.stats.Stats; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -54,8 +49,13 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import com.mojang.blaze3d.systems.RenderSystem; +import wile.engineersdecor.ModContent; +import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.libmc.detail.TooltipDisplay; import wile.engineersdecor.libmc.detail.TooltipDisplay.TipRange; +import wile.engineersdecor.libmc.client.ContainerGui; +import wile.engineersdecor.libmc.detail.Inventories; +import wile.engineersdecor.libmc.detail.Networking; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -782,7 +782,7 @@ public class EdElectricalFurnace //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class ElectricalFurnaceGui extends ContainerScreen + public static class ElectricalFurnaceGui extends ContainerGui { protected final PlayerEntity player_; protected final TooltipDisplay tooltip_ = new TooltipDisplay(); diff --git a/src/main/java/wile/engineersdecor/blocks/EdFurnace.java b/src/main/java/wile/engineersdecor/blocks/EdFurnace.java index 72a149d..ceaee30 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFurnace.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFurnace.java @@ -12,6 +12,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.detail.ExternalObjects; +import wile.engineersdecor.libmc.client.ContainerGui; import wile.engineersdecor.libmc.detail.Inventories; import wile.engineersdecor.libmc.detail.Networking; import net.minecraft.tileentity.*; @@ -19,7 +20,6 @@ import net.minecraft.inventory.container.*; import net.minecraft.item.crafting.AbstractCookingRecipe; import net.minecraft.item.crafting.IRecipeType; import net.minecraft.block.RedstoneTorchBlock; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.entity.item.ExperienceOrbEntity; import net.minecraft.item.crafting.FurnaceRecipe; import net.minecraft.item.crafting.IRecipe; @@ -980,7 +980,7 @@ public class EdFurnace //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class FurnaceGui extends ContainerScreen + public static class FurnaceGui extends ContainerGui { protected final PlayerEntity player_; diff --git a/src/main/java/wile/engineersdecor/blocks/EdHopper.java b/src/main/java/wile/engineersdecor/blocks/EdHopper.java index cca1d74..2798860 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdHopper.java +++ b/src/main/java/wile/engineersdecor/blocks/EdHopper.java @@ -36,7 +36,6 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.text.*; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraftforge.fml.network.NetworkHooks; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -49,6 +48,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.libmc.client.ContainerGui; import wile.engineersdecor.libmc.detail.Auxiliaries; import wile.engineersdecor.libmc.detail.Inventories; import wile.engineersdecor.libmc.detail.Networking; @@ -837,7 +837,7 @@ public class EdHopper //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class HopperGui extends ContainerScreen + public static class HopperGui extends ContainerGui { protected final PlayerEntity player_; protected final TooltipDisplay tooltip_ = new TooltipDisplay(); diff --git a/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java b/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java index dd2025a..461b141 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java +++ b/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java @@ -11,6 +11,7 @@ package wile.engineersdecor.blocks; import wile.engineersdecor.ModContent; import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.libmc.blocks.StandardBlocks; +import wile.engineersdecor.libmc.client.ContainerGui; import wile.engineersdecor.libmc.detail.Auxiliaries; import wile.engineersdecor.libmc.detail.Inventories.InventoryRange; import wile.engineersdecor.libmc.detail.Networking; @@ -42,7 +43,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SUpdateTileEntityPacket; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.client.util.ITooltipFlag; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -698,7 +698,7 @@ public class EdLabeledCrate //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class LabeledCrateGui extends ContainerScreen + public static class LabeledCrateGui extends ContainerGui { protected final PlayerEntity player_; diff --git a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java index a06a25a..88d1425 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java +++ b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java @@ -11,11 +11,6 @@ package wile.engineersdecor.blocks; import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.inventory.container.ClickType; import net.minecraft.util.math.vector.Vector3d; -import wile.engineersdecor.ModContent; -import wile.engineersdecor.ModEngineersDecor; -import wile.engineersdecor.libmc.detail.Auxiliaries; -import wile.engineersdecor.libmc.detail.Inventories.InventoryRange; -import wile.engineersdecor.libmc.detail.Networking; import net.minecraft.block.*; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; @@ -35,7 +30,6 @@ import net.minecraft.inventory.*; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.Slot; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.util.text.ITextComponent; @@ -57,6 +51,12 @@ import net.minecraftforge.fml.network.NetworkHooks; import com.mojang.blaze3d.systems.RenderSystem; import wile.engineersdecor.libmc.detail.TooltipDisplay; import wile.engineersdecor.libmc.detail.TooltipDisplay.TipRange; +import wile.engineersdecor.libmc.client.ContainerGui; +import wile.engineersdecor.libmc.detail.Auxiliaries; +import wile.engineersdecor.libmc.detail.Inventories.InventoryRange; +import wile.engineersdecor.libmc.detail.Networking; +import wile.engineersdecor.ModContent; +import wile.engineersdecor.ModEngineersDecor; import javax.annotation.Nullable; import java.util.ArrayList; @@ -738,7 +738,7 @@ public class EdPlacer //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class PlacerGui extends ContainerScreen + public static class PlacerGui extends ContainerGui { protected final PlayerEntity player_; protected final TooltipDisplay tooltip_ = new TooltipDisplay(); diff --git a/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java b/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java index b2edbaf..c8a0fd9 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java +++ b/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java @@ -9,10 +9,6 @@ package wile.engineersdecor.blocks; import com.mojang.blaze3d.matrix.MatrixStack; -import wile.engineersdecor.ModContent; -import wile.engineersdecor.ModEngineersDecor; -import wile.engineersdecor.blocks.EdFurnace.FurnaceBlock; -import wile.engineersdecor.libmc.detail.Inventories; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.entity.player.ServerPlayerEntity; @@ -36,7 +32,6 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.SoundEvents; import net.minecraft.item.*; import net.minecraft.inventory.*; -import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; @@ -53,6 +48,12 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import com.mojang.blaze3d.systems.RenderSystem; +import wile.engineersdecor.ModContent; +import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.blocks.EdFurnace.FurnaceBlock; +import wile.engineersdecor.libmc.client.ContainerGui; +import wile.engineersdecor.libmc.detail.Inventories; + import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; @@ -687,7 +688,7 @@ public class EdWasteIncinerator //-------------------------------------------------------------------------------------------------------------------- @OnlyIn(Dist.CLIENT) - public static class WasteIncineratorGui extends ContainerScreen + public static class WasteIncineratorGui extends ContainerGui { protected final PlayerEntity player_; diff --git a/src/main/java/wile/engineersdecor/detail/TreeCutting.java b/src/main/java/wile/engineersdecor/detail/TreeCutting.java index 8ac6e57..77d057f 100644 --- a/src/main/java/wile/engineersdecor/detail/TreeCutting.java +++ b/src/main/java/wile/engineersdecor/detail/TreeCutting.java @@ -77,7 +77,7 @@ public class TreeCutting { if(world.isRemote || !isLog(broken_state)) return 0; final long ymin = startPos.getY(); - final long max_leaf_distance = 6; + final long max_leaf_distance = 8; Set checked = new HashSet(); ArrayList to_break = new ArrayList(); ArrayList to_decay = new ArrayList(); @@ -89,7 +89,7 @@ public class TreeCutting LinkedList upqueue = new LinkedList(); queue.add(startPos); int cutlevel = 0; - int steps_left = 64; + int steps_left = 128; while(!queue.isEmpty() && (--steps_left >= 0)) { final BlockPos pos = queue.removeFirst(); // Vertical search @@ -101,7 +101,7 @@ public class TreeCutting // Up is log upqueue.add(uppos); to_break.add(uppos); - steps_left = 64; + steps_left = 128; } else { boolean isleaf = isLeaves(upstate); if(isleaf || world.isAirBlock(uppos) || (upstate.getBlock() instanceof VineBlock)) { @@ -128,13 +128,14 @@ public class TreeCutting final BlockPos p = pos.add(v); if(checked.contains(p)) continue; checked.add(p); - if(p.distanceSq(new BlockPos(startPos.getX(), p.getY(), startPos.getZ())) > (3+cutlevel*cutlevel)) continue; + if(p.distanceSq(new BlockPos(startPos.getX(), p.getY(), startPos.getZ())) > (cutlevel > 2 ? 256 : 9)) continue; final BlockState st = world.getBlockState(p); final Block bl = st.getBlock(); if(isSameLog(st, broken_state)) { queue.add(p); to_break.add(p); } else if(isLeaves(st)) { + queue.add(p); to_decay.add(p); } } @@ -157,7 +158,7 @@ public class TreeCutting final ArrayList leafs = to_decay; to_decay = new ArrayList(); for(BlockPos pos:leafs) { - int dist = 2; + int dist = 3; to_decay.add(pos); to_decay.addAll(findBlocksAround(world, pos, leaf_type_state, checked, dist)); } diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java index fdc9084..89dcd99 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java @@ -83,7 +83,15 @@ public class StandardBlocks enum RenderTypeHint { SOLID,CUTOUT,CUTOUT_MIPPED,TRANSLUCENT,TRANSLUCENT_NO_CRUMBLING } default RenderTypeHint getRenderTypeHint() - { return RenderTypeHint.SOLID; } + { return getRenderTypeHint(config()); } + + default RenderTypeHint getRenderTypeHint(long config) + { + if((config & CFG_CUTOUT)!=0) return RenderTypeHint.CUTOUT; + if((config & CFG_MIPPED)!=0) return RenderTypeHint.CUTOUT_MIPPED; + if((config & CFG_TRANSLUCENT)!=0) return RenderTypeHint.TRANSLUCENT; + return RenderTypeHint.SOLID; + } } public interface IBlockItemFactory @@ -136,12 +144,7 @@ public class StandardBlocks @Override public RenderTypeHint getRenderTypeHint() - { - if((config & CFG_CUTOUT)!=0) return RenderTypeHint.CUTOUT; - if((config & CFG_MIPPED)!=0) return RenderTypeHint.CUTOUT_MIPPED; - if((config & CFG_TRANSLUCENT)!=0) return RenderTypeHint.TRANSLUCENT; - return RenderTypeHint.SOLID; - } + { return getRenderTypeHint(config); } @Override @SuppressWarnings("deprecation") diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardDoorBlock.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardDoorBlock.java index 8685ccf..33d44ab 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardDoorBlock.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardDoorBlock.java @@ -10,13 +10,24 @@ package wile.engineersdecor.libmc.blocks; import net.minecraft.entity.EntitySpawnPlacementRegistry; import net.minecraft.entity.EntityType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.state.properties.DoorHingeSide; +import net.minecraft.state.properties.DoubleBlockHalf; +import net.minecraft.util.*; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.block.*; import net.minecraft.block.BlockState; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import wile.engineersdecor.libmc.detail.Auxiliaries; @@ -27,10 +38,74 @@ import java.util.List; public class StandardDoorBlock extends DoorBlock implements StandardBlocks.IStandardBlock { - private final long config; + private final long config_; + protected final VoxelShape shapes_[][][]; + protected final SoundEvent open_sound_; + protected final SoundEvent close_sound_; + + public StandardDoorBlock(long config, Block.Properties properties, AxisAlignedBB open_aabb, AxisAlignedBB closed_aabb, SoundEvent open_sound, SoundEvent close_sound) + { + super(properties); + VoxelShape shapes[][][] = new VoxelShape[Direction.values().length][2][2]; + for(Direction facing: Direction.values()) { + for(boolean open: new boolean[]{false,true}) { + for(boolean hinge_right: new boolean[]{false,true}) { + if(facing.getAxis() == Axis.Y) { + shapes[facing.ordinal()][open?1:0][hinge_right?1:0] = VoxelShapes.fullCube(); + } else { + AxisAlignedBB aabb = Auxiliaries.getRotatedAABB(open ? open_aabb : closed_aabb, facing, true); + if(!hinge_right) aabb = Auxiliaries.getMirroredAABB(aabb, facing.rotateY().getAxis()); + shapes[facing.ordinal()][open?1:0][hinge_right?1:0] = VoxelShapes.create(aabb); + } + } + } + } + config_ = config; + shapes_ = shapes; + open_sound_ = open_sound; + close_sound_ = close_sound; + } + + public StandardDoorBlock(long config, Block.Properties properties, SoundEvent open_sound, SoundEvent close_sound) + { + this( + config, properties, + Auxiliaries.getPixeledAABB(13,0, 0, 16,16,16), + Auxiliaries.getPixeledAABB( 0,0,13, 16,16,16), + open_sound, + close_sound + ); + } public StandardDoorBlock(long config, Block.Properties properties) - { super(properties); this.config = config; } + { + this( + config, properties, + Auxiliaries.getPixeledAABB(13,0, 0, 16,16,16), + Auxiliaries.getPixeledAABB( 0,0,13, 16,16,16), + SoundEvents.BLOCK_WOODEN_DOOR_OPEN, + SoundEvents.BLOCK_WOODEN_DOOR_CLOSE + ); + } + + @Override + public long config() + { return config_; } + + protected void sound(IBlockReader world, BlockPos pos, boolean open) + { if(world instanceof World) ((World)world).playSound(null, pos, open ? open_sound_ : close_sound_, SoundCategory.BLOCKS, 0.7f, 1f); } + + protected void actuate_adjacent_wing(BlockState state, IBlockReader world_ro, BlockPos pos, boolean open) + { + if(!(world_ro instanceof World)) return; + final World world = (World)world_ro; + final BlockPos adjecent_pos = pos.offset( (state.get(HINGE)==DoorHingeSide.LEFT) ? (state.get(FACING).rotateY()) : (state.get(FACING).rotateYCCW())); + if(!world.isBlockPresent(adjecent_pos)) return; + BlockState adjacent_state = world.getBlockState(adjecent_pos); + if(adjacent_state.getBlock()!=this) return; + if(adjacent_state.get(OPEN)==open) return; + world.setBlockState(adjecent_pos, adjacent_state.with(OPEN, open), 2|10); + } @Override @OnlyIn(Dist.CLIENT) @@ -44,4 +119,26 @@ public class StandardDoorBlock extends DoorBlock implements StandardBlocks.IStan @Override public boolean canCreatureSpawn(BlockState state, IBlockReader world, BlockPos pos, EntitySpawnPlacementRegistry.PlacementType type, @Nullable EntityType entityType) { return false; } + + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) + { return shapes_[state.get(FACING).ordinal()][state.get(OPEN)?1:0][state.get(HINGE)==DoorHingeSide.RIGHT?1:0]; } + + public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) + { + boolean open = !state.get(OPEN); + state = state.with(OPEN, open); + world.setBlockState(pos, state, 2|8); + sound(world, pos, open); + actuate_adjacent_wing(state, world, pos, open); + return world.isRemote ? ActionResultType.SUCCESS : ActionResultType.CONSUME; + } + + public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) + { + boolean powered = world.isBlockPowered(pos) || world.isBlockPowered(pos.offset(state.get(HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN)); + if((block == this) || (powered == state.get(POWERED))) return; + world.setBlockState(pos, state.with(POWERED, powered).with(OPEN, powered), 2); + actuate_adjacent_wing(state, world, pos, powered); + if(powered != state.get(OPEN)) sound(world, pos, powered); + } } diff --git a/src/main/java/wile/engineersdecor/libmc/client/ContainerGui.java b/src/main/java/wile/engineersdecor/libmc/client/ContainerGui.java new file mode 100644 index 0000000..2fe1639 --- /dev/null +++ b/src/main/java/wile/engineersdecor/libmc/client/ContainerGui.java @@ -0,0 +1,42 @@ +package wile.engineersdecor.libmc.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.IGuiEventListener; +import net.minecraft.client.gui.IHasContainer; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; +import net.minecraft.client.gui.widget.Widget; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Container; +import net.minecraft.util.text.ITextComponent; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +@OnlyIn(Dist.CLIENT) +public abstract class ContainerGui extends ContainerScreen implements IHasContainer +{ + public ContainerGui(T screenContainer, PlayerInventory inv, ITextComponent titleIn) + { super(screenContainer, inv, titleIn); } + + protected boolean canHaveDisturbingButtonsFromOtherMods() + { return false; } + + public void init(Minecraft minecraft, int width, int height) + { + this.minecraft = minecraft; + this.itemRenderer = minecraft.getItemRenderer(); + this.font = minecraft.fontRenderer; + this.width = width; + this.height = height; + java.util.function.Consumer remove = (b) -> { buttons.remove(b); children.remove(b); }; + if((!canHaveDisturbingButtonsFromOtherMods()) || (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.buttons, this::addButton, remove)))) { + this.buttons.clear(); + this.children.clear(); + this.setListener((IGuiEventListener)null); + this.init(); + } + if(canHaveDisturbingButtonsFromOtherMods()) { + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.buttons, this::addButton, remove)); + } + } + +} diff --git a/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java b/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java index 1c8c780..073996b 100644 --- a/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java +++ b/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java @@ -11,7 +11,6 @@ package wile.engineersdecor.libmc.detail; import net.minecraft.client.util.InputMappings; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.INBT; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.SharedConstants; diff --git a/src/main/java/wile/engineersdecor/libmc/detail/TooltipDisplay.java b/src/main/java/wile/engineersdecor/libmc/detail/TooltipDisplay.java index 3b12d18..e1752c9 100644 --- a/src/main/java/wile/engineersdecor/libmc/detail/TooltipDisplay.java +++ b/src/main/java/wile/engineersdecor/libmc/detail/TooltipDisplay.java @@ -10,7 +10,6 @@ package wile.engineersdecor.libmc.detail; import com.mojang.blaze3d.matrix.MatrixStack; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.inventory.container.Container; import net.minecraft.util.math.MathHelper; @@ -20,7 +19,6 @@ import net.minecraftforge.api.distmarker.OnlyIn; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; diff --git a/src/main/resources/assets/engineersdecor/blockstates/metal_sliding_door.json b/src/main/resources/assets/engineersdecor/blockstates/metal_sliding_door.json new file mode 100644 index 0000000..060cda7 --- /dev/null +++ b/src/main/resources/assets/engineersdecor/blockstates/metal_sliding_door.json @@ -0,0 +1,37 @@ +{"variants":{ + "facing=east,half=lower,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 90 }, + "facing=east,half=lower,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 90 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 90 }, + "facing=east,half=upper,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 90 }, + + "facing=north,half=lower,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 180 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 180 }, + "facing=north,half=lower,hinge=right,open=false":{ "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 0 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 0 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 180 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 180 }, + "facing=north,half=upper,hinge=right,open=false":{ "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 0 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 0 }, + + "facing=south,half=lower,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 0 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 0 }, + "facing=south,half=lower,hinge=right,open=false":{ "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 180 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 180 }, + "facing=south,half=upper,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 0 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 0 }, + "facing=south,half=upper,hinge=right,open=false":{ "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 180 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 180 }, + + "facing=west,half=lower,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 90 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_closed", "y": 270 }, + "facing=west,half=lower,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_bottom_open" , "y": 270 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 90 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_closed" , "y": 270 }, + "facing=west,half=upper,hinge=right,open=true": { "model": "engineersdecor:block/door/metal_sliding_door_model_top_open" , "y": 270 } +}} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/lang/en_us.json b/src/main/resources/assets/engineersdecor/lang/en_us.json index bd5dd59..58a4243 100644 --- a/src/main/resources/assets/engineersdecor/lang/en_us.json +++ b/src/main/resources/assets/engineersdecor/lang/en_us.json @@ -160,6 +160,7 @@ "block.engineersdecor.metal_rung_ladder.help": "Typical industrial wall ladder,\n consisting of horizontal metal\n rod rungs. Look up/down to climb\n faster.", "block.engineersdecor.metal_rung_steps": "Staggered Metal Steps", "block.engineersdecor.metal_rung_steps.help": "Staggered rod rungs affixed to a\n wall, allowing to climb up, fall\n down, and so on. Look up/down\n to climb faster.", + "block.engineersdecor.metal_sliding_door": "Metal Sliding Door", "block.engineersdecor.old_industrial_wood_door": "Old Industrial Wood Door", "block.engineersdecor.old_industrial_wood_planks": "Old Industrial Wood Planks", "block.engineersdecor.old_industrial_wood_slab": "Old Industrial Wood Slab", diff --git a/src/main/resources/assets/engineersdecor/lang/ru_ru.json b/src/main/resources/assets/engineersdecor/lang/ru_ru.json index c98251e..d1e3d64 100644 --- a/src/main/resources/assets/engineersdecor/lang/ru_ru.json +++ b/src/main/resources/assets/engineersdecor/lang/ru_ru.json @@ -160,6 +160,7 @@ "block.engineersdecor.metal_rung_ladder.help": "§6Типичная промышленная настенная лестница, состоящая из горизонтальных металлических стержней.§r Смотри вверх/вниз, чтобы подняться быстрее.", "block.engineersdecor.metal_rung_steps": "Настенные металлические ступеньки", "block.engineersdecor.metal_rung_steps.help": "§6Металлические ступеньки, крепятся к стене. Позволяют подниматься/спускаться.§r Смотри вверх/вниз, чтобы подняться быстрее.", + "block.engineersdecor.metal_sliding_door": "Metal Sliding Door", "block.engineersdecor.old_industrial_wood_door": "Old Industrial Wood Door", "block.engineersdecor.old_industrial_wood_planks": "Old Industrial Wood Planks", "block.engineersdecor.old_industrial_wood_slab": "Old Industrial Wood Slab", diff --git a/src/main/resources/assets/engineersdecor/lang/zh_cn.json b/src/main/resources/assets/engineersdecor/lang/zh_cn.json index 24402b4..74e9693 100644 --- a/src/main/resources/assets/engineersdecor/lang/zh_cn.json +++ b/src/main/resources/assets/engineersdecor/lang/zh_cn.json @@ -160,6 +160,7 @@ "block.engineersdecor.metal_rung_ladder.help": "§6典型的工业墙梯,由水平的金属杆蹬组成。§r往上/下看会爬得更快。", "block.engineersdecor.metal_rung_steps": "交错金属台阶", "block.engineersdecor.metal_rung_steps.help": "§6贴在墙上的交错金属杆蹬,能够爬上或爬下。§r往上/下看会爬得更快。", + "block.engineersdecor.metal_sliding_door": "Metal Sliding Door", "block.engineersdecor.old_industrial_wood_door": "Old Industrial Wood Door", "block.engineersdecor.old_industrial_wood_planks": "Old Industrial Wood Planks", "block.engineersdecor.old_industrial_wood_slab": "Old Industrial Wood Slab", diff --git a/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_closed.json b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_closed.json new file mode 100644 index 0000000..e69c228 --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_closed.json @@ -0,0 +1,66 @@ +{ + "ambientocclusion": false, + "textures": { + "bottom": "engineersdecor:block/door/metal_sliding_door_texture_bottom", + "particle": "engineersdecor:block/door/metal_sliding_door_texture_side" + }, + "elements": [ + { + "from": [0, 0, 7], + "to": [16, 16, 9], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#bottom"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#particle"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#bottom"}, + "west": {"uv": [14, 0, 16, 16], "texture": "#particle"}, + "down": {"uv": [0, 1, 16, 3], "texture": "#particle"} + } + }, + { + "from": [15, 0, 6], + "to": [16, 16, 7], + "faces": { + "north": {"uv": [0, 0, 1, 16], "texture": "#bottom"}, + "east": {"uv": [15, 0, 16, 16], "texture": "#particle"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#bottom"}, + "down": {"uv": [15, 9, 16, 10], "rotation": 270, "texture": "#particle"} + } + }, + { + "from": [0, 0, 6], + "to": [15, 0.25, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "north": {"uv": [1, 15, 16, 16], "texture": "#bottom"}, + "east": {"uv": [9, 15, 10, 16], "texture": "#particle"}, + "south": {"uv": [0, 15, 15, 16], "texture": "#particle"}, + "west": {"uv": [6, 15, 7, 16], "texture": "#bottom"}, + "up": {"uv": [0, 1, 15, 2], "texture": "#particle"}, + "down": {"uv": [0, 15, 15, 16], "texture": "#particle"} + } + }, + { + "from": [0, 0, 9], + "to": [15, 0.25, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 11]}, + "faces": { + "north": {"uv": [1, 15, 16, 16], "texture": "#bottom"}, + "east": {"uv": [9, 15, 10, 16], "texture": "#particle"}, + "south": {"uv": [0, 15, 15, 16], "texture": "#particle"}, + "west": {"uv": [6, 15, 7, 16], "texture": "#bottom"}, + "up": {"uv": [0, 1, 15, 2], "texture": "#particle"}, + "down": {"uv": [0, 15, 15, 16], "texture": "#particle"} + } + }, + { + "from": [15, 0, 9], + "to": [16, 16, 10], + "faces": { + "east": {"uv": [13, 0, 14, 16], "texture": "#particle"}, + "south": {"uv": [15, 0, 16, 16], "texture": "#bottom"}, + "west": {"uv": [14, 0, 15, 16], "texture": "#particle"}, + "down": {"uv": [15, 6, 16, 7], "rotation": 270, "texture": "#particle"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_open.json b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_open.json new file mode 100644 index 0000000..536c537 --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_bottom_open.json @@ -0,0 +1,70 @@ +{ + "ambientocclusion": false, + "textures": { + "bottom": "engineersdecor:block/door/metal_sliding_door_texture_bottom", + "particle": "engineersdecor:block/door/metal_sliding_door_texture_side" + }, + "elements": [ + { + "from": [14.75, 0.25, 7], + "to": [15, 16, 9], + "faces": { + "north": {"uv": [1, 0, 1.25, 15.75], "texture": "#bottom"}, + "east": {"uv": [7, 0, 9, 15.75], "texture": "#particle"}, + "south": {"uv": [14.75, 0, 15, 15.75], "texture": "#bottom"}, + "west": {"uv": [14, 0, 16, 15.75], "texture": "#particle"}, + "down": {"uv": [14.75, 7, 15, 9], "texture": "#particle"} + } + }, + { + "from": [15, 0, 6], + "to": [16, 16, 10], + "faces": { + "north": {"uv": [0, 0, 1, 16], "texture": "#bottom"}, + "east": {"uv": [6, 0, 10, 16], "texture": "#particle"}, + "south": {"uv": [15, 0, 16, 16], "texture": "#particle"}, + "west": {"uv": [6, 0, 10, 16], "texture": "#particle"}, + "down": {"uv": [15, 6, 16, 10], "rotation": 270, "texture": "#particle"} + } + }, + { + "from": [0, 0, 6], + "to": [15, 0.25, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "north": {"uv": [1, 15.75, 16, 16], "texture": "#bottom"}, + "east": {"uv": [9, 15.75, 10, 16], "texture": "#particle"}, + "south": {"uv": [0, 15.75, 15, 16], "texture": "#particle"}, + "west": {"uv": [6, 15.75, 7, 16], "texture": "#bottom"}, + "up": {"uv": [0, 6, 15, 7], "texture": "#particle"}, + "down": {"uv": [0, 9, 15, 10], "texture": "#particle"} + } + }, + { + "from": [0, 0, 9], + "to": [15, 0.25, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 11]}, + "faces": { + "north": {"uv": [1, 15.75, 16, 16], "texture": "#bottom"}, + "east": {"uv": [9, 15.75, 10, 16], "texture": "#particle"}, + "south": {"uv": [0, 15.75, 15, 16], "texture": "#particle"}, + "west": {"uv": [6, 15.75, 7, 16], "texture": "#bottom"}, + "up": {"uv": [0, 6, 15, 7], "texture": "#particle"}, + "down": {"uv": [0, 9, 15, 10], "texture": "#particle"} + } + }, + { + "from": [0, 0, 7], + "to": [15, 0.0625, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 10]}, + "faces": { + "north": {"uv": [1, 15.75, 16, 16], "texture": "#bottom"}, + "east": {"uv": [7, 15.75, 9, 16], "texture": "#particle"}, + "south": {"uv": [0, 15.75, 15, 16], "texture": "#particle"}, + "west": {"uv": [7, 15.75, 9, 16], "texture": "#bottom"}, + "up": {"uv": [0, 7, 15, 9], "texture": "#particle"}, + "down": {"uv": [0, 7, 15, 9], "texture": "#particle"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_inventory.json b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_inventory.json new file mode 100644 index 0000000..6b7b7ab --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_inventory.json @@ -0,0 +1,59 @@ +{ + "parent": "block/block", + "ambientocclusion": false, + "textures": { + "bottom": "engineersdecor:block/door/metal_sliding_door_texture_bottom", + "top": "engineersdecor:block/door/metal_sliding_door_texture_top", + "particle": "engineersdecor:block/door/metal_sliding_door_texture_side" + }, + "elements": [ + { + "from": [7.25, 8, 3.5], + "to": [8.75, 16, 11.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7.5]}, + "faces": { + "north": {"uv": [0, 0, 3, 16], "texture": "#particle"}, + "east": {"uv": [16, 0, 0, 16], "texture": "#top"}, + "south": {"uv": [13, 0, 16, 16], "texture": "#particle"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#top"}, + "up": {"uv": [0, 0, 16, 3], "rotation": 270, "texture": "#particle"} + } + }, + { + "from": [7.25, 0, 3.5], + "to": [8.75, 8, 11.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7.5]}, + "faces": { + "north": {"uv": [0, 0, 3, 16], "texture": "#particle"}, + "east": {"uv": [16, 0, 0, 16], "texture": "#bottom"}, + "south": {"uv": [13, 0, 16, 16], "texture": "#particle"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#bottom"}, + "down": {"uv": [0, 13, 16, 16], "rotation": 90, "texture": "#particle"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [6, 88, 39], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_righthand": { + "rotation": [-4, 27, 0], + "translation": [2.25, 0, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 1.75, 0], + "scale": [0.4, 0.4, 0.4] + }, + "gui": { + "rotation": [0, 90, 0], + "translation": [0, 0.25, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [0, 90, 0] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_closed.json b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_closed.json new file mode 100644 index 0000000..8bb95ff --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_closed.json @@ -0,0 +1,113 @@ +{ + "ambientocclusion": false, + "textures": { + "top": "engineersdecor:block/door/metal_sliding_door_texture_top", + "particle": "engineersdecor:block/door/metal_sliding_door_texture_side", + "g": "engineersdecor:block/glass/panzerglass_block_texture0" + }, + "elements": [ + { + "from": [12, 0, 7], + "to": [16, 16, 9], + "faces": { + "north": {"uv": [0, 0, 4, 16], "texture": "#top"}, + "east": {"uv": [13, 0, 15, 16], "texture": "#particle"}, + "south": {"uv": [12, 0, 16, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#particle"}, + "up": {"uv": [12, 1, 16, 3], "texture": "#particle"} + } + }, + { + "from": [0, 0, 7], + "to": [4, 16, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [-4, 8, 8]}, + "faces": { + "north": {"uv": [12, 0, 16, 16], "texture": "#top"}, + "east": {"uv": [13, 0, 15, 16], "texture": "#particle"}, + "south": {"uv": [0, 0, 4, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#particle"}, + "up": {"uv": [0, 1, 4, 3], "texture": "#particle"} + } + }, + { + "from": [4, 12, 7], + "to": [12, 16, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 8, 8]}, + "faces": { + "north": {"uv": [4, 0, 12, 4], "texture": "#top"}, + "south": {"uv": [4, 0, 12, 4], "texture": "#top"}, + "up": {"uv": [4, 1, 12, 3], "texture": "#particle"}, + "down": {"uv": [4, 13, 12, 15], "texture": "#top"} + } + }, + { + "from": [4, 0, 7], + "to": [12, 1, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, 8]}, + "faces": { + "north": {"uv": [4, 15, 12, 16], "texture": "#top"}, + "east": {"uv": [13, 15, 15, 16], "texture": "#particle"}, + "south": {"uv": [4, 15, 12, 16], "texture": "#top"}, + "west": {"uv": [1, 15, 3, 16], "texture": "#particle"}, + "up": {"uv": [4, 1, 12, 3], "texture": "#particle"} + } + }, + { + "from": [4, 1, 7], + "to": [12, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -2, 8.5]}, + "faces": { + "north": {"uv": [4, 4, 12, 15], "texture": "#g"}, + "south": {"uv": [4, 4, 12, 15], "texture": "#g"} + } + }, + { + "from": [0, 15.5, 6], + "to": [15, 16, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "texture": "#top"}, + "east": {"uv": [2.5, 0, 3, 1], "texture": "#particle"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#top"}, + "west": {"uv": [13, 0, 13.5, 1], "texture": "#particle"}, + "up": {"uv": [2.5, 0, 3, 16], "rotation": 270, "texture": "#particle"}, + "down": {"uv": [2.5, 0, 3, 16], "rotation": 90, "texture": "#particle"} + } + }, + { + "from": [0, 15.5, 9], + "to": [15, 16, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "east": {"uv": [6, 0, 7, 0.25], "texture": "#particle"}, + "south": {"uv": [1, 0, 16, 0.25], "texture": "#top"}, + "west": {"uv": [9, 0, 10, 0.25], "texture": "#particle"}, + "up": {"uv": [1, 15, 16, 16], "texture": "#particle"}, + "down": {"uv": [1, 0, 16, 1], "texture": "#particle"} + } + }, + { + "from": [15, 0, 6], + "to": [16, 16, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [23, 8, 8]}, + "faces": { + "north": {"uv": [15, 1, 16, 16], "texture": "#top"}, + "east": {"uv": [2.5, 1, 3, 16], "texture": "#particle"}, + "south": {"uv": [0, 1, 1, 16], "texture": "#top"}, + "west": {"uv": [13, 1, 13.5, 16], "texture": "#particle"}, + "up": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#particle"} + } + }, + { + "from": [15, 0, 9], + "to": [16, 16, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [23, 8, 8]}, + "faces": { + "east": {"uv": [0, 1, 0.5, 16], "texture": "#particle"}, + "south": {"uv": [0, 1, 1, 16], "texture": "#top"}, + "west": {"uv": [15.5, 1, 16, 16], "texture": "#particle"}, + "up": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#particle"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_open.json b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_open.json new file mode 100644 index 0000000..4bbd6d1 --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/block/door/metal_sliding_door_model_top_open.json @@ -0,0 +1,82 @@ +{ + "ambientocclusion": false, + "textures": { + "top": "engineersdecor:block/door/metal_sliding_door_texture_top", + "particle": "engineersdecor:block/door/metal_sliding_door_texture_side" + }, + "elements": [ + { + "from": [14.75, 0, 7], + "to": [16, 16, 9], + "faces": { + "north": {"uv": [14.75, 0, 16, 16], "texture": "#top"}, + "east": {"uv": [1, 0, 3, 16], "texture": "#particle"}, + "south": {"uv": [0, 0, 1.25, 16], "texture": "#top"}, + "west": {"uv": [14, 0, 16, 16], "texture": "#particle"}, + "up": {"uv": [14.75, 7, 16, 9], "texture": "#particle"} + } + }, + { + "from": [0, 15.5, 6], + "to": [15, 16, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "texture": "#top"}, + "east": {"uv": [2.5, 0, 3, 1], "texture": "#particle"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#top"}, + "west": {"uv": [13, 0, 13.5, 1], "texture": "#particle"}, + "up": {"uv": [2.5, 0, 3, 16], "rotation": 270, "texture": "#particle"}, + "down": {"uv": [2.5, 0, 3, 16], "rotation": 90, "texture": "#particle"} + } + }, + { + "from": [0, 15.75, 7], + "to": [15, 16, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 9]}, + "faces": { + "north": {"uv": [1, 0, 16, 0.5], "texture": "#top"}, + "east": {"uv": [7, 0, 9, 0.5], "texture": "#particle"}, + "south": {"uv": [0, 0, 15, 0.5], "texture": "#top"}, + "west": {"uv": [7, 0, 9, 0.5], "texture": "#particle"}, + "up": {"uv": [1, 0, 16, 2], "texture": "#particle"}, + "down": {"uv": [1, 14, 16, 16], "texture": "#particle"} + } + }, + { + "from": [0, 15.5, 9], + "to": [15, 16, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 15, 0.5], "texture": "#top"}, + "east": {"uv": [6, 0, 7, 0.25], "texture": "#particle"}, + "south": {"uv": [1, 0, 16, 0.25], "texture": "#top"}, + "west": {"uv": [9, 0, 10, 0.25], "texture": "#particle"}, + "up": {"uv": [1, 15, 16, 16], "texture": "#particle"}, + "down": {"uv": [1, 0, 16, 1], "texture": "#particle"} + } + }, + { + "from": [15, 0, 6], + "to": [16, 16, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [23, 8, 8]}, + "faces": { + "north": {"uv": [15, 1, 16, 16], "texture": "#top"}, + "east": {"uv": [2.5, 1, 3, 16], "texture": "#particle"}, + "south": {"uv": [0, 1, 1, 16], "texture": "#top"}, + "west": {"uv": [13, 1, 13.5, 16], "texture": "#particle"}, + "up": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#particle"} + } + }, + { + "from": [15, 0, 9], + "to": [16, 16, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [23, 8, 8]}, + "faces": { + "east": {"uv": [0, 1, 0.5, 16], "texture": "#particle"}, + "south": {"uv": [0, 1, 1, 16], "texture": "#top"}, + "west": {"uv": [15.5, 1, 16, 16], "texture": "#particle"}, + "up": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#particle"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/models/item/metal_sliding_door.json b/src/main/resources/assets/engineersdecor/models/item/metal_sliding_door.json new file mode 100644 index 0000000..cf07c1a --- /dev/null +++ b/src/main/resources/assets/engineersdecor/models/item/metal_sliding_door.json @@ -0,0 +1 @@ +{ "parent": "engineersdecor:block/door/metal_sliding_door_model_inventory" } \ No newline at end of file diff --git a/src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_bottom.png b/src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..c625fa5adc8f5b139c0580ae8c81c64ba3be33e6 GIT binary patch literal 517 zcmV+g0{Z=lP)a>F1DMV|y1CzCtm z61o3VgOJ| z37@{Ysm6q=dad=|QB_3bQvNLv5n5~E)!jLcBN(NW0LYKWgE?n-T_esp8Dp>*i3qh; z09tF9*#)up9(TUf*THSusI@Z2h@AA^DWx#RxPStBjKTByL_{VEcb`bk(7F2uNj+SzSN6xuhzQ0QWab}HYnZmy zreFnMRZsQUql*a44BfWv&=FvaacG#CQ;%x8EDP?Ao~^3{J<~%~X|0i&pEcIRySxh0GgNg_jR;<^ z*GH3xpf;hZm>KK3GRBxuMA)_s5ux`!{Sgu9`~9ALB7&mSduLe|L}Vtf>w54&MDPQ7 W+d{ET|1{hH0000 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_top.png b/src/main/resources/assets/engineersdecor/textures/block/door/metal_sliding_door_texture_top.png new file mode 100644 index 0000000000000000000000000000000000000000..f9fb8d0234626c05bc36356d2b476acfe06deeb7 GIT binary patch literal 564 zcmV-40?Yl0P)O9KZko010qNS#tmY4!{5a4!{9w)`k%oYm>tCyFc2}2KFRkfd3bopQVIaAHQXIDqm)8K z0FareDq{>(m59LI_p_?X{rx?q6qaS7_l}6nT|}lpW&$wA;BvX}{QSHN04&RbnbCWv zltOEbF~JJlZptqt_bX+nJmllzmntfxKaghSt!?@b?kc?XJGI97`##ndITcE zwr#v$`yk0RhQ!^c)$WcSBRUC_^SH55{r5XTGn*n2fgbRB?`+$KAk(t9%f`!$BLWfG z1>Bv8;D8B#;^X5NdhaaDg1b-O4^FDe?d|P+Z2tf_q&xy^3(BPc0000