From 36118a36f536762a6c019c77c1df7f028bb31aa4 Mon Sep 17 00:00:00 2001 From: Abdel Date: Sun, 8 Sep 2024 18:51:31 +0200 Subject: [PATCH 1/2] hell yeah --- .../jei/ItemTransformationRecipeCategory.java | 9 ++------- .../gui/sprites/container/furnace/empty_arrow.png | Bin 0 -> 173 bytes 2 files changed, 2 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/assets/modjam/textures/gui/sprites/container/furnace/empty_arrow.png diff --git a/src/main/java/com/portingdeadmods/modjam/compat/jei/ItemTransformationRecipeCategory.java b/src/main/java/com/portingdeadmods/modjam/compat/jei/ItemTransformationRecipeCategory.java index 28a99346..f1036284 100644 --- a/src/main/java/com/portingdeadmods/modjam/compat/jei/ItemTransformationRecipeCategory.java +++ b/src/main/java/com/portingdeadmods/modjam/compat/jei/ItemTransformationRecipeCategory.java @@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable; public class ItemTransformationRecipeCategory implements IRecipeCategory { - private static final ResourceLocation BURN_PROGRESS_SPRITE = ResourceLocation.withDefaultNamespace("container/furnace/burn_progress"); + private static final ResourceLocation BURN_PROGRESS_SPRITE = ResourceLocation.fromNamespaceAndPath(ModJam.MODID,"container/furnace/empty_arrow"); public static final ResourceLocation UID = ResourceLocation.fromNamespaceAndPath(ModJam.MODID, "item_transformation"); public static final RecipeType RECIPE_TYPE = new RecipeType<>(UID, ItemTransformationRecipe.class); @@ -56,9 +56,8 @@ public IDrawable getBackground() { @Override public void draw(ItemTransformationRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY); - guiGraphics.blitSprite(BURN_PROGRESS_SPRITE, 0, 0, 24, 16); + guiGraphics.blitSprite(BURN_PROGRESS_SPRITE, 28, 0, 24, 16); } - @Override public void setRecipe(IRecipeLayoutBuilder builder, ItemTransformationRecipe recipe, IFocusGroup focuses) { //Just one input slot, an arrow and an output slot @@ -66,8 +65,4 @@ public void setRecipe(IRecipeLayoutBuilder builder, ItemTransformationRecipe rec builder.addSlot(RecipeIngredientRole.OUTPUT, 64, 0).addItemStack(recipe.getResultItem(null)); } - public static void drawImg(GuiGraphics guiGraphics, ResourceLocation texturePath, int x, int y, int width, int height) { - guiGraphics.blit(texturePath, x, y, 0, 0, 0, width, height, width, height); - } - } diff --git a/src/main/resources/assets/modjam/textures/gui/sprites/container/furnace/empty_arrow.png b/src/main/resources/assets/modjam/textures/gui/sprites/container/furnace/empty_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..116926b5be21974b2f0bc975bbad607b685b39c0 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^5ECy(_nuU~3`p2|QR2Z|ZWfQduDi2;G5x-f Vq$qWI<9nc$44$rjF6*2UngG_9J`w-` literal 0 HcmV?d00001 From 05b182b929d8f87c7e91cdaa8c1b8454ea9186ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?igl=C3=A9e42?= Date: Sun, 8 Sep 2024 22:03:16 +0200 Subject: [PATCH 2/2] Adding Crate - It can be open with a crowbar - When broke when it's closed, it keep the loot - When broke when it's open, it drop the loot and stay open when replaced - Rusty Version (can be changed with debug stick) - Can be broke with an axe and a pickaxe --- .../41a2d86d7e58f5ff289dc10f1d54cfe65982de55 | 4 +- .../5db5b310cf1abc4c7f33d2d565e2a2290a7f6c4d | 4 +- .../7383b985a2cdbb3a068dc5fd3ae4ba545545c370 | 5 +- .../assets/modjam/blockstates/crate.json | 16 ++ .../modjam/models/block/rusty_crate.json | 9 + .../modjam/models/block/rusty_crate_open.json | 9 + .../assets/modjam/models/item/crate.json | 3 + .../assets/modjam/models/item/crowbar.json | 6 + .../minecraft/tags/block/mineable/axe.json | 5 + .../tags/block/mineable/pickaxe.json | 5 + .../com/portingdeadmods/modjam/ModJam.java | 1 + .../modjam/client/screen/CrateScreen.java | 34 +++ .../blockentities/CrateBlockEntity.java | 152 +++++++++++ .../modjam/content/blocks/CrateBlock.java | 186 ++++++++++++++ .../modjam/data/MJDataComponents.java | 4 + .../modjam/datagen/BlockModelProvider.java | 23 ++ .../modjam/datagen/BlockTagProvider.java | 6 + .../modjam/datagen/ItemModelProvider.java | 1 + .../modjam/events/MJClientEvents.java | 8 + .../modjam/inventory/CrateMenu.java | 94 +++++++ .../modjam/registries/MJBlockEntityTypes.java | 4 + .../modjam/registries/MJBlocks.java | 4 + .../modjam/registries/MJItems.java | 2 + .../modjam/registries/MJMenuTypes.java | 32 +++ .../resources/assets/modjam/lang/en_us.json | 2 + .../assets/modjam/models/block/crate.json | 238 ++++++++++++++++++ .../modjam/models/block/crate_open.json | 238 ++++++++++++++++++ .../modjam/textures/block/crate/base.png | Bin 0 -> 1961 bytes .../modjam/textures/block/crate/rusty.png | Bin 0 -> 2045 bytes .../modjam/textures/block/crate/rusty_top.png | Bin 0 -> 2056 bytes .../textures/block/crate/rusty_top_inner.png | Bin 0 -> 2124 bytes .../modjam/textures/block/crate/top.png | Bin 0 -> 1965 bytes .../modjam/textures/block/crate/top_inner.png | Bin 0 -> 2120 bytes .../assets/modjam/textures/item/crowbar.png | Bin 0 -> 1761 bytes .../data/modjam/loot_table/blocks/crate.json | 29 +++ 35 files changed, 1121 insertions(+), 3 deletions(-) create mode 100644 src/generated/resources/assets/modjam/blockstates/crate.json create mode 100644 src/generated/resources/assets/modjam/models/block/rusty_crate.json create mode 100644 src/generated/resources/assets/modjam/models/block/rusty_crate_open.json create mode 100644 src/generated/resources/assets/modjam/models/item/crate.json create mode 100644 src/generated/resources/assets/modjam/models/item/crowbar.json create mode 100644 src/generated/resources/data/minecraft/tags/block/mineable/axe.json create mode 100644 src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json create mode 100644 src/main/java/com/portingdeadmods/modjam/client/screen/CrateScreen.java create mode 100644 src/main/java/com/portingdeadmods/modjam/content/blockentities/CrateBlockEntity.java create mode 100644 src/main/java/com/portingdeadmods/modjam/content/blocks/CrateBlock.java create mode 100644 src/main/java/com/portingdeadmods/modjam/inventory/CrateMenu.java create mode 100644 src/main/java/com/portingdeadmods/modjam/registries/MJMenuTypes.java create mode 100644 src/main/resources/assets/modjam/models/block/crate.json create mode 100644 src/main/resources/assets/modjam/models/block/crate_open.json create mode 100644 src/main/resources/assets/modjam/textures/block/crate/base.png create mode 100644 src/main/resources/assets/modjam/textures/block/crate/rusty.png create mode 100644 src/main/resources/assets/modjam/textures/block/crate/rusty_top.png create mode 100644 src/main/resources/assets/modjam/textures/block/crate/rusty_top_inner.png create mode 100644 src/main/resources/assets/modjam/textures/block/crate/top.png create mode 100644 src/main/resources/assets/modjam/textures/block/crate/top_inner.png create mode 100644 src/main/resources/assets/modjam/textures/item/crowbar.png create mode 100644 src/main/resources/data/modjam/loot_table/blocks/crate.json diff --git a/src/generated/resources/.cache/41a2d86d7e58f5ff289dc10f1d54cfe65982de55 b/src/generated/resources/.cache/41a2d86d7e58f5ff289dc10f1d54cfe65982de55 index cf7900af..c73612eb 100644 --- a/src/generated/resources/.cache/41a2d86d7e58f5ff289dc10f1d54cfe65982de55 +++ b/src/generated/resources/.cache/41a2d86d7e58f5ff289dc10f1d54cfe65982de55 @@ -1 +1,3 @@ -// 1.21.1 2024-09-06T15:44:54.6497465 Tags for minecraft:block mod id modjam +// 1.21.1 2024-09-08T21:50:31.0045618 Tags for minecraft:block mod id modjam +4f2c21d55cdc7aae6eb4ca328cb46cd52b6837c1 data/minecraft/tags/block/mineable/axe.json +4f2c21d55cdc7aae6eb4ca328cb46cd52b6837c1 data/minecraft/tags/block/mineable/pickaxe.json diff --git a/src/generated/resources/.cache/5db5b310cf1abc4c7f33d2d565e2a2290a7f6c4d b/src/generated/resources/.cache/5db5b310cf1abc4c7f33d2d565e2a2290a7f6c4d index ab9af2ee..0ad77f1f 100644 --- a/src/generated/resources/.cache/5db5b310cf1abc4c7f33d2d565e2a2290a7f6c4d +++ b/src/generated/resources/.cache/5db5b310cf1abc4c7f33d2d565e2a2290a7f6c4d @@ -1,8 +1,10 @@ -// 1.21.1 2024-09-08T11:01:34.5874471 Item Models: modjam +// 1.21.1 2024-09-08T20:54:17.6791305 Item Models: modjam 207e815e9b4c9ebca4f444f877e2488a5ce9b1c5 assets/modjam/models/item/aquarine_steel.json 51765874ad3111adf69684269ad9a422bfbaac4a assets/modjam/models/item/aquarine_steel_block.json dd0c37deb1f33fb0844da4a540706681887fc3d4 assets/modjam/models/item/aquatic_catalyst.json 246cda7a0fca8b278dd6ed5392d0ce745d9fa097 assets/modjam/models/item/chiseled_dark_prismarine.json +4d6b8c829a1afa42db37e92f67ddf057d763b124 assets/modjam/models/item/crate.json +b918bbc26234f9f47c0330279cee33fb368261df assets/modjam/models/item/crowbar.json 5dd5fd7a7c348bbaf51df14605c5241bf75e18ae assets/modjam/models/item/dark_prismarine_pillar.json 4d48047a9639345841262719f87f57c3494e4a55 assets/modjam/models/item/deep_sea_drain.json 5b6b9e8621c065cb4167e4b6dfdfaecb0fd7186d assets/modjam/models/item/eas_vial.json diff --git a/src/generated/resources/.cache/7383b985a2cdbb3a068dc5fd3ae4ba545545c370 b/src/generated/resources/.cache/7383b985a2cdbb3a068dc5fd3ae4ba545545c370 index da07c6bf..7ae3030d 100644 --- a/src/generated/resources/.cache/7383b985a2cdbb3a068dc5fd3ae4ba545545c370 +++ b/src/generated/resources/.cache/7383b985a2cdbb3a068dc5fd3ae4ba545545c370 @@ -1,7 +1,8 @@ -// 1.21.1 2024-09-08T14:54:06.450838244 Block States: modjam +// 1.21.1 2024-09-08T21:58:23.7229483 Block States: modjam af3ef9c17c60ced537516e8aa1215fcb76e3683e assets/modjam/blockstates/aquarine_steel_block.json 865a45a4d022b56bc54dc32dae4b666af2df7d6f assets/modjam/blockstates/aquatic_catalyst.json 6e42254717fc67a953282f50517eb06c02193129 assets/modjam/blockstates/chiseled_dark_prismarine.json +3f474de85f7cf428f3ecd383cde71be56c940ecd assets/modjam/blockstates/crate.json 791da2d01b6b33bb1ce175d5c9c1fa5b737c9dfc assets/modjam/blockstates/dark_prismarine_pillar.json 74a08c3614f8cf6dace6f155476015776d839ce1 assets/modjam/blockstates/deep_sea_drain_part.json 5ca1917566d04d2f7fefbfa648958c06d3238f67 assets/modjam/models/block/aquarine_steel_block.json @@ -33,3 +34,5 @@ c6666b1b7a9b97708afc337463d65c098bcd0c38 assets/modjam/models/block/deep_sea_dra 8149cf16f075d4a3e9ccb4f224376ed7011e3db9 assets/modjam/models/block/deep_sea_drain_part_7_open.json c726d4f7c530beadc3bb9035ea46017faba9f4f2 assets/modjam/models/block/deep_sea_drain_part_8.json c726d4f7c530beadc3bb9035ea46017faba9f4f2 assets/modjam/models/block/deep_sea_drain_part_8_open.json +944f8a549bbc7f13a4b7022e63d680f6d533d68b assets/modjam/models/block/rusty_crate.json +e9266445328047f5d61b4e0d111da3842d005fa8 assets/modjam/models/block/rusty_crate_open.json diff --git a/src/generated/resources/assets/modjam/blockstates/crate.json b/src/generated/resources/assets/modjam/blockstates/crate.json new file mode 100644 index 00000000..7015cea4 --- /dev/null +++ b/src/generated/resources/assets/modjam/blockstates/crate.json @@ -0,0 +1,16 @@ +{ + "variants": { + "open=false,rusty=false": { + "model": "modjam:block/crate" + }, + "open=false,rusty=true": { + "model": "modjam:block/rusty_crate" + }, + "open=true,rusty=false": { + "model": "modjam:block/crate_open" + }, + "open=true,rusty=true": { + "model": "modjam:block/rusty_crate_open" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/modjam/models/block/rusty_crate.json b/src/generated/resources/assets/modjam/models/block/rusty_crate.json new file mode 100644 index 00000000..771132d4 --- /dev/null +++ b/src/generated/resources/assets/modjam/models/block/rusty_crate.json @@ -0,0 +1,9 @@ +{ + "parent": "modjam:block/crate", + "textures": { + "2": "modjam:block/crate/rusty_top_inner", + "4": "modjam:block/crate/rusty", + "5": "modjam:block/crate/rusty_top", + "particle": "modjam:block/crate/rusty" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/modjam/models/block/rusty_crate_open.json b/src/generated/resources/assets/modjam/models/block/rusty_crate_open.json new file mode 100644 index 00000000..3ba1841a --- /dev/null +++ b/src/generated/resources/assets/modjam/models/block/rusty_crate_open.json @@ -0,0 +1,9 @@ +{ + "parent": "modjam:block/crate_open", + "textures": { + "2": "modjam:block/crate/rusty_top_inner", + "4": "modjam:block/crate/rusty", + "5": "modjam:block/crate/rusty_top", + "particle": "modjam:block/crate/rusty" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/modjam/models/item/crate.json b/src/generated/resources/assets/modjam/models/item/crate.json new file mode 100644 index 00000000..46dc11ee --- /dev/null +++ b/src/generated/resources/assets/modjam/models/item/crate.json @@ -0,0 +1,3 @@ +{ + "parent": "modjam:block/crate" +} \ No newline at end of file diff --git a/src/generated/resources/assets/modjam/models/item/crowbar.json b/src/generated/resources/assets/modjam/models/item/crowbar.json new file mode 100644 index 00000000..c6790d8c --- /dev/null +++ b/src/generated/resources/assets/modjam/models/item/crowbar.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "modjam:item/crowbar" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/block/mineable/axe.json b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json new file mode 100644 index 00000000..4093cd23 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json @@ -0,0 +1,5 @@ +{ + "values": [ + "modjam:crate" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json new file mode 100644 index 00000000..4093cd23 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json @@ -0,0 +1,5 @@ +{ + "values": [ + "modjam:crate" + ] +} \ No newline at end of file diff --git a/src/main/java/com/portingdeadmods/modjam/ModJam.java b/src/main/java/com/portingdeadmods/modjam/ModJam.java index 4d436ba3..b459947d 100644 --- a/src/main/java/com/portingdeadmods/modjam/ModJam.java +++ b/src/main/java/com/portingdeadmods/modjam/ModJam.java @@ -41,6 +41,7 @@ public ModJam(IEventBus modEventBus, ModContainer modContainer) { MJCreativeTabs.CREATIVE_MODE_TABS.register(modEventBus); MJDataComponents.DATA_COMPONENT_TYPES.register(modEventBus); MJMultiblocks.MULTIBLOCKS.register(modEventBus); + MJMenuTypes.MENUS.register(modEventBus); modEventBus.addListener(PrismMonocleItem::registerCapabilities); diff --git a/src/main/java/com/portingdeadmods/modjam/client/screen/CrateScreen.java b/src/main/java/com/portingdeadmods/modjam/client/screen/CrateScreen.java new file mode 100644 index 00000000..ac0cb9f8 --- /dev/null +++ b/src/main/java/com/portingdeadmods/modjam/client/screen/CrateScreen.java @@ -0,0 +1,34 @@ +package com.portingdeadmods.modjam.client.screen; + +import com.portingdeadmods.modjam.inventory.CrateMenu; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.ShulkerBoxMenu; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; + +@OnlyIn(Dist.CLIENT) +public class CrateScreen extends AbstractContainerScreen { + private static final ResourceLocation CONTAINER_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/container/shulker_box.png"); + + public CrateScreen(CrateMenu menu, Inventory playerInventory, Component title) { + super(menu, playerInventory, title); + this.imageHeight++; + } + + @Override + public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { + super.render(guiGraphics, mouseX, mouseY, partialTick); + this.renderTooltip(guiGraphics, mouseX, mouseY); + } + + @Override + protected void renderBg(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) { + int i = (this.width - this.imageWidth) / 2; + int j = (this.height - this.imageHeight) / 2; + guiGraphics.blit(CONTAINER_TEXTURE, i, j, 0, 0, this.imageWidth, this.imageHeight); + } +} \ No newline at end of file diff --git a/src/main/java/com/portingdeadmods/modjam/content/blockentities/CrateBlockEntity.java b/src/main/java/com/portingdeadmods/modjam/content/blockentities/CrateBlockEntity.java new file mode 100644 index 00000000..567aaf46 --- /dev/null +++ b/src/main/java/com/portingdeadmods/modjam/content/blockentities/CrateBlockEntity.java @@ -0,0 +1,152 @@ +package com.portingdeadmods.modjam.content.blockentities; + +import com.portingdeadmods.modjam.data.MJDataComponents; +import com.portingdeadmods.modjam.inventory.CrateMenu; +import com.portingdeadmods.modjam.registries.MJBlockEntityTypes; +import com.portingdeadmods.modjam.registries.MJDataAttachments; +import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.Container; +import net.minecraft.world.ContainerHelper; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.ChestMenu; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.ContainerOpenersCounter; +import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; + +public class CrateBlockEntity extends RandomizableContainerBlockEntity { + private NonNullList items = NonNullList.withSize(27, ItemStack.EMPTY); + private final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() { + @Override + protected void onOpen(Level p_155062_, BlockPos p_155063_, BlockState p_155064_) { + CrateBlockEntity.this.playSound(p_155064_, SoundEvents.BARREL_OPEN); + } + + @Override + protected void onClose(Level p_155072_, BlockPos p_155073_, BlockState p_155074_) { + CrateBlockEntity.this.playSound(p_155074_, SoundEvents.BARREL_CLOSE); + } + + @Override + protected void openerCountChanged(Level p_155066_, BlockPos p_155067_, BlockState p_155068_, int p_155069_, int p_155070_) { + } + + @Override + protected boolean isOwnContainer(Player p_155060_) { + if (p_155060_.containerMenu instanceof ChestMenu) { + Container container = ((ChestMenu)p_155060_.containerMenu).getContainer(); + return container == CrateBlockEntity.this; + } else { + return false; + } + } + }; + + + public CrateBlockEntity( BlockPos blockPos, BlockState blockState) { + super(MJBlockEntityTypes.CRATE.get(), blockPos, blockState); + } + + @Override + protected void saveAdditional(CompoundTag tag, HolderLookup.Provider registries) { + super.saveAdditional(tag, registries); + if (!this.trySaveLootTable(tag)) { + ContainerHelper.saveAllItems(tag, this.items, registries); + } + } + + @Override + protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) { + super.loadAdditional(tag, registries); + this.items = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY); + if (!this.tryLoadLootTable(tag)) { + ContainerHelper.loadAllItems(tag, this.items, registries); + } + } + + @Override + protected void collectImplicitComponents(DataComponentMap.Builder components) { + super.collectImplicitComponents(components); + components.set(MJDataComponents.OPEN.get(),getBlockState().getValue(BlockStateProperties.OPEN)); + } + + @Override + protected void applyImplicitComponents(DataComponentInput componentInput) { + super.applyImplicitComponents(componentInput); + level.setBlockAndUpdate(getBlockPos(),getBlockState().setValue(BlockStateProperties.OPEN,componentInput.getOrDefault(MJDataComponents.OPEN,false))); + } + + @Override + public int getContainerSize() { + return 27; + } + + @Override + protected NonNullList getItems() { + return this.items; + } + + @Override + protected void setItems(NonNullList items) { + this.items = items; + } + + @Override + protected Component getDefaultName() { + return getBlockState().getBlock().getName(); + } + + @Override + protected AbstractContainerMenu createMenu(int id, Inventory player) { + return new CrateMenu(id,player,this); + } + + @Override + public void startOpen(Player player) { + if (!this.remove && !player.isSpectator()) { + this.openersCounter.incrementOpeners(player, this.getLevel(), this.getBlockPos(), this.getBlockState()); + } + } + + @Override + public void stopOpen(Player player) { + if (!this.remove && !player.isSpectator()) { + this.openersCounter.decrementOpeners(player, this.getLevel(), this.getBlockPos(), this.getBlockState()); + } + } + + public void recheckOpen() { + if (!this.remove) { + this.openersCounter.recheckOpeners(this.getLevel(), this.getBlockPos(), this.getBlockState()); + } + } + + @Override + public boolean canPlaceItem(int slot, ItemStack stack) { + return getBlockState().getValue(BlockStateProperties.OPEN) && super.canPlaceItem(slot, stack); + } + + @Override + public boolean canTakeItem(Container target, int slot, ItemStack stack) { + return getBlockState().getValue(BlockStateProperties.OPEN) && super.canTakeItem(target, slot, stack); + } + + public void playSound(BlockState state, SoundEvent sound) { + double d0 = (double)this.worldPosition.getX() + 0.5; + double d1 = (double)this.worldPosition.getY() + 0.5; + double d2 = (double)this.worldPosition.getZ() + 0.5; + this.level.playSound(null, d0, d1, d2, sound, SoundSource.BLOCKS, 0.5F, this.level.random.nextFloat() * 0.1F + 0.9F); + } +} diff --git a/src/main/java/com/portingdeadmods/modjam/content/blocks/CrateBlock.java b/src/main/java/com/portingdeadmods/modjam/content/blocks/CrateBlock.java new file mode 100644 index 00000000..ce6ec895 --- /dev/null +++ b/src/main/java/com/portingdeadmods/modjam/content/blocks/CrateBlock.java @@ -0,0 +1,186 @@ +package com.portingdeadmods.modjam.content.blocks; + +import com.mojang.serialization.MapCodec; +import com.portingdeadmods.modjam.content.blockentities.CrateBlockEntity; +import com.portingdeadmods.modjam.registries.MJBlocks; +import com.portingdeadmods.modjam.registries.MJItems; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.stats.Stats; +import net.minecraft.util.RandomSource; +import net.minecraft.world.*; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.entity.monster.piglin.PiglinAi; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.BaseEntityBlock; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.storage.loot.LootParams; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +import static net.minecraft.world.level.block.ShulkerBoxBlock.CONTENTS; + +public class CrateBlock extends BaseEntityBlock { + + public static final BooleanProperty RUSTY = BooleanProperty.create("rusty"); + + public CrateBlock(Properties properties) { + super(properties); + registerDefaultState(defaultBlockState() + .setValue(RUSTY,false) + .setValue(BlockStateProperties.OPEN,false) + ); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder.add(RUSTY,BlockStateProperties.OPEN)); + } + + @Override + protected RenderShape getRenderShape(BlockState state) { + return RenderShape.MODEL; + } + + @Override + protected MapCodec codec() { + return simpleCodec(CrateBlock::new); + } + + @Override + protected @NotNull ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { + if (level.isClientSide) return ItemInteractionResult.sidedSuccess(true); + if (state.getValue(BlockStateProperties.OPEN)) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + if (!(level.getBlockEntity(pos) instanceof CrateBlockEntity be)) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + if (stack.isEmpty()) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + if (!stack.is(MJItems.CROWBAR)) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + if (player.getCooldowns().isOnCooldown(stack.getItem())) return ItemInteractionResult.FAIL; + if (Math.random() > 0.1){ + be.playSound(state,SoundEvents.ANVIL_HIT); + player.getCooldowns().addCooldown(stack.getItem(),10); + return ItemInteractionResult.FAIL; + } + level.setBlockAndUpdate(pos,state.setValue(BlockStateProperties.OPEN,true)); + player.getCooldowns().addCooldown(stack.getItem(),30); + be.playSound(state,SoundEvents.ANVIL_USE); + + return ItemInteractionResult.SUCCESS; + } + + @Override + protected @NotNull InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { + if (level.isClientSide) { + return InteractionResult.SUCCESS; + } else if (player.isSpectator()) { + return InteractionResult.CONSUME; + } else if (level.getBlockEntity(pos) instanceof CrateBlockEntity be) { + if (state.getValue(BlockStateProperties.OPEN)) { + player.openMenu(be); + player.awardStat(Stats.OPEN_BARREL); + PiglinAi.angerNearbyPiglins(player, true); + } else { + be.playSound(state,SoundEvents.CHEST_LOCKED); + } + return InteractionResult.CONSUME; + } else { + return InteractionResult.PASS; + } + } + + @Override + protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { + VoxelShape shape = Shapes.empty(); + shape = Shapes.join(shape, Shapes.box(0.1875, 0.125, 0.1875, 0.8125, 0.75, 0.8125), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0, 0.0625, 0.9375, 0.125, 0.1875), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0, 0.1875, 0.1875, 0.125, 0.8125), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.8125, 0, 0.1875, 0.9375, 0.125, 0.8125), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0, 0.8125, 0.9375, 0.125, 0.9375), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0.125, 0.0625, 0.1875, 0.75, 0.1875), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.8125, 0.125, 0.0625, 0.9375, 0.75, 0.1875), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.8125, 0.125, 0.8125, 0.9375, 0.75, 0.9375), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0.125, 0.8125, 0.1875, 0.75, 0.9375), BooleanOp.OR); + + if (!state.getValue(BlockStateProperties.OPEN)){ + shape = Shapes.join(shape, Shapes.box(0.1875, 0.75, 0.1875, 0.8125, 0.8125, 0.8125), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0.75, 0.8125, 0.9375, 0.875, 0.9375), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0.75, 0.1875, 0.1875, 0.875, 0.8125), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.0625, 0.75, 0.0625, 0.9375, 0.875, 0.1875), BooleanOp.OR); + shape = Shapes.join(shape, Shapes.box(0.8125, 0.75, 0.1875, 0.9375, 0.875, 0.8125), BooleanOp.OR); + } + return shape; + } + + @Override + public @Nullable BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + return new CrateBlockEntity(pos,state); + } + + @Override + public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) { + if (level.isClientSide())return super.playerWillDestroy(level, pos, state, player); + BlockEntity blockentity = level.getBlockEntity(pos); + if (blockentity instanceof CrateBlockEntity be) { + if (be.isEmpty() && !state.getValue(BlockStateProperties.OPEN)){ + ItemStack itemstack = MJBlocks.CRATE.toStack(); + itemstack.applyComponents(blockentity.collectComponents()); + ItemEntity itementity = new ItemEntity( + level, (double)pos.getX() + 0.5, (double)pos.getY() + 0.5, (double)pos.getZ() + 0.5, itemstack + ); + itementity.setDefaultPickUpDelay(); + level.addFreshEntity(itementity); + } + } + + return super.playerWillDestroy(level, pos, state, player); + } + + @Override + protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean movedByPiston) { + if (state.getValue(BlockStateProperties.OPEN)){ + Containers.dropContentsOnDestroy(state, newState, level, pos); + return; + } + super.onRemove(state, level, pos, newState, movedByPiston); + } + + @Override + protected List getDrops(BlockState state, LootParams.Builder params) { + BlockEntity blockentity = params.getOptionalParameter(LootContextParams.BLOCK_ENTITY); + if (blockentity instanceof CrateBlockEntity be) { + params = params.withDynamicDrop(CONTENTS, p_56219_ -> { + for (int i = 0; i < be.getContainerSize(); i++) { + p_56219_.accept(be.getItem(i)); + } + }); + } + + return super.getDrops(state, params); + } + + + @Override + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + BlockEntity blockentity = level.getBlockEntity(pos); + if (blockentity instanceof CrateBlockEntity) { + ((CrateBlockEntity)blockentity).recheckOpen(); + } + } +} diff --git a/src/main/java/com/portingdeadmods/modjam/data/MJDataComponents.java b/src/main/java/com/portingdeadmods/modjam/data/MJDataComponents.java index fa6cc3b0..04ed1a6c 100644 --- a/src/main/java/com/portingdeadmods/modjam/data/MJDataComponents.java +++ b/src/main/java/com/portingdeadmods/modjam/data/MJDataComponents.java @@ -1,8 +1,10 @@ package com.portingdeadmods.modjam.data; +import com.mojang.serialization.Codec; import com.portingdeadmods.modjam.ModJam; import com.portingdeadmods.modjam.data.components.ComponentPowerStorage; import net.minecraft.core.component.DataComponentType; +import net.minecraft.network.codec.ByteBufCodecs; import net.neoforged.neoforge.fluids.SimpleFluidContent; import net.neoforged.neoforge.registries.DeferredRegister; @@ -16,6 +18,8 @@ public final class MJDataComponents { () -> builder -> builder.persistent(ComponentPowerStorage.CODEC).networkSynchronized(ComponentPowerStorage.STREAM_CODEC)); public static final Supplier> FLUID = registerDataComponentType("fluid", () -> builder -> builder.persistent(SimpleFluidContent.CODEC).networkSynchronized(SimpleFluidContent.STREAM_CODEC)); + public static final Supplier> OPEN = registerDataComponentType("open", + () -> builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)); public static Supplier> registerDataComponentType( String name, Supplier>> builderOperator) { diff --git a/src/main/java/com/portingdeadmods/modjam/datagen/BlockModelProvider.java b/src/main/java/com/portingdeadmods/modjam/datagen/BlockModelProvider.java index 994442e2..6b689258 100644 --- a/src/main/java/com/portingdeadmods/modjam/datagen/BlockModelProvider.java +++ b/src/main/java/com/portingdeadmods/modjam/datagen/BlockModelProvider.java @@ -4,6 +4,7 @@ import com.portingdeadmods.modjam.ModJam; import com.portingdeadmods.modjam.api.multiblocks.Multiblock; import com.portingdeadmods.modjam.content.blocks.AquaticCatalystBlock; +import com.portingdeadmods.modjam.content.blocks.CrateBlock; import com.portingdeadmods.modjam.content.blocks.multiblock.part.DrainPartBlock; import com.portingdeadmods.modjam.content.multiblocks.DrainMultiblock; import com.portingdeadmods.modjam.registries.MJBlocks; @@ -30,8 +31,30 @@ protected void registerStatesAndModels() { simpleBlock(MJBlocks.AQUARINE_STEEL_BLOCK.get()); aquaticCatalyst(MJBlocks.AQUATIC_CATALYST.get()); drainPart(MJBlocks.DRAIN_PART.get(), IntegerRange.of(0, 8)); + crateBlock(MJBlocks.CRATE.get()); } + private void crateBlock(CrateBlock crateBlock) { + VariantBlockStateBuilder builder = getVariantBuilder(crateBlock); + builder.partialState().with(CrateBlock.RUSTY,false).with(BlockStateProperties.OPEN,false) + .modelForState().modelFile(models().getExistingFile(existingModelFile(crateBlock))).addModel(); + builder.partialState().with(CrateBlock.RUSTY,true).with(BlockStateProperties.OPEN,false) + .modelForState().modelFile(rustedCrateModel(crateBlock,false)).addModel(); + builder.partialState().with(CrateBlock.RUSTY,false).with(BlockStateProperties.OPEN,true) + .modelForState().modelFile(models().getExistingFile(extend(existingModelFile(crateBlock),"_open"))).addModel(); + builder.partialState().with(CrateBlock.RUSTY,true).with(BlockStateProperties.OPEN,true) + .modelForState().modelFile(rustedCrateModel(crateBlock,true)).addModel(); + } + + private ModelFile rustedCrateModel(CrateBlock block,boolean open) { + return models().withExistingParent("rusty_" + name(block) + (open ? "_open": ""), extend(existingModelFile(block),open ? "_open":"")) + .texture("2", "modjam:block/crate/rusty_top_inner") + .texture("4", "modjam:block/crate/rusty") + .texture("5", "modjam:block/crate/rusty_top") + .texture("particle", "modjam:block/crate/rusty"); + } + + private void drainPart(DrainPartBlock drainPartBlock, IntegerRange range) { VariantBlockStateBuilder builder = getVariantBuilder(drainPartBlock); builder.partialState().with(DrainMultiblock.FORMED, false) diff --git a/src/main/java/com/portingdeadmods/modjam/datagen/BlockTagProvider.java b/src/main/java/com/portingdeadmods/modjam/datagen/BlockTagProvider.java index 9f4f2264..c17be797 100644 --- a/src/main/java/com/portingdeadmods/modjam/datagen/BlockTagProvider.java +++ b/src/main/java/com/portingdeadmods/modjam/datagen/BlockTagProvider.java @@ -1,8 +1,10 @@ package com.portingdeadmods.modjam.datagen; import com.portingdeadmods.modjam.ModJam; +import com.portingdeadmods.modjam.registries.MJBlocks; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; +import net.minecraft.tags.BlockTags; import net.neoforged.neoforge.common.data.BlockTagsProvider; import net.neoforged.neoforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; @@ -18,5 +20,9 @@ public BlockTagProvider(PackOutput output, CompletableFuture> DRAIN_PART = BLOCK_ENTITIES.register("drain_part", () -> BlockEntityType.Builder.of(DrainPartBlockEntity::new, MJBlocks.DRAIN_PART.get()).build(null)); + public static final Supplier> CRATE = BLOCK_ENTITIES.register("crate", + () -> BlockEntityType.Builder.of(CrateBlockEntity::new, + MJBlocks.CRATE.get()).build(null)); } diff --git a/src/main/java/com/portingdeadmods/modjam/registries/MJBlocks.java b/src/main/java/com/portingdeadmods/modjam/registries/MJBlocks.java index 5b18097b..5531ed56 100644 --- a/src/main/java/com/portingdeadmods/modjam/registries/MJBlocks.java +++ b/src/main/java/com/portingdeadmods/modjam/registries/MJBlocks.java @@ -2,6 +2,7 @@ import com.portingdeadmods.modjam.ModJam; import com.portingdeadmods.modjam.content.blocks.AquaticCatalystBlock; +import com.portingdeadmods.modjam.content.blocks.CrateBlock; import com.portingdeadmods.modjam.content.blocks.multiblock.controller.DrainBlock; import com.portingdeadmods.modjam.content.blocks.multiblock.part.DrainPartBlock; import net.minecraft.world.item.BlockItem; @@ -28,6 +29,9 @@ public final class MJBlocks { BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); public static final DeferredBlock AQUATIC_CATALYST = registerBlockAndItem("aquatic_catalyst", AquaticCatalystBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.DARK_PRISMARINE).lightLevel(state -> state.getValue(AquaticCatalystBlock.CORE_ACTIVE) ? 12 : 0)); + public static final DeferredBlock CRATE = registerBlockAndItem("crate", CrateBlock::new, + BlockBehaviour.Properties.ofFullCopy(Blocks.BARREL)); + // MULTIBLOCKS public static final DeferredBlock DRAIN = registerBlockAndItem("deep_sea_drain", DrainBlock::new, diff --git a/src/main/java/com/portingdeadmods/modjam/registries/MJItems.java b/src/main/java/com/portingdeadmods/modjam/registries/MJItems.java index f49bfc3a..9bbee8f1 100644 --- a/src/main/java/com/portingdeadmods/modjam/registries/MJItems.java +++ b/src/main/java/com/portingdeadmods/modjam/registries/MJItems.java @@ -43,6 +43,8 @@ public final class MJItems { public static final DeferredItem ELECTROLYTE_ALGAE_SERUM_BUCKET = registerItemBucket("electrolyte_algae_serum_bucket", () -> new BucketItem(MJFluids.ELECTROLYTE_ALGAE_SERUM_SOURCE.get(), new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1))); + public static final DeferredItem CROWBAR = registerItem("crowbar",Item::new,new Item.Properties().stacksTo(1)); + public static DeferredItem registerItem(String name, Function itemConstructor, Item.Properties properties) { return registerItem(name, itemConstructor, properties, true); diff --git a/src/main/java/com/portingdeadmods/modjam/registries/MJMenuTypes.java b/src/main/java/com/portingdeadmods/modjam/registries/MJMenuTypes.java new file mode 100644 index 00000000..3651e0bb --- /dev/null +++ b/src/main/java/com/portingdeadmods/modjam/registries/MJMenuTypes.java @@ -0,0 +1,32 @@ +package com.portingdeadmods.modjam.registries; + +import com.mojang.serialization.Codec; +import com.portingdeadmods.modjam.ModJam; +import com.portingdeadmods.modjam.inventory.CrateMenu; +import com.portingdeadmods.modjam.utils.CodecUtils; +import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.MenuType; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.network.IContainerFactory; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; + +import java.util.Set; +import java.util.function.Supplier; + +public final class MJMenuTypes { + public static final DeferredRegister> MENUS = DeferredRegister.create(BuiltInRegistries.MENU, ModJam.MODID); + + public static final DeferredHolder,MenuType> CRATE = registerMenuType(CrateMenu::new,"crate"); + + + + private static DeferredHolder,MenuType> registerMenuType(IContainerFactory factory, + String name) { + return MENUS.register(name, () -> IMenuTypeExtension.create(factory)); + } +} diff --git a/src/main/resources/assets/modjam/lang/en_us.json b/src/main/resources/assets/modjam/lang/en_us.json index e00453b6..96ff56d6 100644 --- a/src/main/resources/assets/modjam/lang/en_us.json +++ b/src/main/resources/assets/modjam/lang/en_us.json @@ -11,11 +11,13 @@ "item.modjam.electrolyte_algae_serum_bucket": "Electrolyte Algae Serum (EAS) Bucket", "item.modjam.glass_vial": "Glass Vial", "item.modjam.eas_vial": "Vial of Electrolyte Algae Serum", + "item.modjam.crowbar": "Crowbar", "block.modjam.aquarine_steel_block": "Aquarine Steel Block", "block.modjam.aquatic_catalyst": "Aquatic Catalyst", "block.modjam.dark_prismarine_pillar": "Dark Prismarine Pillar", "block.modjam.chiseled_dark_prismarine": "Chiseled Dark Prismarine", + "block.modjam.crate": "Crate", "multiblock.info.failed_to_construct": "Missing or invalid block", diff --git a/src/main/resources/assets/modjam/models/block/crate.json b/src/main/resources/assets/modjam/models/block/crate.json new file mode 100644 index 00000000..fd570a46 --- /dev/null +++ b/src/main/resources/assets/modjam/models/block/crate.json @@ -0,0 +1,238 @@ +{ + "credit": "Made with Blockbench and by iglee42", + "parent": "minecraft:block/cube_bottom_top", + "texture_size": [14, 14], + "textures": { + "2": "modjam:block/crate/top_inner", + "4": "modjam:block/crate/base", + "5": "modjam:block/crate/top", + "particle": "modjam:block/crate/base" + }, + "elements": [ + { + "from": [3, 2, 3], + "to": [13, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 11.75, 15]}, + "faces": { + "north": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "east": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "south": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "west": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, + "down": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#5"} + } + }, + { + "from": [1, 0, 13], + "to": [15, 2, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 12]}, + "faces": { + "north": {"uv": [16, 13.71429, 0, 16], "texture": "#5"}, + "east": {"uv": [16, 13.71429, 13.71429, 16], "texture": "#4"}, + "south": {"uv": [0, 13.71429, 16, 16], "texture": "#4"}, + "west": {"uv": [2.28571, 13.71429, 0, 16], "texture": "#4"}, + "up": {"uv": [0, 13.71429, 16, 16], "texture": "#5"}, + "down": {"uv": [16, 0, 0, 2.28571], "texture": "#5"} + } + }, + { + "from": [13, 0, 3], + "to": [15, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 12]}, + "faces": { + "east": {"uv": [4.57143, 0, 16, 2.28571], "rotation": 180, "texture": "#4"}, + "west": {"uv": [13.71429, 2.28571, 16, 13.71429], "rotation": 90, "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 0, 11.42857, 2.28571], "rotation": 90, "texture": "#5"} + } + }, + { + "from": [1, 0, 3], + "to": [3, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [-12, 1, 12]}, + "faces": { + "east": {"uv": [0, 13.71429, 2.28571, 2.28571], "rotation": 90, "texture": "#5"}, + "west": {"uv": [0, 16, 11.42857, 13.71429], "rotation": 180, "texture": "#4"}, + "up": {"uv": [0, 2.28571, 2.28571, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 90, "texture": "#5"} + } + }, + { + "from": [1, 0, 1], + "to": [15, 2, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 0]}, + "faces": { + "north": {"uv": [16, 2.28571, 0, 0], "texture": "#4"}, + "east": {"uv": [13.71429, 2.28571, 16, 0], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 2.28571], "texture": "#5"}, + "west": {"uv": [0, 2.28571, 2.28571, 0], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 2.28571], "texture": "#5"}, + "down": {"uv": [16, 2.28571, 0, 0], "texture": "#5"} + } + }, + { + "from": [1, 2, 1], + "to": [3, 12, 3], + "rotation": {"angle": 0, "axis": "z", "origin": [2, 1, 0]}, + "faces": { + "north": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "east": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "south": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "west": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 270, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 270, "texture": "#4"} + } + }, + { + "from": [13, 2, 1], + "to": [15, 12, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 7, 2]}, + "faces": { + "north": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "east": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "south": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "west": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 180, "texture": "#4"} + } + }, + { + "from": [13, 2, 13], + "to": [15, 12, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 7, 14]}, + "faces": { + "north": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "east": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "south": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "west": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 90, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 90, "texture": "#4"} + } + }, + { + "from": [1, 2, 13], + "to": [3, 12, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 7, 14]}, + "faces": { + "north": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "east": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "south": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "west": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 180, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "texture": "#4"} + } + }, + { + "from": [3, 12, 3], + "to": [13, 13, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "east": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "west": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "up": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#5"}, + "down": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#5"} + } + }, + { + "from": [1, 12, 13], + "to": [15, 14, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [16, 13.71429, 0, 16], "texture": "#5"}, + "east": {"uv": [16, 16, 13.71429, 13.71429], "texture": "#4"}, + "south": {"uv": [0, 16, 16, 13.71429], "texture": "#4"}, + "west": {"uv": [2.28571, 16, 0, 13.71429], "texture": "#4"}, + "up": {"uv": [0, 13.71429, 16, 16], "texture": "#5"}, + "down": {"uv": [16, 0, 0, 2.28571], "texture": "#4"} + } + }, + { + "from": [1, 12, 3], + "to": [3, 14, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "east": {"uv": [0, 2.28571, 2.28571, 13.71429], "rotation": 90, "texture": "#5"}, + "west": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 180, "texture": "#4"}, + "up": {"uv": [0, 2.28571, 2.28571, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 90, "texture": "#4"} + } + }, + { + "from": [1, 12, 1], + "to": [15, 14, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [16, 0, 0, 2.28571], "texture": "#4"}, + "east": {"uv": [13.71429, 0, 16, 2.28571], "texture": "#4"}, + "south": {"uv": [0, 2.28571, 16, 0], "texture": "#5"}, + "west": {"uv": [0, 0, 2.28571, 2.28571], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 2.28571], "texture": "#5"}, + "down": {"uv": [16, 2.28571, 0, 0], "texture": "#4"} + } + }, + { + "from": [13, 12, 3], + "to": [15, 14, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "east": {"uv": [4.57143, 2.28571, 16, 0], "rotation": 180, "texture": "#4"}, + "west": {"uv": [13.71429, 13.71429, 16, 2.28571], "rotation": 90, "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 0, 11.42857, 2.28571], "rotation": 90, "texture": "#4"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + }, + "groups": [ + { + "name": "inner", + "origin": [0, 12, 0], + "color": 0, + "children": [0] + }, + { + "name": "outer", + "origin": [0, 13, 0], + "color": 0, + "children": [1, 2, 3, 4, 5, 6, 7, 8] + }, + { + "name": "top", + "origin": [0, 13, 12], + "color": 0, + "children": [9, 10, 11, 12, 13] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/modjam/models/block/crate_open.json b/src/main/resources/assets/modjam/models/block/crate_open.json new file mode 100644 index 00000000..0eaa232a --- /dev/null +++ b/src/main/resources/assets/modjam/models/block/crate_open.json @@ -0,0 +1,238 @@ +{ + "credit": "Made with Blockbench and by iglee42", + "parent": "minecraft:block/cube_bottom_top", + "texture_size": [14, 14], + "textures": { + "2": "modjam:block/crate/top_inner", + "4": "modjam:block/crate/base", + "5": "modjam:block/crate/top", + "particle": "modjam:block/crate/base" + }, + "elements": [ + { + "from": [3, 2, 3], + "to": [13, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 11.75, 15]}, + "faces": { + "north": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "east": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "south": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "west": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, + "down": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "texture": "#5"} + } + }, + { + "from": [1, 0, 13], + "to": [15, 2, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 12]}, + "faces": { + "north": {"uv": [16, 13.71429, 0, 16], "texture": "#5"}, + "east": {"uv": [16, 13.71429, 13.71429, 16], "texture": "#4"}, + "south": {"uv": [0, 13.71429, 16, 16], "texture": "#4"}, + "west": {"uv": [2.28571, 13.71429, 0, 16], "texture": "#4"}, + "up": {"uv": [0, 13.71429, 16, 16], "texture": "#5"}, + "down": {"uv": [16, 0, 0, 2.28571], "texture": "#5"} + } + }, + { + "from": [13, 0, 3], + "to": [15, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 12]}, + "faces": { + "east": {"uv": [4.57143, 0, 16, 2.28571], "rotation": 180, "texture": "#4"}, + "west": {"uv": [13.71429, 2.28571, 16, 13.71429], "rotation": 90, "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 0, 11.42857, 2.28571], "rotation": 90, "texture": "#5"} + } + }, + { + "from": [1, 0, 3], + "to": [3, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [-12, 1, 12]}, + "faces": { + "east": {"uv": [0, 13.71429, 2.28571, 2.28571], "rotation": 90, "texture": "#5"}, + "west": {"uv": [0, 16, 11.42857, 13.71429], "rotation": 180, "texture": "#4"}, + "up": {"uv": [0, 2.28571, 2.28571, 13.71429], "texture": "#5"}, + "down": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 90, "texture": "#5"} + } + }, + { + "from": [1, 0, 1], + "to": [15, 2, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, 0]}, + "faces": { + "north": {"uv": [16, 2.28571, 0, 0], "texture": "#4"}, + "east": {"uv": [13.71429, 2.28571, 16, 0], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 2.28571], "texture": "#5"}, + "west": {"uv": [0, 2.28571, 2.28571, 0], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 2.28571], "texture": "#5"}, + "down": {"uv": [16, 2.28571, 0, 0], "texture": "#5"} + } + }, + { + "from": [1, 2, 1], + "to": [3, 12, 3], + "rotation": {"angle": 0, "axis": "z", "origin": [2, 1, 0]}, + "faces": { + "north": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "east": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "south": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "west": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 270, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 270, "texture": "#4"} + } + }, + { + "from": [13, 2, 1], + "to": [15, 12, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 7, 2]}, + "faces": { + "north": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "east": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "south": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "west": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 180, "texture": "#4"} + } + }, + { + "from": [13, 2, 13], + "to": [15, 12, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 7, 14]}, + "faces": { + "north": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "east": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "south": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "west": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 90, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "rotation": 90, "texture": "#4"} + } + }, + { + "from": [1, 2, 13], + "to": [3, 12, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 7, 14]}, + "faces": { + "north": {"uv": [16, 14.85714, 13.71429, 3.42857], "texture": "#5"}, + "east": {"uv": [2.28571, 2.28571, 0, 13.71429], "rotation": 180, "texture": "#4"}, + "south": {"uv": [2.28571, 13.71429, 0, 2.28571], "texture": "#5"}, + "west": {"uv": [13.71429, 14.85714, 16, 3.42857], "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 0], "rotation": 180, "texture": "#4"}, + "down": {"uv": [0, 2.28571, 2.28571, 0], "texture": "#4"} + } + }, + { + "from": [3, 12, 13], + "to": [13, 13, 23], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "east": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "south": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "west": {"uv": [0, 0, 16, 1], "texture": "#missing"}, + "up": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "rotation": 270, "texture": "#5"}, + "down": {"uv": [2.28571, 2.28571, 13.71429, 13.71429], "rotation": 90, "texture": "#5"} + } + }, + { + "from": [13, 12, 11], + "to": [15, 14, 25], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [16, 16, 13.71429, 13.71429], "texture": "#4"}, + "east": {"uv": [0, 16, 16, 13.71429], "texture": "#4"}, + "south": {"uv": [2.28571, 16, 0, 13.71429], "texture": "#4"}, + "west": {"uv": [16, 13.71429, 0, 16], "texture": "#5"}, + "up": {"uv": [0, 13.71429, 16, 16], "rotation": 270, "texture": "#5"}, + "down": {"uv": [16, 0, 0, 2.28571], "rotation": 90, "texture": "#4"} + } + }, + { + "from": [3, 12, 23], + "to": [13, 14, 25], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [0, 2.28571, 2.28571, 13.71429], "rotation": 90, "texture": "#5"}, + "south": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 180, "texture": "#4"}, + "up": {"uv": [0, 2.28571, 2.28571, 13.71429], "rotation": 270, "texture": "#5"}, + "down": {"uv": [0, 13.71429, 11.42857, 16], "rotation": 180, "texture": "#4"} + } + }, + { + "from": [1, 12, 11], + "to": [3, 14, 25], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [13.71429, 0, 16, 2.28571], "texture": "#4"}, + "east": {"uv": [0, 2.28571, 16, 0], "texture": "#5"}, + "south": {"uv": [0, 0, 2.28571, 2.28571], "texture": "#4"}, + "west": {"uv": [16, 0, 0, 2.28571], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 2.28571], "rotation": 270, "texture": "#5"}, + "down": {"uv": [16, 2.28571, 0, 0], "rotation": 90, "texture": "#4"} + } + }, + { + "from": [3, 12, 11], + "to": [13, 14, 13], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13, 11.75, 13]}, + "faces": { + "north": {"uv": [4.57143, 2.28571, 16, 0], "rotation": 180, "texture": "#4"}, + "south": {"uv": [13.71429, 13.71429, 16, 2.28571], "rotation": 90, "texture": "#5"}, + "up": {"uv": [13.71429, 2.28571, 16, 13.71429], "rotation": 270, "texture": "#5"}, + "down": {"uv": [0, 0, 11.42857, 2.28571], "rotation": 180, "texture": "#4"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + }, + "groups": [ + { + "name": "inner", + "origin": [0, 12, 0], + "color": 0, + "children": [0] + }, + { + "name": "outer", + "origin": [0, 13, 0], + "color": 0, + "children": [1, 2, 3, 4, 5, 6, 7, 8] + }, + { + "name": "top", + "origin": [0, 13, 12], + "color": 0, + "children": [9, 10, 11, 12, 13] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/modjam/textures/block/crate/base.png b/src/main/resources/assets/modjam/textures/block/crate/base.png new file mode 100644 index 0000000000000000000000000000000000000000..4c54701fea9397eb71d1c1f16b295e65b382abc0 GIT binary patch literal 1961 zcmbVN4Qvx-7`~yKjERClB?IH_7Rj7m@29u6cdqWI-Ds7LS<261qFlfGZo90#JMV67 zH#J*y5@f*8MEOhnnHr-c$gf7WOd^UH(Zw+VH3pWM8Hi+2Ffo`ce%E$&m`#XHuJ_%2 z&-c8~`+m>&-iwV5%jeH4o`+%B{9wQzM)%w7YwjHMzpebp26QXb15GA|IZEv-FZE7U z0>kouRU+%Gb)gjk(BckJ(xT9jit7lCVU<-WT?DPr!lSTRQN6@O|0e{lNM2%XMTidR zKG>oJIt;j~qagx1S^+N+RS)BpDFG40p(Wy}cuX~gl$S{J3TSMOZ=fT~)gK=@R)Ab!~7>aHwnu^Kndh_<%Ey#>$Gt#a@Dhy4n%>b}2fn=82+314LfTE=t z5lxFtZB*lwWSm7=<7I0VRnn5?{nHjezi2@(!O|>E(mYAC5!NX%%mXwl&~yeD(j-N0 z&*8W<&J$tW0_zrN{u(IqizHg&b-@x4WX*_+C|e~iHbY8Rn+ZHuL&2xTGy?@j(wx)Z z2YtRqLz9&lnphr0K8&_0F^g1G+zc?7eNfb9h+5!u(u4E4C7$l3MD7Klh^ z^GGJNsmWGSG+<3LD%^DqNX@3)6chig`^NS$qba9*HqZVa>Diiq7Ex`6sJT*voeX8S zq0Ej@|K6>T~6d^~cceE8U< z^=Fj;HdwH*uw;w!P0<|Jo*kVhKbu>Kf0g+7bK>e9-`(T9sqy03%LCho&VRAuQ#x`n zb*>9rA9(W6@BwRZqNwD@OX}hcr-c%!>BwuF9(uC?e}CVpgOl%l)a2NX9eVY&fSqhQ zFORA3Zaw_v(yrc(c?%YHRSxCNE!oL89zIe+?s}wnxNu^;uJ^>qhut^Ri*F6{9p_Ge zuxPOUc;bmGl|y?*dipkw#hV1ozwDK_eyCnu|H1()_;S8_SJ~V7tM~8VL2KYlCzR!7 zeMi4;*j#Y*wDiL4G`th2r_O^ z3Ram_frTuu$~I0=L%Ete8NfluMIs2)ie7kC0hfD9DVfLJPp)xxT&8ew$|>eTjK z24H9dfs~DVYLVrX3B#OU2i-^p}h5X@;fjcR^vj2%O2?7cB6ssOmBYy_ICH1`wK3gQ2Myvc+md)uCZ1%|3eFUtCy&jjmnaugx)}a^(%(SDLnA|yci6PO_Bsw1frdC(;?jLp&8u6 zI|Mu=I7D2uyFwHLNL~P7-7kJAp0#NCX;j)y49 ziQ9o&1OjlYE7v7>9l6M8R!fxt86nb5dR#Ql1K`5#PKO5%i7p0b;GA+Xf+ytS zt)frV5nC!5FvIo9YqSWgOpYQFnkXHXTThxg^3yTI{VPQLM|Eptb z`K-P`^{;n6Sm(_jLR604cI{X{RNCG26SF!-2rAWjR+tI56sb{P(|&UDqWY@rAKE*e zT}aD}lARZq9lhOpAU1IA0&}uA{bB9Q(8(?Q-pkuxeEi7y^L2Zl@7sPWtEj40ZJZb! zw`syEd3ndon{R%qn5XwlICgDlbyND%D;#%t#WW^=@c50V((~{P^yeoweK;F!ETv!1 z>b?-3m9-}4lb&y$>~CwXT(SS{tek^weUA*xJCxBuzjk}W*Y7R6+IQx+&ZYrlnY*|3 zRDJ)_^xWo`KYC1ScopBZEA5S&>3g=Fx_J0d57uDs>fL(a+to8J?psy&N6*wbEoV<0 zS(#V$edgqj%Q8~^=#Mw#*2rg_a~4kCGk3wHOK5m%xhr_7CHLd;I~p>4?V;-vkBjp< syS5E}x%Qne%CGnD&-b=<3*7CrJK4QoU8UCzSs!Ts{4!rl(ekx_1G@0hVgLXD literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/modjam/textures/block/crate/rusty_top.png b/src/main/resources/assets/modjam/textures/block/crate/rusty_top.png new file mode 100644 index 0000000000000000000000000000000000000000..fce904c94506f782f56a990ff0b5becde7a6e9be GIT binary patch literal 2056 zcmbVN4Q$j@9PjZVUjYXq5SUQAfPD4(alPKPa2w-pY=_<$dwFi{bNmAD7%Xgr3YitNG4oB=YRc|k-e zs@K7y`r@EeUoCMmmY0jpPV$f-2224>#-ee9PkOKvFAvAoG=ZThh*|By@-2gCd7uRK zsyaZOb{3Z?#*Ml-JH;}jgPn=eB*hV=o1h#xN%17hJ6&k{!k{%>4)LYFd1+hl%Y#Ks zQ{xFDkx1AR4!f#{35w$&2Tjm44iUIf7dM3@9yfA&7<|BxbVV~2HI7=0f~eM*9tPFgOdfU=aqX*GH@Wn7jB5Ct(1Hw}oTGFUC5nyL{|`=HJ& zKV$%gHW0|zc%+tCEMvkj3u>Vo>3}>EZ3OEyK$HSQtOobF z_9UvLM>0x7uhFSxN?cYG#|S* z6wV!_Ts-aK8TKJ4tQT1@g~x(ri4UoIOn}}hF(C{HEgr_uObmIi8dY^@7)o>Wp7(pb zCAu0?qHv+m59?5@QKBZU#8IQPaBfO(Ai(?MhAG4);P-hj7#h2x$UN&1S<&GVagGf+ zaYeQ4W85N5 zi2AL;3sND(0(2C%sjnB@#% zwW02e5dThAYOPnx>Vd;PXbm$B7=C10IEX`P9X4nzyvB|owkE$XKREU6#S1IdQTd}i zKR4f`+uG&~+p)WP@91}m&~GEZ2A2O(c6W7WLCd_T_sxR?eQRzW-Pqc;b$h2UA+NdR z)YnJ2NnhRRT72L)`mYV;TUVSMbn9OI&^hg!zNfpcg7C9@z_1VP;cZt=?7Yxrb2m*l z`juS0b$ouu(n*E%gU*`ktuyD}X+F2KAh~1xnCc}PF3ld3jSG?4@7va19*2x9SohS(H-wG>NZmHBX%nAI9m%@%&6sl+f6smO{0GZud18Yr z(em`z&ChK9>5!+kaSNF2zn%N}_+7Ta&yTn~;P|~O_zZp!S-U_m$2H`Dci)@%<<-4e zWsMtFGyCmRR=!p_nIF7LU?)vGP~Cyt9j9D~Vg82JSK9j@-@oEyVogo+slpN2xn+B@ z>MmWoUp%>ZnQ@_HJaSRr_h9)kBz&*+qe`u?s%!h{>^!zr%|7$P1SHhI%lcRQ3yOVT I%&l7WH&|B0>Hq)$ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/modjam/textures/block/crate/rusty_top_inner.png b/src/main/resources/assets/modjam/textures/block/crate/rusty_top_inner.png new file mode 100644 index 0000000000000000000000000000000000000000..65ceb11ec0ce95f901d7e25467396d9059ed9b3d GIT binary patch literal 2124 zcmb_dO=uid9N*;N$4YupFo@zX$)Q@`&YL&iV>ThlMic79kSsI-4}JUQ&F-+f^QJSC z>?T@7MMN(iqzEd7QWQL-rJe+fN+m@@i#NUaNiQPB9=wPm_+~$*iA~d5T$r7=GynJd z_`m;u|F191KRuLxD4)yahUR8Vi~OFh^Y;w$@4W7 z-F?h2FDJ{+Gd5w(0(M!27TV2_N9S^56YUU_I!%NMt@=Sxy!OdwqTstl@rdR?C!D4= ze|96HOB?fLvQa0ND^83HV{MxQG--l`cC!)0cDpEcaBaR$A4{Up2}$ZjaWW+omYoG* znnhI53OXRNY6^x`kaZO*`V#_zvL!)Nk`(}D8|t=Z2)&QU*&^4o7fVm|xcIN4SWA-7 zmZVmzRcI*%7F8wLvN#5k5CS{`#OpzV+aQQX`UoW&lgJMfp9MmSh%0P0DT-Wa*FrPQ zV1u}qCY~^MF&?Q-1xEeJ&|5hpWi+(s`Udq&6Q^^i)7G-j(2p)+e-=1A%$w5KDA6Bd;jYxEClp)XlL z+_iAc$+xJsoksER_CMthnySj36BI;Eq+aqPJuPH;fzT&XB>&jsIi zZ9_L)Pccn^JgfmzQ9WRKMg<^CBLq>b@TxTvg!VAk-Lm=jO(lwh&)ZF5KssW zpvbBUECabfRy7Y>hM~JSQ}b-(^FG6kov5iQmm{j4>UqTTfT0i_7(`WorD+;~x`$n) z8&HLETFuv)`zVv#U(63O?sdx)uJ%?9e|&GzuBm8-#(7k&;sK(lGO&B(1x#JB z_t@X#tZyr;z5T5k<)Hf%c9%V7Uedx5oviY@xMkx=HxnP@wf&`Qx?w1~i-3nb1sJ@Z zKt;zoP>6vP4`K~Lvv2)I>4uGDTSfgwyA$cXw2&GOs+11}NxXA2x7TxBm3x`l^{?^& zndy{fx5A`<7hmVyj=8}Pvh#=!qjZ@~LH;9~qcq@oiujcLwWRV(Nk~#^3w~?fAi+=Z?#-6a5{Db2s&R(3} yKEH5a<;y1rk2=TSJzRf0cUGvk2EvoSO+0t_;O5Z7SGUu7KQ}X9Ix}_j<$nOpu&T=d literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/modjam/textures/block/crate/top.png b/src/main/resources/assets/modjam/textures/block/crate/top.png new file mode 100644 index 0000000000000000000000000000000000000000..9bcc5ca5f0479632e7b523d1c5f4ad63c93d9cfd GIT binary patch literal 1965 zcmbVNe{9rL9PfxGunB5}VT_W}p$@RuAJ_ZUaLnxv**QCJ+u??RxVQH8uGw8*X?wfd z5^yRpgBTpYA{qn#Y)-(RMB~B_B|)Z(5kyFk=vc@QP>dLUMS>b%Z?|(8Cd4LfU*G$@ z&-e5F@xEOXtzA5|_<>@AAf`sD!}a(*&ABH}!q4t`yI;nyDMs~Diy&NO&Rvx4t!N{N zJAct)O?H#?lqjQ=3n-`sy0R$)qX}X`Mb-dvE40ZL7}xY5bz#qE6sajes?j5{k`aOl zt-8a64IQ;HxuaDMC{)ElazR$a1Sx0(GMh^3mY5AvIbIQuooR+5a}c{VNL4xp$tEdE zhL8zKkIPHToZu&Y0T<^LShx2vl4rR9!}=M{O|zWHdPR?q%wH6?W-6*!AATZl3x5Tv zgl!ul!(=iUSH|r^W}M*y0nEWOJWpc;ZMEw*$kMu1HpUQ!mTYQt3t(F3D$QXK@A`3ATLnw(%Y#2*(kDrf(LQxZ` zS`sfTj^H|MNoz@))^yUUUtE>bD@kHRw``!xFcJ<@I5aLzQ$$YXJbth2r4`l3)6gUM zXul!^XaTrAs>kj3ure6iA4YQ8DFA2x=vh#Zj5+?%=Z6XhRUUK53NCb3kZItCfOad; zr}%t=DhPowwx>-EA4iZJ&+4dBFe88-AIp1G+RG~eI^e@R0lx>*EdX#WD)cJA3!S3R z)sa}OSvbS(`D4@oSL8=Yjm(vf2xR9-1S#361*lN@Y3(NQxGl^1{h0*Bq!ZQ1sA&tS zb_STRGL8dx%K~I3Qf`5^|JHqbc^uVL&^=Mj{vYZ2n8*pB$02U64COe(IBjS&Bh0^( zm0KIvvc}-J4?4p_1I8bP77lexZQ=&)O`hr{h@yBTTp250zr3!d_5gd&%Kmj5w>K=i z@)A|N>fWOb^qkIJKRi>~Ib+qj*Ng6`eDtmZuN}_z^$lzx z&plXHN(kF`t~w&P)>5-iH?#ae)A`li(#SxiS19iMO^MHppFK5CY9OABv_3?f;oB~K zb>thgdFQu9zkkOP)THQ=8N}>4?k|e2QsqZVdLG$)sjcqSHFil&H4)h`-Mske$&a?J zuNuUY2iVKU&+k68D}B^Ygm-suEZtve5z@%Ty{`-{m=-;DTH~z2tBsASs#0r*{)o*d z-rUE%wYBs3l8!I${^aPs>t~wZsW=xzGyMG*Mz&r5YvuCi|0L9fJ-^l@5GV9Q41BVzH zk~DB4C@-W7-s3LejU1-D!g8%fB%&qh@R3%8$udjj3abWTLHYTE4;49}1?8COK`)wQ zwP1QZX7lSaWwO3Z9I6}{l@GUE0nlJ6mRpT_n7FNi(#CbgI(w`tayuklE-2#}p}gSD z%9A{1vYE30(Tu!oJ2}lVpl*%G2x^WB^Qxu;sJYN`ONy+T{{=1*Mjz zk*liBW;55+b3Cr9n&Suzq#^`F1W4Ax6t_T_4EGRhzwJL0M6S8A;QeKOgI>!>e5)(GHDr634ZX$OwW;o?>ne%$@pk{lL zWh7k74;~9b%A3hUTQ;yFPFX=g5E%eE0Ore@>1vvb@{d5|Lf8rQI1T)@YeQ{Uhpu67 z3l$|paf+`SOo{9BxPgV?pnFvgq4Z~MR?8y z0d<{9g&ICFKwdL3@R31)<5LK1+i|SCK^R4(x4+2AN_Mi@{!WooP6WnPR--~K!?87B z<#iJnj-dg^)++${6l;WP2F&MsXivm}=rdg3ikhjS0@3gd-zUBgY@JxZCWa0i(=-9J zd`yvLLj!7AHD6`!p^OWEi8#ol+bt8g+FjLy(Vaz8q1848k6~7PK=e#BGV_4=71Kr- zBBs&9YSt(MqSJ$7@n58F+1c6qAsr6IO=ZV6TG^&bknkJ-J(cTsILQC zGfYsiumyBtBi)DCL{Jn~N7J>^Z5L^-fqIR0Gt#@*q=v&P6GK5&Zr;p|_1x}ew*71T ze`eaH*{Lw~-^JH{w`FdKgKR$%!zf$!r=Ym$&rueNJjG&4-hKY{U&VwySt^c~hc-`s z`SIZCv3sBX{s-^OYsV+1HkOu#lr!J{9ei`!JEc$04nOni{!5qM{_Cz&2QSVaeeR`a z2i{m*{qFvk&%Jr&kM}=W_+@5#@y@Z|zy9p4i>JOge_>?wg;)M0iyO&haELu$Zf%gK vHaF4dBdvk4qw~K#{O%#iv#;dd`%$}<7asWP$%7wV&SrgSYNmK$V(IihkS?bK literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/modjam/textures/item/crowbar.png b/src/main/resources/assets/modjam/textures/item/crowbar.png new file mode 100644 index 0000000000000000000000000000000000000000..208e87649612547a3f145ba04bc132bc8053511b GIT binary patch literal 1761 zcmcIlU1%It6rN%uX-rI{2(6%w(@0y|+4Nc~J}%6iR(itQLLo=Rqrig5KFbi?lH>F3irI zneTq*JKs5T=7p(=M+f@u>0=mXAUB?wrstvP=)Il(-~Y>BfS$H_|&5GmkT&G9IjVGfMeJOJl$$QE$Xc2nHX7aAOEqZBu*nWE{X zamgO9`}kmeA`k2HP)FS8L+pW?K?xij0=DLq-N2}&xF)Yb*U@c(W1En0KE;hi0ogfo zicJ$Avsx_9LrG1t2|XsoRZ)rWXJt{+1u-c|3NK2A7&o*8+x~GhnvX1FI`c?77QISw zr7-jiL8w-%v8oayeo>HgopQ*6Eb|n>2a9e9YP=il>M&$*0DapFZQ`;KBPftcnBu6? zRtk>SrFDb0P1G=<20THEiBU=&plNOlb(}6b2(t?`N?Y$uiG%#2hlObzkctm+b^*KL zu1+unyL-KgUv6fKpn%KRp|F4ole(e25(!CABDct+`?#BpXQX`$LgMEMDR&Ar)nQ>} znl-y;)^-u8274n#?F~2sLY(4cQC4|T=fz}R77ax;WNDu$8=}~PnzRoP2*KvS1liW& zW}v2NvPP;9 zWz;mNss&5qp$@56aaH93RyAHhmZc^%IUypIV-Ykg;yZx$iS2+Q7Cg7evHz$^lQQv5 zf~e<8)XkKgW-)FDv~-K@_v0XbroAfLY_sVM0Ha<{aWE<}MqK;0eG~UKr?W*{En!N! zLGfF#fLLJ__;{>Ho&L|}5^g0v01F#S-(2DUN9k=_VF|cJOb4gHMac-!h-no?_;t!{lllJX>phc0Gkab=L*9x$Lb>cjX6@m_OMe6ICOWVH literal 0 HcmV?d00001 diff --git a/src/main/resources/data/modjam/loot_table/blocks/crate.json b/src/main/resources/data/modjam/loot_table/blocks/crate.json new file mode 100644 index 00000000..eff35cf5 --- /dev/null +++ b/src/main/resources/data/modjam/loot_table/blocks/crate.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name", + "minecraft:container", + "minecraft:lock", + "minecraft:container_loot", + "modjam:open" + ], + "source": "block_entity" + } + ], + "name": "modjam:crate" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "modjam:blocks/crate" +} \ No newline at end of file