From 369c2d7d9d2cd5940cc8821a7dd4a20393568222 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 2 May 2020 10:13:15 +0200 Subject: [PATCH 01/13] added apparently missing stonecutter recipe for create:polished_dark_scoria --- .../recipes/stonecutting/polished_dark_scoria.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/resources/data/create/recipes/stonecutting/polished_dark_scoria.json diff --git a/src/main/resources/data/create/recipes/stonecutting/polished_dark_scoria.json b/src/main/resources/data/create/recipes/stonecutting/polished_dark_scoria.json new file mode 100644 index 000000000..36ac32453 --- /dev/null +++ b/src/main/resources/data/create/recipes/stonecutting/polished_dark_scoria.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:stonecutting", + "ingredient": { + "item": "create:dark_scoria" + }, + "result": "create:polished_dark_scoria", + "count": 1, + "conditions": [ + { + "type": "create:module", + "module": "palettes" + } + ] +} \ No newline at end of file From 188139e5d19cc1c338d43f84cd908b58545eb1c0 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 5 May 2020 10:14:25 +0200 Subject: [PATCH 02/13] Update README.md --- README.md | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b56e05f04..15f87ccc7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + [![](https://img.shields.io/badge/Supporters-30-ff5733)](https://www.patreon.com/simibubi) [![](https://img.shields.io/badge/Available%20for-MC%201.14-c70039)](https://www.curseforge.com/minecraft/mc-mods/create/files) [![](https://img.shields.io/github/license/Creators-of-Create/Create?style=flat&color=900c3f)](https://github.com/Creators-of-Create/Create/blob/master/LICENSE) [![](https://img.shields.io/discord/620934202875183104?color=844685&label=Feedback%20%26%20Help&style=flat)](https://discord.gg/hmaD7Se) [![](https://cf.way2muchnoise.eu/short_create.svg?badge_style=flat)](https://www.curseforge.com/minecraft/mc-mods/create) + # Create Welcome to Create, a mod offering a variety of tools and blocks for Building, Decoration and Aesthetic Automation. @@ -5,14 +7,11 @@ The added elements of tech are designed to leave as many design choices to the p Check out the wiki and in-game Tool-tips for further info on how to use these features, and stay tuned for an ever-growing selection of possibilities for Creative and Survival Minecraft. -## Links -[](https://github.com/simibubi/Create/issues "Report Issues") -[](https://www.youtube.com/playlist?list=PLyADkcfPLU8ywCXZPaDbQ_JZJL0CGDN5Z "Watch Videos") -[](https://discord.gg/hmaD7Se "Feedback & Help") -[](https://www.patreon.com/simibubi "Support Us") +[](https://github.com/simibubi/Create/issues "Report Issues") +[](https://www.youtube.com/playlist?list=PLyADkcfPLU8ywCXZPaDbQ_JZJL0CGDN5Z "Watch Videos") +[](https://discord.gg/hmaD7Se "Feedback & Help") +[](https://www.patreon.com/simibubi "Support Us") -## Current Progress -- Create 0.2.2 is coming soon with more bug-fixes. Thank you for testing Create with us! - Support for Minecraft 1.12: Not planned - Support for Minecraft 1.15: Porting work is in Progress! - Support for Fabric: Not planned @@ -25,14 +24,4 @@ Check out the wiki and in-game Tool-tips for further info on how to use these fe - simibubi - Developer & Artist - tterrag - Developer & Port-Meister -## Localization - -| Code | Version | Language | Author | -|-------|---------|------------|--------------------------| -| en_us | 0.2.2 | English US | | -| de_de | 0.1 | German | Vexatos & Azratosh | -| nl_nl | 0.1 | Dutch | Prusias | -| fr_fr | 0.2.1 | French | Kiro | -| zh_cn | 0.2.1 | Chinese | noptia & spider_stranger | -| ru_ru | 0.1 | Russian | sirabein | -| pt_br | 0.1 | Brazilian | lucassabreu | +### For more information, check out our [Project Page](https://www.curseforge.com/minecraft/mc-mods/create) From b9053f7902c462fe2b6810cd7ce9668040f46d3c Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Tue, 5 May 2020 10:37:34 +0200 Subject: [PATCH 03/13] the "count": is now supported in recipe inputs, changed mixer recipes to use this new feature --- .../processing/ProcessingRecipeSerializer.java | 8 +++++++- .../create/recipes/mixing/blazing_axe.json | 12 ++---------- .../create/recipes/mixing/blazing_pickaxe.json | 12 ++---------- .../create/recipes/mixing/blazing_shovel.json | 12 ++---------- .../create/recipes/mixing/blazing_sword.json | 12 ++---------- .../recipes/mixing/chromatic_compound.json | 18 ++++-------------- 6 files changed, 19 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java index 1d605ea2d..1bde1bd31 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java @@ -28,7 +28,13 @@ public class ProcessingRecipeSerializer> List ingredients = new ArrayList<>(); for (JsonElement e : JSONUtils.getJsonArray(json, "ingredients")) { - ingredients.add(ProcessingIngredient.parse(e.getAsJsonObject())); + int count = 1; + if (JSONUtils.hasField((JsonObject) e, "count")) { + count = JSONUtils.getInt(e.getAsJsonObject().get("count"), "count"); + } + for(int i = 0; i < count; i++) { + ingredients.add(ProcessingIngredient.parse(e.getAsJsonObject())); + } } List results = new ArrayList<>(); diff --git a/src/main/resources/data/create/recipes/mixing/blazing_axe.json b/src/main/resources/data/create/recipes/mixing/blazing_axe.json index 772532f0a..c5bbc965e 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_axe.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_axe.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json b/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json index d80db6c1a..1f8c33066 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_shovel.json b/src/main/resources/data/create/recipes/mixing/blazing_shovel.json index dbce999c7..a65673c19 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_shovel.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_shovel.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_sword.json b/src/main/resources/data/create/recipes/mixing/blazing_sword.json index 8b8785f59..99f9051d9 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_sword.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_sword.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/chromatic_compound.json b/src/main/resources/data/create/recipes/mixing/chromatic_compound.json index 92f30a818..827e3a3c7 100644 --- a/src/main/resources/data/create/recipes/mixing/chromatic_compound.json +++ b/src/main/resources/data/create/recipes/mixing/chromatic_compound.json @@ -2,25 +2,15 @@ "type": "create:mixing", "ingredients": [ { - "tag": "forge:dusts/glowstone" - }, - { - "tag": "forge:dusts/glowstone" - }, - { - "tag": "forge:dusts/glowstone" + "tag": "forge:dusts/glowstone", + "count": 3 }, { "item": "create:polished_rose_quartz" }, { - "item": "create:obsidian_dust" - }, - { - "item": "create:obsidian_dust" - }, - { - "item": "create:obsidian_dust" + "item": "create:obsidian_dust", + "count": 3 }, { "item": "minecraft:dragon_breath", From a3b47c1b255bbe080a15cbb6d5b9eb477ce7181e Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 5 May 2020 10:39:42 +0200 Subject: [PATCH 04/13] Update README.md again --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15f87ccc7..bbec6e64f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ - [![](https://img.shields.io/badge/Supporters-30-ff5733)](https://www.patreon.com/simibubi) [![](https://img.shields.io/badge/Available%20for-MC%201.14-c70039)](https://www.curseforge.com/minecraft/mc-mods/create/files) [![](https://img.shields.io/github/license/Creators-of-Create/Create?style=flat&color=900c3f)](https://github.com/Creators-of-Create/Create/blob/master/LICENSE) [![](https://img.shields.io/discord/620934202875183104?color=844685&label=Feedback%20%26%20Help&style=flat)](https://discord.gg/hmaD7Se) [![](https://cf.way2muchnoise.eu/short_create.svg?badge_style=flat)](https://www.curseforge.com/minecraft/mc-mods/create) +

Logo

+

Create
+ Patreon + Supported Versions + License + Discord + Curseforge Downloads

+

-# Create Welcome to Create, a mod offering a variety of tools and blocks for Building, Decoration and Aesthetic Automation. The added elements of tech are designed to leave as many design choices to the player as possible, where item processing doesn't happen inside a single block with funny textures, it requires a set of actors working together in many possible arrangements. From c4513020dfff1df4ba1cb1a1547f212562f01340 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 5 May 2020 20:21:22 +0200 Subject: [PATCH 05/13] Schematics and Entities - Fixed sidedness issue with glue effect packets - Fixed duplication issue with Schematic tables - Schematics can now include entities - Schematicannons can now print: - superglue - (filled) item frames - (equipped) armor stands - end crystals - boats and minecarts - paintings - Special blocks/entities placed by a schematicannon can now specify custom item requirements (used currently for belts & superglue) - Fixed superglue not being rotated/mirrored correctly --- .../create/foundation/item/ItemHelper.java | 18 +- .../BlockBreakingMovementBehaviour.java | 2 - .../contraptions/glue/GlueEffectPacket.java | 2 + .../contraptions/glue/SuperGlueEntity.java | 58 ++-- .../contraptions/relays/belt/BeltBlock.java | 20 +- .../ISpecialBlockItemRequirement.java | 11 + .../ISpecialEntityItemRequirement.java | 9 + .../modules/schematics/ItemRequirement.java | 125 +++++++ .../modules/schematics/MaterialChecklist.java | 53 ++- .../modules/schematics/SchematicWorld.java | 21 ++ .../schematics/ServerSchematicLoader.java | 2 - .../schematics/block/LaunchedBlock.java | 36 -- .../schematics/block/LaunchedItem.java | 164 +++++++++ .../block/SchematicTableTileEntity.java | 2 + .../schematics/block/SchematicannonBlock.java | 6 - .../block/SchematicannonRenderer.java | 41 ++- .../block/SchematicannonScreen.java | 36 +- .../block/SchematicannonTileEntity.java | 319 +++++++++++------- .../client/SchematicAndQuillHandler.java | 2 +- .../packet/SchematicPlacePacket.java | 5 +- .../resources/assets/create/lang/en_us.json | 6 +- .../assets/create/textures/item/belt.png | Bin 258 -> 401 bytes .../create/textures/item/brass_ingot.png | Bin 508 -> 444 bytes 23 files changed, 696 insertions(+), 242 deletions(-) create mode 100644 src/main/java/com/simibubi/create/modules/schematics/ISpecialBlockItemRequirement.java create mode 100644 src/main/java/com/simibubi/create/modules/schematics/ISpecialEntityItemRequirement.java create mode 100644 src/main/java/com/simibubi/create/modules/schematics/ItemRequirement.java delete mode 100644 src/main/java/com/simibubi/create/modules/schematics/block/LaunchedBlock.java create mode 100644 src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java index cec27ea45..92f049790 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java @@ -127,17 +127,27 @@ public class ItemHelper { return false; } + public static enum ExtractionCountMode { + EXACTLY, UPTO + } + public static ItemStack extract(IItemHandler inv, Predicate test, boolean simulate) { - return extract(inv, test, -1, simulate); + return extract(inv, test, ExtractionCountMode.UPTO, AllConfigs.SERVER.logistics.extractorAmount.get(), + simulate); } public static ItemStack extract(IItemHandler inv, Predicate test, int exactAmount, boolean simulate) { + return extract(inv, test, ExtractionCountMode.EXACTLY, exactAmount, simulate); + } + + public static ItemStack extract(IItemHandler inv, Predicate test, ExtractionCountMode mode, int amount, + boolean simulate) { ItemStack extracting = ItemStack.EMPTY; - boolean amountRequired = exactAmount != -1; + boolean amountRequired = mode == ExtractionCountMode.EXACTLY; boolean checkHasEnoughItems = amountRequired; boolean hasEnoughItems = !checkHasEnoughItems; - int maxExtractionCount = hasEnoughItems ? AllConfigs.SERVER.logistics.extractorAmount.get() : exactAmount; boolean potentialOtherMatch = false; + int maxExtractionCount = amount; Extraction: do { extracting = ItemStack.EMPTY; @@ -186,7 +196,7 @@ public class ItemHelper { } while (true); - if (amountRequired && extracting.getCount() < exactAmount) + if (amountRequired && extracting.getCount() < amount) return ItemStack.EMPTY; return extracting; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/BlockBreakingMovementBehaviour.java b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/BlockBreakingMovementBehaviour.java index 6cdb097b7..cfaa5a87f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/BlockBreakingMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/BlockBreakingMovementBehaviour.java @@ -1,14 +1,12 @@ package com.simibubi.create.modules.contraptions.components.actors; import com.simibubi.create.foundation.utility.BlockHelper; -import com.simibubi.create.foundation.utility.Debug; import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionEntity; import com.simibubi.create.modules.contraptions.components.contraptions.MovementBehaviour; import com.simibubi.create.modules.contraptions.components.contraptions.MovementContext; import net.minecraft.block.BlockState; import net.minecraft.block.FallingBlock; -import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/GlueEffectPacket.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/GlueEffectPacket.java index 02dfe0b48..fd15c0be4 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/GlueEffectPacket.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/GlueEffectPacket.java @@ -9,6 +9,7 @@ import net.minecraft.network.PacketBuffer; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.NetworkEvent.Context; @@ -36,6 +37,7 @@ public class GlueEffectPacket extends SimplePacketBase { buffer.writeBoolean(fullBlock); } + @OnlyIn(Dist.CLIENT) public void handle(Supplier context) { context.get().enqueueWork(() -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { Minecraft mc = Minecraft.getInstance(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/SuperGlueEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/SuperGlueEntity.java index e21d2cb27..775e74b0c 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/SuperGlueEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/glue/SuperGlueEntity.java @@ -8,6 +8,9 @@ import com.simibubi.create.AllEntities; import com.simibubi.create.AllItems; import com.simibubi.create.AllPackets; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.modules.schematics.ISpecialEntityItemRequirement; +import com.simibubi.create.modules.schematics.ItemRequirement; +import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; @@ -46,7 +49,7 @@ import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.fml.network.NetworkHooks; import net.minecraftforge.fml.network.PacketDistributor; -public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnData { +public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement { private int validationTimer; protected BlockPos hangingPosition; @@ -64,7 +67,8 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat } @Override - protected void registerData() {} + protected void registerData() { + } public int getWidthPixels() { return 12; @@ -104,34 +108,32 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat protected void updateBoundingBox() { if (this.getFacingDirection() != null) { - this.posX = - (double) this.hangingPosition.getX() + 0.5 - (double) this.getFacingDirection().getXOffset() * 0.5; - this.posY = - (double) this.hangingPosition.getY() + 0.5 - (double) this.getFacingDirection().getYOffset() * 0.5; - this.posZ = - (double) this.hangingPosition.getZ() + 0.5 - (double) this.getFacingDirection().getZOffset() * 0.5; - double d1 = (double) this.getWidthPixels(); - double d2 = (double) this.getHeightPixels(); - double d3 = (double) this.getWidthPixels(); + double offset = 0.5 - 1 / 256d; + this.posX = hangingPosition.getX() + 0.5 - facingDirection.getXOffset() * offset; + this.posY = hangingPosition.getY() + 0.5 - facingDirection.getYOffset() * offset; + this.posZ = hangingPosition.getZ() + 0.5 - facingDirection.getZOffset() * offset; + double w = getWidthPixels(); + double h = getHeightPixels(); + double l = getWidthPixels(); Axis axis = this.getFacingDirection().getAxis(); double depth = 2 - 1 / 128f; switch (axis) { case X: - d1 = depth; + w = depth; break; case Y: - d2 = depth; + h = depth; break; case Z: - d3 = depth; + l = depth; } - d1 = d1 / 32.0D; - d2 = d2 / 32.0D; - d3 = d3 / 32.0D; - this.setBoundingBox(new AxisAlignedBB(this.posX - d1, this.posY - d2, this.posZ - d3, this.posX + d1, - this.posY + d2, this.posZ + d3)); + w = w / 32.0D; + h = h / 32.0D; + l = l / 32.0D; + this.setBoundingBox(new AxisAlignedBB(this.posX - w, this.posY - h, this.posZ - l, this.posX + w, + this.posY + h, this.posZ + l)); } } @@ -317,13 +319,13 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat if (this.getFacingDirection().getAxis() != Direction.Axis.Y) { switch (transformRotation) { case CLOCKWISE_180: - this.facingDirection = this.getFacingDirection().getOpposite(); + facingDirection = facingDirection.getOpposite(); break; case COUNTERCLOCKWISE_90: - this.facingDirection = this.getFacingDirection().rotateYCCW(); + facingDirection = facingDirection.rotateYCCW(); break; case CLOCKWISE_90: - this.facingDirection = this.getFacingDirection().rotateY(); + facingDirection = facingDirection.rotateY(); default: break; } @@ -356,10 +358,12 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat } @Override - public void onStruckByLightning(LightningBoltEntity lightningBolt) {} + public void onStruckByLightning(LightningBoltEntity lightningBolt) { + } @Override - public void recalculateSize() {} + public void recalculateSize() { + } public static EntityType.Builder build(EntityType.Builder builder) { @SuppressWarnings("unchecked") @@ -387,4 +391,10 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat public Direction getFacingDirection() { return facingDirection; } + + @Override + public ItemRequirement getRequiredItems() { + return new ItemRequirement(ItemUseType.DAMAGE, AllItems.SUPER_GLUE.get()); + } + } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index 14127dc93..7c1ae4708 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.modules.contraptions.relays.belt; +import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -16,6 +17,9 @@ import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.modules.contraptions.relays.belt.transport.BeltMovementHandler.TransportedEntityInfo; import com.simibubi.create.modules.logistics.block.belts.tunnel.BeltTunnelBlock; +import com.simibubi.create.modules.schematics.ISpecialBlockItemRequirement; +import com.simibubi.create.modules.schematics.ItemRequirement; +import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; @@ -63,7 +67,7 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; public class BeltBlock extends HorizontalKineticBlock - implements IHaveNoBlockItem, ITE, IHaveColorHandler { + implements IHaveNoBlockItem, ITE, IHaveColorHandler, ISpecialBlockItemRequirement { public static final IProperty SLOPE = EnumProperty.create("slope", Slope.class); public static final IProperty PART = EnumProperty.create("part", Part.class); @@ -603,5 +607,19 @@ public class BeltBlock extends HorizontalKineticBlock public Class getTileEntityClass() { return BeltTileEntity.class; } + + @Override + public ItemRequirement getRequiredItems(BlockState state) { + List required = new ArrayList<>(); + if (state.get(PART) != Part.MIDDLE) + required.add(new ItemStack(AllBlocks.SHAFT.get())); + if (state.get(CASING)) + required.add(new ItemStack(AllBlocks.BRASS_CASING.get())); + if (state.get(PART) == Part.START) + required.add(AllItems.BELT_CONNECTOR.asStack()); + if (required.isEmpty()) + return ItemRequirement.NONE; + return new ItemRequirement(ItemUseType.CONSUME, required); + } } diff --git a/src/main/java/com/simibubi/create/modules/schematics/ISpecialBlockItemRequirement.java b/src/main/java/com/simibubi/create/modules/schematics/ISpecialBlockItemRequirement.java new file mode 100644 index 000000000..c0832dee3 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/schematics/ISpecialBlockItemRequirement.java @@ -0,0 +1,11 @@ +package com.simibubi.create.modules.schematics; + +import net.minecraft.block.BlockState; + +public interface ISpecialBlockItemRequirement { + + default ItemRequirement getRequiredItems(BlockState state) { + return ItemRequirement.INVALID; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/schematics/ISpecialEntityItemRequirement.java b/src/main/java/com/simibubi/create/modules/schematics/ISpecialEntityItemRequirement.java new file mode 100644 index 000000000..914eb8827 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/schematics/ISpecialEntityItemRequirement.java @@ -0,0 +1,9 @@ +package com.simibubi.create.modules.schematics; + +public interface ISpecialEntityItemRequirement { + + default ItemRequirement getRequiredItems() { + return ItemRequirement.INVALID; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/schematics/ItemRequirement.java b/src/main/java/com/simibubi/create/modules/schematics/ItemRequirement.java new file mode 100644 index 000000000..3c08adf47 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/schematics/ItemRequirement.java @@ -0,0 +1,125 @@ +package com.simibubi.create.modules.schematics; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.item.ArmorStandEntity; +import net.minecraft.entity.item.BoatEntity; +import net.minecraft.entity.item.ItemFrameEntity; +import net.minecraft.entity.item.minecart.AbstractMinecartEntity; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.properties.SlabType; + +public class ItemRequirement { + + public enum ItemUseType { + CONSUME, DAMAGE + } + + ItemUseType usage; + List requiredItems; + + public static ItemRequirement INVALID = new ItemRequirement(); + public static ItemRequirement NONE = new ItemRequirement(); + + private ItemRequirement() { + } + + public ItemRequirement(ItemUseType usage, Item item) { + this(usage, Arrays.asList(new ItemStack(item))); + } + + public ItemRequirement(ItemUseType usage, List requiredItems) { + this.usage = usage; + this.requiredItems = requiredItems; + } + + public static ItemRequirement of(BlockState state) { + Block block = state.getBlock(); + if (block == Blocks.AIR) + return NONE; + if (block instanceof ISpecialBlockItemRequirement) + return ((ISpecialBlockItemRequirement) block).getRequiredItems(state); + + Item item = BlockItem.BLOCK_TO_ITEM.getOrDefault(state.getBlock(), Items.AIR); + + // double slab needs two items + if (state.has(BlockStateProperties.SLAB_TYPE) && state.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE) + return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(new ItemStack(item, 2))); + + return item == Items.AIR ? INVALID : new ItemRequirement(ItemUseType.CONSUME, item); + } + + public static ItemRequirement of(Entity entity) { + EntityType type = entity.getType(); + + if (entity instanceof ISpecialEntityItemRequirement) + return ((ISpecialEntityItemRequirement) entity).getRequiredItems(); + + if (type == EntityType.ITEM_FRAME) { + ItemFrameEntity ife = (ItemFrameEntity) entity; + ItemStack frame = new ItemStack(Items.ITEM_FRAME); + ItemStack displayedItem = ife.getDisplayedItem(); + if (displayedItem.isEmpty()) + return new ItemRequirement(ItemUseType.CONSUME, Items.ITEM_FRAME); + return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(frame, displayedItem)); + } + + if (type == EntityType.PAINTING) + return new ItemRequirement(ItemUseType.CONSUME, Items.PAINTING); + + if (type == EntityType.ARMOR_STAND) { + List requirements = new ArrayList<>(); + ArmorStandEntity armorStandEntity = (ArmorStandEntity) entity; + armorStandEntity.getEquipmentAndArmor().forEach(requirements::add); + requirements.add(new ItemStack(Items.ARMOR_STAND)); + return new ItemRequirement(ItemUseType.CONSUME, requirements); + } + + if (entity instanceof AbstractMinecartEntity) { + AbstractMinecartEntity minecartEntity = (AbstractMinecartEntity) entity; + return new ItemRequirement(ItemUseType.CONSUME, minecartEntity.getCartItem().getItem()); + } + + if (entity instanceof BoatEntity) { + BoatEntity boatEntity = (BoatEntity) entity; + return new ItemRequirement(ItemUseType.CONSUME, boatEntity.getItemBoat().getItem()); + } + + if (type == EntityType.END_CRYSTAL) + return new ItemRequirement(ItemUseType.CONSUME, Items.END_CRYSTAL); + + return INVALID; + } + + public boolean isEmpty() { + return NONE == this; + } + + public boolean isInvalid() { + return INVALID == this; + } + + public List getRequiredItems() { + return requiredItems; + } + + public ItemUseType getUsage() { + return usage; + } + + public static boolean validate(ItemStack required, ItemStack present) { + return required.isEmpty() || required.getItem() == present.getItem(); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/schematics/MaterialChecklist.java b/src/main/java/com/simibubi/create/modules/schematics/MaterialChecklist.java index e91796803..c7e758b04 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/MaterialChecklist.java +++ b/src/main/java/com/simibubi/create/modules/schematics/MaterialChecklist.java @@ -7,6 +7,9 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import com.google.common.collect.Sets; +import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -21,10 +24,12 @@ public class MaterialChecklist { public Map gathered; public Map required; + public Map damageRequired; public boolean blocksNotLoaded; public MaterialChecklist() { required = new HashMap<>(); + damageRequired = new HashMap<>(); gathered = new HashMap<>(); } @@ -32,16 +37,33 @@ public class MaterialChecklist { blocksNotLoaded = true; } - public void require(Item item) { - if (required.containsKey(item)) - required.put(item, required.get(item) + 1); + public void require(ItemRequirement requirement) { + if (requirement.isEmpty()) + return; + if (requirement.isInvalid()) + return; + + for (ItemStack stack : requirement.requiredItems) { + if (requirement.getUsage() == ItemUseType.DAMAGE) + putOrIncrement(damageRequired, stack); + if (requirement.getUsage() == ItemUseType.CONSUME) + putOrIncrement(required, stack); + } + } + + private void putOrIncrement(Map map, ItemStack stack) { + Item item = stack.getItem(); + if (item == Items.AIR) + return; + if (map.containsKey(item)) + map.put(item, map.get(item) + stack.getCount()); else - required.put(item, 1); + map.put(item, stack.getCount()); } public void collect(ItemStack stack) { Item item = stack.getItem(); - if (required.containsKey(item)) + if (required.containsKey(item) || damageRequired.containsKey(item)) if (gathered.containsKey(item)) gathered.put(item, gathered.get(item) + stack.getCount()); else @@ -65,19 +87,19 @@ public class MaterialChecklist { string = new StringBuilder("{\"text\":\""); } - List keys = new ArrayList<>(required.keySet()); + List keys = new ArrayList<>(Sets.union(required.keySet(), damageRequired.keySet())); Collections.sort(keys, (item1, item2) -> { Locale locale = Locale.ENGLISH; - String name1 = new TranslationTextComponent(((Item) item1).getTranslationKey()).getFormattedText() - .toLowerCase(locale); - String name2 = new TranslationTextComponent(((Item) item2).getTranslationKey()).getFormattedText() - .toLowerCase(locale); + String name1 = + new TranslationTextComponent(((Item) item1).getTranslationKey()).getFormattedText().toLowerCase(locale); + String name2 = + new TranslationTextComponent(((Item) item2).getTranslationKey()).getFormattedText().toLowerCase(locale); return name1.compareTo(name2); }); List completed = new ArrayList<>(); for (Item item : keys) { - int amount = required.get(item); + int amount = getRequiredAmount(item); if (gathered.containsKey(item)) amount -= gathered.get(item); @@ -106,7 +128,7 @@ public class MaterialChecklist { } itemsWritten++; - string.append(gatheredEntry(new ItemStack(item), required.get(item))); + string.append(gatheredEntry(new ItemStack(item), getRequiredAmount(item))); } string.append("\"}"); @@ -120,6 +142,13 @@ public class MaterialChecklist { return book; } + public Integer getRequiredAmount(Item item) { + int amount = required.getOrDefault(item, 0); + if (damageRequired.containsKey(item)) + amount += Math.ceil(damageRequired.get(item) / (float) new ItemStack(item).getMaxDamage()); + return amount; + } + private String gatheredEntry(ItemStack item, int amount) { int stacks = amount / 64; int remainder = amount % 64; diff --git a/src/main/java/com/simibubi/create/modules/schematics/SchematicWorld.java b/src/main/java/com/simibubi/create/modules/schematics/SchematicWorld.java index cdc1024ec..6d9bcc605 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/SchematicWorld.java +++ b/src/main/java/com/simibubi/create/modules/schematics/SchematicWorld.java @@ -1,5 +1,6 @@ package com.simibubi.create.modules.schematics; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -14,6 +15,8 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.ArmorStandEntity; +import net.minecraft.entity.item.ItemFrameEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.IFluidState; @@ -31,6 +34,7 @@ public class SchematicWorld extends WrappedWorld { private Map blocks; private Map tileEntities; + private List entities; private Cuboid bounds; public BlockPos anchor; public boolean renderMode; @@ -41,11 +45,28 @@ public class SchematicWorld extends WrappedWorld { this.tileEntities = new HashMap<>(); this.bounds = new Cuboid(); this.anchor = anchor; + this.entities = new ArrayList<>(); } public Set getAllPositions() { return blocks.keySet(); } + + @Override + public boolean addEntity(Entity entityIn) { + if (entityIn instanceof ItemFrameEntity) + ((ItemFrameEntity) entityIn).getDisplayedItem().setTag(null); + if (entityIn instanceof ArmorStandEntity) { + ArmorStandEntity armorStandEntity = (ArmorStandEntity) entityIn; + armorStandEntity.getEquipmentAndArmor().forEach(stack -> stack.setTag(null)); + } + + return entities.add(entityIn); + } + + public List getEntities() { + return entities; + } @Override public TileEntity getTileEntity(BlockPos pos) { diff --git a/src/main/java/com/simibubi/create/modules/schematics/ServerSchematicLoader.java b/src/main/java/com/simibubi/create/modules/schematics/ServerSchematicLoader.java index 2470cf8a3..214c5654d 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/ServerSchematicLoader.java +++ b/src/main/java/com/simibubi/create/modules/schematics/ServerSchematicLoader.java @@ -25,7 +25,6 @@ import com.simibubi.create.modules.schematics.item.SchematicItem; import net.minecraft.block.BlockState; import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; @@ -234,7 +233,6 @@ public class ServerSchematicLoader { if (table == null) return; table.finishUpload(); - table.inventory.setStackInSlot(0, ItemStack.EMPTY); table.inventory.setStackInSlot(1, SchematicItem.create(schematic, player.getName().getFormattedText())); } catch (IOException e) { diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedBlock.java b/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedBlock.java deleted file mode 100644 index 0f9b5300d..000000000 --- a/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedBlock.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.simibubi.create.modules.schematics.block; - -import net.minecraft.block.BlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; - -public class LaunchedBlock { - - private final SchematicannonTileEntity te; - public int totalTicks; - public int ticksRemaining; - public BlockPos target; - public BlockState state; - - public LaunchedBlock(SchematicannonTileEntity schematicannonTileEntity, BlockPos target, BlockState state) { - te = schematicannonTileEntity; - this.target = target; - this.state = state; - totalTicks = (int) (Math.max(10, MathHelper.sqrt(MathHelper.sqrt(target.distanceSq(te.getPos()))) * 4f)); - ticksRemaining = totalTicks; - } - - public LaunchedBlock(SchematicannonTileEntity schematicannonTileEntity, BlockPos target, BlockState state, - int ticksLeft, int total) { - te = schematicannonTileEntity; - this.target = target; - this.state = state; - this.totalTicks = total; - this.ticksRemaining = ticksLeft; - } - - public void update() { - if (ticksRemaining > 0) - ticksRemaining--; - } -} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java b/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java new file mode 100644 index 000000000..629c02af0 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java @@ -0,0 +1,164 @@ +package com.simibubi.create.modules.schematics.block; + +import java.util.Optional; + +import net.minecraft.block.BlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; + +public abstract class LaunchedItem { + + public int totalTicks; + public int ticksRemaining; + public BlockPos target; + public ItemStack stack; + + private LaunchedItem(BlockPos start, BlockPos target, ItemStack stack) { + this(target, stack, ticksForDistance(start, target), ticksForDistance(start, target)); + } + + private static int ticksForDistance(BlockPos start, BlockPos target) { + return (int) (Math.max(10, MathHelper.sqrt(MathHelper.sqrt(target.distanceSq(start))) * 4f)); + } + + LaunchedItem() { + } + + private LaunchedItem(BlockPos target, ItemStack stack, int ticksLeft, int total) { + this.target = target; + this.stack = stack; + this.totalTicks = total; + this.ticksRemaining = ticksLeft; + } + + public boolean update(World world) { + if (ticksRemaining > 0) { + ticksRemaining--; + return false; + } + if (world.isRemote) + return false; + + place(world); + return true; + } + + public CompoundNBT serializeNBT() { + CompoundNBT c = new CompoundNBT(); + c.putInt("TotalTicks", totalTicks); + c.putInt("TicksLeft", ticksRemaining); + c.put("Stack", stack.serializeNBT()); + c.put("Target", NBTUtil.writeBlockPos(target)); + return c; + } + + public static LaunchedItem fromNBT(CompoundNBT c) { + LaunchedItem launched = + c.contains("BlockState") ? new LaunchedItem.ForBlockState() : new LaunchedItem.ForEntity(); + launched.readNBT(c); + return launched; + } + + abstract void place(World world); + + void readNBT(CompoundNBT c) { + target = NBTUtil.readBlockPos(c.getCompound("Target")); + ticksRemaining = c.getInt("TicksLeft"); + totalTicks = c.getInt("TotalTicks"); + stack = ItemStack.read(c.getCompound("Stack")); + } + + public static class ForBlockState extends LaunchedItem { + public BlockState state; + + ForBlockState() { + } + + public ForBlockState(BlockPos start, BlockPos target, ItemStack stack, BlockState state) { + super(start, target, stack); + this.state = state; + } + + @Override + public CompoundNBT serializeNBT() { + CompoundNBT serializeNBT = super.serializeNBT(); + serializeNBT.put("BlockState", NBTUtil.writeBlockState(state)); + return serializeNBT; + } + + @Override + void readNBT(CompoundNBT nbt) { + super.readNBT(nbt); + state = NBTUtil.readBlockState(nbt.getCompound("BlockState")); + } + + @Override + void place(World world) { + // Piston + if (state.has(BlockStateProperties.EXTENDED)) + state = state.with(BlockStateProperties.EXTENDED, false); + + world.setBlockState(target, state, 18); + state.getBlock().onBlockPlacedBy(world, target, state, null, stack); + } + + } + + public static class ForEntity extends LaunchedItem { + public Entity entity; + private CompoundNBT deferredTag; + + ForEntity() { + } + + public ForEntity(BlockPos start, BlockPos target, ItemStack stack, Entity entity) { + super(start, target, stack); + this.entity = entity; + } + + @Override + public boolean update(World world) { + if (deferredTag != null && entity == null) { + try { + Optional loadEntityUnchecked = EntityType.loadEntityUnchecked(deferredTag, world); + if (!loadEntityUnchecked.isPresent()) + return true; + entity = loadEntityUnchecked.get(); + } catch (Exception var3) { + return true; + } + deferredTag = null; + } + return super.update(world); + } + + @Override + public CompoundNBT serializeNBT() { + CompoundNBT serializeNBT = super.serializeNBT(); + if (entity != null) + serializeNBT.put("Entity", entity.serializeNBT()); + return serializeNBT; + } + + @Override + void readNBT(CompoundNBT nbt) { + super.readNBT(nbt); + if (nbt.contains("Entity")) + deferredTag = nbt.getCompound("Entity"); + } + + @Override + void place(World world) { + world.addEntity(entity); + } + + } + +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableTileEntity.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableTileEntity.java index 968ff81b5..272e45ced 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableTileEntity.java @@ -7,6 +7,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.ITickableTileEntity; @@ -102,6 +103,7 @@ public class SchematicTableTileEntity extends SyncedTileEntity implements ITicka uploadingProgress = 0; uploadingSchematic = schematic; sendUpdate = true; + inventory.setStackInSlot(0, ItemStack.EMPTY); } public void finishUpload() { diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java index 55b6f9dc1..8081ce0b7 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java @@ -17,7 +17,6 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IWorldReader; import net.minecraft.world.World; import net.minecraftforge.fml.network.NetworkHooks; @@ -52,11 +51,6 @@ public class SchematicannonBlock extends Block implements ITE { @Override @@ -56,14 +60,14 @@ public class SchematicannonRenderer extends SafeTileEntityRenderer block.totalTicks - 10) { - recoil = Math.max(recoil, (block.ticksRemaining + 1 - partialTicks) - block.totalTicks + 10); + if ((launched.ticksRemaining + 1 - partialTicks) > launched.totalTicks - 10) { + recoil = Math.max(recoil, (launched.ticksRemaining + 1 - partialTicks) - launched.totalTicks + 10); } // Render particles for launch - if (block.ticksRemaining == block.totalTicks && tileEntityIn.firstRenderTick) { + if (launched.ticksRemaining == launched.totalTicks && tileEntityIn.firstRenderTick) { tileEntityIn.firstRenderTick = false; for (int i = 0; i < 10; i++) { Random r = tileEntityIn.getWorld().getRandom(); diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java index 9bfff0b58..e189ea4a5 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java @@ -26,7 +26,6 @@ import net.minecraft.client.gui.widget.Widget; import net.minecraft.client.renderer.Rectangle2d; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; @@ -89,9 +88,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen(4); replaceLevelIndicators = new Vector<>(4); - List icons = ImmutableList.of(ScreenResources.I_DONT_REPLACE, - ScreenResources.I_REPLACE_SOLID, ScreenResources.I_REPLACE_ANY, - ScreenResources.I_REPLACE_EMPTY); + List icons = ImmutableList.of(ScreenResources.I_DONT_REPLACE, ScreenResources.I_REPLACE_SOLID, + ScreenResources.I_REPLACE_ANY, ScreenResources.I_REPLACE_EMPTY); List toolTips = ImmutableList.of(Lang.translate("gui.schematicannon.option.dontReplaceSolid"), Lang.translate("gui.schematicannon.option.replaceWithSolid"), Lang.translate("gui.schematicannon.option.replaceWithAny"), @@ -215,10 +213,9 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen= fuelX && mouseY >= fuelY && mouseX <= fuelX + ScreenResources.SCHEMATICANNON_FUEL.width && mouseY <= fuelY + ScreenResources.SCHEMATICANNON_FUEL.height) { container.getTileEntity(); + double fuelUsageRate = te.getFuelUsageRate(); int shotsLeft = (int) (te.fuelLevel / fuelUsageRate); int shotsLeftWithItems = (int) (shotsLeft + te.inventory.getStackInSlot(4).getCount() * (te.getFuelAddedByGunPowder() / fuelUsageRate)); - renderTooltip(ImmutableList.of(Lang.translate(_gunpowderLevel, "" + (int) (te.fuelLevel * 100)), - GRAY + Lang.translate(_shotsRemaining, "" + TextFormatting.BLUE + shotsLeft), - GRAY + Lang.translate(_shotsRemainingWithBackup, "" + TextFormatting.BLUE + shotsLeftWithItems)), - mouseX, mouseY); + + List tooltip = new ArrayList<>(); + tooltip.add(Lang.translate(_gunpowderLevel, "" + (int) (te.fuelLevel * 100))); + tooltip.add(GRAY + Lang.translate(_shotsRemaining, "" + TextFormatting.BLUE + shotsLeft)); + if (shotsLeftWithItems != shotsLeft) + tooltip.add(GRAY + + Lang.translate(_shotsRemainingWithBackup, "" + TextFormatting.BLUE + shotsLeftWithItems)); + + renderTooltip(tooltip, mouseX, mouseY); } - if (te.missingBlock != null) { + if (te.missingItem != null) { int missingBlockX = guiLeft + 145, missingBlockY = guiTop + 25; if (mouseX >= missingBlockX && mouseY >= missingBlockY && mouseX <= missingBlockX + 16 && mouseY <= missingBlockY + 16) { - renderTooltip(new ItemStack(BlockItem.BLOCK_TO_ITEM.get(te.missingBlock.getBlock())), mouseX, mouseY); + renderTooltip(te.missingItem, mouseX, mouseY); } } diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java index 081ddf8e8..b09beee26 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java @@ -11,6 +11,10 @@ import com.simibubi.create.config.AllConfigs; import com.simibubi.create.config.CSchematics; import com.simibubi.create.foundation.behaviour.base.SmartTileEntity; import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; +import com.simibubi.create.foundation.item.ItemHelper; +import com.simibubi.create.foundation.item.ItemHelper.ExtractionCountMode; +import com.simibubi.create.modules.schematics.ItemRequirement; +import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType; import com.simibubi.create.modules.schematics.MaterialChecklist; import com.simibubi.create.modules.schematics.SchematicWorld; import com.simibubi.create.modules.schematics.item.SchematicItem; @@ -18,6 +22,7 @@ import com.simibubi.create.modules.schematics.item.SchematicItem; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.PistonHeadBlock; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; @@ -33,7 +38,6 @@ import net.minecraft.network.PacketBuffer; import net.minecraft.state.properties.BedPart; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.DoubleBlockHalf; -import net.minecraft.state.properties.SlabType; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; @@ -48,6 +52,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; public class SchematicannonTileEntity extends SmartTileEntity implements INamedContainerProvider { @@ -71,17 +76,18 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC public BlockPos currentPos; public BlockPos schematicAnchor; public boolean schematicLoaded; - public BlockState missingBlock; - public boolean blockNotLoaded; + public ItemStack missingItem; + public boolean positionNotLoaded; public boolean hasCreativeCrate; private int printerCooldown; private int skipsLeft; private boolean blockSkipped; + private int printingEntityIndex; public BlockPos target; public BlockPos previousTarget; public List attachedInventories; - public List flyingBlocks; + public List flyingBlocks; public MaterialChecklist checklist; // Gui information @@ -124,6 +130,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC inventory = new SchematicannonInventory(this); statusMsg = "idle"; state = State.STOPPED; + printingEntityIndex = -1; replaceMode = 2; neighbourCheckCooldown = NEIGHBOUR_CHECKING; checklist = new MaterialChecklist(); @@ -143,8 +150,8 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC TileEntity tileEntity = world.getTileEntity(pos.offset(facing)); if (tileEntity != null) { - LazyOptional capability = tileEntity - .getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite()); + LazyOptional capability = + tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite()); if (capability.isPresent()) { attachedInventories.add(capability.orElse(null)); } @@ -174,11 +181,11 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC state = State.valueOf(compound.getString("State")); blocksPlaced = compound.getInt("AmountPlaced"); blocksToPlace = compound.getInt("AmountToPlace"); + printingEntityIndex = compound.getInt("EntityProgress"); - if (compound.contains("MissingBlock")) - missingBlock = NBTUtil.readBlockState(compound.getCompound("MissingBlock")); - else - missingBlock = null; + missingItem = null; + if (compound.contains("MissingItem")) + missingItem = ItemStack.read(compound.getCompound("MissingItem")); // Settings CompoundNBT options = compound.getCompound("Options"); @@ -203,15 +210,12 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC for (int i = 0; i < tagBlocks.size(); i++) { CompoundNBT c = tagBlocks.getCompound(i); - - BlockPos readBlockPos = NBTUtil.readBlockPos(c.getCompound("Target")); - BlockState readBlockState = NBTUtil.readBlockState(c.getCompound("Block")); - int int1 = c.getInt("TicksLeft"); - int int2 = c.getInt("TotalTicks"); + LaunchedItem launched = LaunchedItem.fromNBT(c); + BlockPos readBlockPos = launched.target; // Always write to Server tile if (world == null || !world.isRemote) { - flyingBlocks.add(new LaunchedBlock(this, readBlockPos, readBlockState, int1, int2)); + flyingBlocks.add(launched); continue; } @@ -224,7 +228,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC // Add new server side blocks if (i >= flyingBlocks.size()) { - flyingBlocks.add(new LaunchedBlock(this, readBlockPos, readBlockState, int1, int2)); + flyingBlocks.add(launched); continue; } @@ -256,9 +260,10 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC compound.putString("State", state.name()); compound.putInt("AmountPlaced", blocksPlaced); compound.putInt("AmountToPlace", blocksToPlace); + compound.putInt("EntityProgress", printingEntityIndex); - if (missingBlock != null) - compound.put("MissingBlock", NBTUtil.writeBlockState(missingBlock)); + if (missingItem != null) + compound.put("MissingItem", missingItem.serializeNBT()); // Settings CompoundNBT options = new CompoundNBT(); @@ -271,14 +276,8 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC if (target != null) compound.put("Target", NBTUtil.writeBlockPos(target)); ListNBT tagBlocks = new ListNBT(); - for (LaunchedBlock b : flyingBlocks) { - CompoundNBT c = new CompoundNBT(); - c.putInt("TotalTicks", b.totalTicks); - c.putInt("TicksLeft", b.ticksRemaining); - c.put("Target", NBTUtil.writeBlockPos(b.target)); - c.put("Block", NBTUtil.writeBlockState(b.state)); - tagBlocks.add(c); - } + for (LaunchedItem b : flyingBlocks) + tagBlocks.add(b.serializeNBT()); compound.put("FlyingBlocks", tagBlocks); return compound; @@ -287,7 +286,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC @Override public void tick() { super.tick(); - + if (neighbourCheckCooldown-- <= 0) { neighbourCheckCooldown = NEIGHBOUR_CHECKING; findInventories(); @@ -344,7 +343,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC return; } - if (state == State.PAUSED && !blockNotLoaded && missingBlock == null && fuelLevel > getFuelUsageRate()) + if (state == State.PAUSED && !positionNotLoaded && missingItem == null && fuelLevel > getFuelUsageRate()) return; // Initialize Printer @@ -370,13 +369,13 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC // Update Target if (hasCreativeCrate) { - if (missingBlock != null) { - missingBlock = null; + if (missingItem != null) { + missingItem = null; state = State.RUNNING; } } - if (missingBlock == null && !blockNotLoaded) { + if (missingItem == null && !positionNotLoaded) { advanceCurrentPos(); // End reached @@ -387,61 +386,83 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC target = schematicAnchor.add(currentPos); } + boolean entityMode = printingEntityIndex >= 0; + // Check block if (!getWorld().isAreaLoaded(target, 0)) { - blockNotLoaded = true; + positionNotLoaded = true; statusMsg = "targetNotLoaded"; state = State.PAUSED; return; } else { - if (blockNotLoaded) { - blockNotLoaded = false; + if (positionNotLoaded) { + positionNotLoaded = false; state = State.RUNNING; } } - BlockState blockState = blockReader.getBlockState(target); - ItemStack requiredItem = getItemForBlock(blockState); + boolean shouldSkip = false; + BlockState blockState = Blocks.AIR.getDefaultState(); + ItemRequirement requirement; - if (!shouldPlace(target, blockState) || requiredItem.isEmpty()) { + if (entityMode) { + requirement = ItemRequirement.of(blockReader.getEntities().get(printingEntityIndex)); + + } else { + blockState = blockReader.getBlockState(target); + requirement = ItemRequirement.of(blockState); + shouldSkip = !shouldPlace(target, blockState); + } + + if (shouldSkip || requirement.isInvalid()) { statusMsg = "searching"; blockSkipped = true; return; } // Find item - if (blockState.has(BlockStateProperties.SLAB_TYPE) - && blockState.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE) - requiredItem.setCount(2); + List requiredItems = requirement.getRequiredItems(); + if (!requirement.isEmpty()) { + for (ItemStack required : requiredItems) { + if (!grabItemsFromAttachedInventories(required, requirement.getUsage(), true)) { + if (skipMissing) { + statusMsg = "skipping"; + blockSkipped = true; + if (missingItem != null) { + missingItem = null; + state = State.RUNNING; + } + return; + } - if (!findItemInAttachedInventories(requiredItem)) { - if (skipMissing) { - statusMsg = "skipping"; - blockSkipped = true; - if (missingBlock != null) { - missingBlock = null; - state = State.RUNNING; + missingItem = required; + state = State.PAUSED; + statusMsg = "missingBlock"; + return; } - return; } - missingBlock = blockState; - state = State.PAUSED; - statusMsg = "missingBlock"; - return; + for (ItemStack required : requiredItems) + grabItemsFromAttachedInventories(required, requirement.getUsage(), false); } // Success state = State.RUNNING; - if (blockState.getBlock() != Blocks.AIR) + if (blockState.getBlock() != Blocks.AIR || entityMode) statusMsg = "placing"; else statusMsg = "clearing"; - launchBlock(target, blockState); + + ItemStack icon = requirement.isEmpty() || requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0); + if (entityMode) + launchEntity(target, icon, blockReader.getEntities().get(printingEntityIndex)); + else + launchBlock(target, icon, blockState); + printerCooldown = config().schematicannonDelay.get(); fuelLevel -= getFuelUsageRate(); sendUpdate = true; - missingBlock = null; + missingItem = null; } public double getFuelUsageRate() { @@ -487,6 +508,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC schematicLoaded = true; state = State.PAUSED; statusMsg = "ready"; + printingEntityIndex = -1; updateChecklist(); sendUpdate = true; blocksToPlace += blocksPlaced; @@ -498,44 +520,82 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC return item == Items.AIR ? ItemStack.EMPTY : new ItemStack(item); } - protected boolean findItemInAttachedInventories(ItemStack requiredItem) { + protected boolean grabItemsFromAttachedInventories(ItemStack required, ItemUseType usage, boolean simulate) { if (hasCreativeCrate) return true; - boolean two = requiredItem.getCount() == 2; - int lastSlot = -1; + // Find and apply damage + if (usage == ItemUseType.DAMAGE) { + for (IItemHandler iItemHandler : attachedInventories) { + for (int slot = 0; slot < iItemHandler.getSlots(); slot++) { + ItemStack extractItem = iItemHandler.extractItem(slot, 1, true); + if (!ItemRequirement.validate(required, extractItem)) + continue; + if (!extractItem.isDamageable()) + continue; - for (IItemHandler iItemHandler : attachedInventories) { - for (int slot = 0; slot < iItemHandler.getSlots(); slot++) { - ItemStack stackInSlot = iItemHandler.getStackInSlot(slot); - if (!stackInSlot.isItemEqual(requiredItem)) - continue; - if (!two && !iItemHandler.extractItem(slot, 1, false).isEmpty()) - return true; - - // Two Items required (Double slabs) - if (two) { - int count = iItemHandler.extractItem(slot, 2, true).getCount(); - if (count == 2) { - iItemHandler.extractItem(slot, 2, false); - return true; - } else if (count == 1) { - if (lastSlot == -1) - lastSlot = slot; - else { - iItemHandler.extractItem(lastSlot, 1, false); - iItemHandler.extractItem(slot, 1, false); - return true; + if (!simulate) { + ItemStack stack = iItemHandler.extractItem(slot, 1, false); + stack.setDamage(stack.getDamage() + 1); + if (stack.getDamage() <= stack.getMaxDamage()) { + if (iItemHandler.getStackInSlot(slot).isEmpty()) + iItemHandler.insertItem(slot, stack, false); + else + ItemHandlerHelper.insertItem(iItemHandler, stack, false); } } - } + return true; + } } } - return false; + + // Find and remove + boolean success = false; + if (usage == ItemUseType.CONSUME) { + int amountFound = 0; + for (IItemHandler iItemHandler : attachedInventories) { + + amountFound += ItemHelper.extract(iItemHandler, s -> ItemRequirement.validate(required, s), + ExtractionCountMode.UPTO, required.getCount(), true).getCount(); + + if (amountFound < required.getCount()) + continue; + + success = true; + break; + } + } + + if (!simulate && success) { + int amountFound = 0; + for (IItemHandler iItemHandler : attachedInventories) { + amountFound += ItemHelper.extract(iItemHandler, s -> ItemRequirement.validate(required, s), + ExtractionCountMode.UPTO, required.getCount(), false).getCount(); + if (amountFound < required.getCount()) + continue; + break; + } + } + + return success; } protected void advanceCurrentPos() { + List entities = blockReader.getEntities(); + if (printingEntityIndex != -1) { + printingEntityIndex++; + + // End of entities reached + if (printingEntityIndex >= entities.size()) { + finishedPrinting(); + return; + } + + currentPos = entities.get(printingEntityIndex).getPosition().subtract(schematicAnchor); + return; + } + BlockPos size = blockReader.getBounds().getSize(); currentPos = currentPos.offset(Direction.EAST); BlockPos posInBounds = currentPos.subtract(blockReader.getBounds().getOrigin()); @@ -545,29 +605,38 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC if (posInBounds.getZ() > size.getZ()) currentPos = new BlockPos(currentPos.getX(), currentPos.getY() + 1, blockReader.getBounds().z).west(); - // End reached + // End of blocks reached if (currentPos.getY() > size.getY()) { - inventory.setStackInSlot(0, ItemStack.EMPTY); - inventory.setStackInSlot(1, - new ItemStack(AllItems.EMPTY_BLUEPRINT.get(), inventory.getStackInSlot(1).getCount() + 1)); - state = State.STOPPED; - statusMsg = "finished"; - resetPrinter(); - target = getPos().add(1, 0, 0); - world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_FINISH.get(), - SoundCategory.BLOCKS, 1, .7f); - sendUpdate = true; - return; + printingEntityIndex = 0; + if (entities.isEmpty()) { + finishedPrinting(); + return; + } + currentPos = entities.get(0).getPosition().subtract(schematicAnchor); } } + public void finishedPrinting() { + inventory.setStackInSlot(0, ItemStack.EMPTY); + inventory.setStackInSlot(1, + new ItemStack(AllItems.EMPTY_BLUEPRINT.get(), inventory.getStackInSlot(1).getCount() + 1)); + state = State.STOPPED; + statusMsg = "finished"; + resetPrinter(); + target = getPos().add(1, 0, 0); + world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_FINISH.get(), + SoundCategory.BLOCKS, 1, .7f); + sendUpdate = true; + } + protected void resetPrinter() { schematicLoaded = false; schematicAnchor = null; currentPos = null; blockReader = null; - missingBlock = null; + missingItem = null; sendUpdate = true; + printingEntityIndex = -1; schematicProgress = 0; blocksPlaced = 0; blocksToPlace = 0; @@ -577,6 +646,10 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC BlockState toReplace = world.getBlockState(pos); boolean placingAir = state.getBlock() == Blocks.AIR; + if (!world.isBlockPresent(pos)) + return false; + if (!world.getWorldBorder().contains(pos)) + return false; if (toReplace == state) return false; if (toReplace.getBlockHardness(world, pos) == -1) @@ -622,21 +695,10 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } protected void tickFlyingBlocks() { - List toRemove = new LinkedList<>(); - for (LaunchedBlock b : flyingBlocks) { - b.update(); - if (b.ticksRemaining <= 0 && !world.isRemote) { - - // Piston - if (b.state.has(BlockStateProperties.EXTENDED)) { - b.state = b.state.with(BlockStateProperties.EXTENDED, false); - } - - world.setBlockState(b.target, b.state, 18); - b.state.getBlock().onBlockPlacedBy(world, b.target, b.state, null, getItemForBlock(b.state)); + List toRemove = new LinkedList<>(); + for (LaunchedItem b : flyingBlocks) + if (b.update(world)) toRemove.add(b); - } - } flyingBlocks.removeAll(toRemove); } @@ -696,10 +758,20 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC sendUpdate = true; } - protected void launchBlock(BlockPos target, BlockState state) { + protected void launchBlock(BlockPos target, ItemStack stack, BlockState state) { if (state.getBlock() != Blocks.AIR) blocksPlaced++; - flyingBlocks.add(new LaunchedBlock(this, target, state)); + flyingBlocks.add(new LaunchedItem.ForBlockState(this.getPos(), target, stack, state)); + playFiringSound(); + } + + protected void launchEntity(BlockPos target, ItemStack stack, Entity entity) { + blocksPlaced++; + flyingBlocks.add(new LaunchedItem.ForEntity(this.getPos(), target, stack, entity)); + playFiringSound(); + } + + public void playFiringSound() { world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_LAUNCH_BLOCK.get(), SoundCategory.BLOCKS, .1f, 1.1f); } @@ -721,6 +793,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC public void updateChecklist() { checklist.required.clear(); + checklist.damageRequired.clear(); checklist.blocksNotLoaded = false; if (schematicLoaded) { @@ -734,18 +807,22 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } if (!shouldPlace(pos.add(schematicAnchor), required)) continue; - ItemStack requiredItem = getItemForBlock(required); - if (requiredItem.isEmpty()) + ItemRequirement requirement = ItemRequirement.of(required); + if (requirement.isEmpty()) continue; - - // Two items for double slabs - if (required.has(BlockStateProperties.SLAB_TYPE) - && required.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE) - checklist.require(requiredItem.getItem()); - - checklist.require(requiredItem.getItem()); + if (requirement.isInvalid()) + continue; + checklist.require(requirement); blocksToPlace++; } + for (Entity entity : blockReader.getEntities()) { + ItemRequirement requirement = ItemRequirement.of(entity); + if (requirement.isEmpty()) + continue; + if (requirement.isInvalid()) + continue; + checklist.require(requirement); + } } checklist.gathered.clear(); for (IItemHandler inventory : attachedInventories) { @@ -762,7 +839,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC @Override public void addBehaviours(List behaviours) { } - + @Override public void lazyTick() { super.lazyTick(); diff --git a/src/main/java/com/simibubi/create/modules/schematics/client/SchematicAndQuillHandler.java b/src/main/java/com/simibubi/create/modules/schematics/client/SchematicAndQuillHandler.java index c0cec4880..aabb4e709 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/client/SchematicAndQuillHandler.java +++ b/src/main/java/com/simibubi/create/modules/schematics/client/SchematicAndQuillHandler.java @@ -225,7 +225,7 @@ public class SchematicAndQuillHandler { Template t = new Template(); MutableBoundingBox bb = new MutableBoundingBox(firstPos, secondPos); t.takeBlocksFromWorld(Minecraft.getInstance().world, new BlockPos(bb.minX, bb.minY, bb.minZ), - new BlockPos(bb.getXSize(), bb.getYSize(), bb.getZSize()), false, Blocks.AIR); + new BlockPos(bb.getXSize(), bb.getYSize(), bb.getZSize()), true, Blocks.AIR); if (string.isEmpty()) string = Lang.translate("schematicAndQuill.fallbackName"); diff --git a/src/main/java/com/simibubi/create/modules/schematics/packet/SchematicPlacePacket.java b/src/main/java/com/simibubi/create/modules/schematics/packet/SchematicPlacePacket.java index 82db762ef..a62e6e2f1 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/packet/SchematicPlacePacket.java +++ b/src/main/java/com/simibubi/create/modules/schematics/packet/SchematicPlacePacket.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTUtil; import net.minecraft.network.PacketBuffer; +import net.minecraft.world.gen.feature.template.PlacementSettings; import net.minecraft.world.gen.feature.template.Template; import net.minecraftforge.fml.network.NetworkEvent.Context; @@ -32,8 +33,10 @@ public class SchematicPlacePacket extends SimplePacketBase { context.get().enqueueWork(() -> { ServerPlayerEntity player = context.get().getSender(); Template t = SchematicItem.loadSchematic(stack); + PlacementSettings settings = SchematicItem.getSettings(stack); + settings.setIgnoreEntities(false); t.addBlocksToWorld(player.getServerWorld(), NBTUtil.readBlockPos(stack.getTag().getCompound("Anchor")), - SchematicItem.getSettings(stack)); + settings); }); context.get().setPacketHandled(true); } diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index 566681264..9afcf6b02 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -534,11 +534,11 @@ "create.schematicannon.status.paused": "Paused", "create.schematicannon.status.stopped": "Stopped", "create.schematicannon.status.noGunpowder": "Out of Gunpowder", - "create.schematicannon.status.targetNotLoaded": "Block is Not Loaded", - "create.schematicannon.status.targetOutsideRange": "Target too Far Away", + "create.schematicannon.status.targetNotLoaded": "Target is not loaded", + "create.schematicannon.status.targetOutsideRange": "Target too far away", "create.schematicannon.status.searching": "Searching", "create.schematicannon.status.skipping": "Skipping", - "create.schematicannon.status.missingBlock": "Missing Block:", + "create.schematicannon.status.missingBlock": "Missing Item:", "create.schematicannon.status.placing": "Placing", "create.schematicannon.status.clearing": "Clearing Blocks", "create.schematicannon.status.schematicInvalid": "Schematic Invalid", diff --git a/src/main/resources/assets/create/textures/item/belt.png b/src/main/resources/assets/create/textures/item/belt.png index 772436f7e58dbe0c41f7e493ecfd201428bc6a47..31fec49cfa5770f5bdde5012c46126b6c35b47f7 100644 GIT binary patch delta 351 zcmV-l0igbZ0+9odBnkm@Qb$4nuFf3kks%v@zyJUazyWI3i3tDz0VYXAK~y+T#ge~j z!!QuWFWzmL%&kpdpv45T_7AjMAw${Qq2yLuD-bn zAXOM+{4=O)O(Mq7(1x~=P3-H)1+M|bFmZusF`w~*DcZQYxif5#ua@+h=XO|YzAP2E zCJ=46HLuO4q_48z{Q%BLuqg*pJ|bR9l5-y&O#S2itx1n33?qJkTR?IwxQlgin(&Y0 xFNrG9%7&oZ$|-Ui$#%D=V@uaM^+*tx!`>j_^ZAI zzevj#v_OfyLqFyM1TAdNFQ)<%2y57!Urq%E!Wx+M6e0?h-_h;?8Rn91kQ;=w00000 LNkvXXu0mjfA%ajd diff --git a/src/main/resources/assets/create/textures/item/brass_ingot.png b/src/main/resources/assets/create/textures/item/brass_ingot.png index c7c3ab97ffdbb596f9151f048540793680ad2f2b..ea33f846b0b2544775a54c086094658816e27864 100644 GIT binary patch delta 380 zcmV-?0fYYh1H1!}Nq@iq01m(bYSxJf0003|NklG${NGvpRd1b-XC0ulge20Dx3-=AY( z1;_xV2?So>oX&9e=s7U^?!$Lr8f*XvT-n>hpyONuHUwQ02!J&1J9HY%77>>K(;xsh z00dx$AZr2vn8vpsJ~9Xk@PpYfzyzfkE}Vxbh5?w3APmw7!XSWbI|zVX@b&voFb4!+ z{)A}+0hp~I&2{T{T?4a^pMM071-KWUy#@vf&=m#@Mo>3)GboJ@oPyE_ zK+u5nNb~<7dgk(zj9>v2a0%*YCcB#SkZT1T%uzbet-YM@a5$r zhW~&60Nu*OP}{T!%@8C5(j#;K10@;${W-?)@9%F0MrKxq?|<)JF#G`;^8epopx7UV z(}zwmEZKCLVabLIKtmwm!2~9u;L6?}1|}9Opr)@3e|~&nU}9!rVBzEeVr~Xul~e|g zq}dFU`|}xM0u10@WP#Ff@cQO-22u4)h94icF>nd{K}8uDzP;VVaA@OZhBxoNGTeRm z4l0V~f(z%*fq!X`OE?6)7(m_w8MtF!D#N<@D;O@_e9Z9dH9|88zzz8N{U?|{dlX^_ z2<)6chhgXD!(dxM8sEHp0mjGx#RbTwgKUOrglT^J;UgF$1GoX8kiB&C1=yJ&ue^MM zu=VE6n_!LC9{vU6{JoX#{D20XAffuxP}Z5-kno;L(Jt2^ruq n00J;G4mJQZ0B#u>;1mM@S?%OFiw+{x00000NkvXXu0mjfbSKDN From ef541493c5b1e67363c075911893000f221bf4b6 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 5 May 2020 20:36:42 +0200 Subject: [PATCH 06/13] Asset tweak - Made new belt sprite less aggressive --- .../assets/create/textures/item/belt.png | Bin 401 -> 384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/create/textures/item/belt.png b/src/main/resources/assets/create/textures/item/belt.png index 31fec49cfa5770f5bdde5012c46126b6c35b47f7..50be7ce5a4dfa6f1e4c0f2f4a140c0306715eeb6 100644 GIT binary patch delta 320 zcmV-G0l)r{1AqgNNq@fp01m$aI0aKA0003MNklgJ+Z1K{_*Dd3K%WrDu`YK`RRF01_ZKuk28i?Au$ffBCPfTu z;cNvE|2J9xeDlB>Njkj;%fE5@Jm+2!00{afvfk~s90ySpbBqlJqp|(nZs>5xU9f)J z;BVl^gi3=dAUOm`@cI6xoPm^Fg|q`8#_XPQ=mCZJSiByE^88_N2{?b!5d8s=da=Kc S%GY2300008E@gYsV*N=f z?zSc_0o=|nGD_2w4_%Y2*WWV)ZWTddg}dMo;wVzh4w0_Dxe6dv7-Rf1sB29k#?a7) zwvkQj>&OMK0mLwIfoL(G@q#JZxVpJBY>=;(^qS{(SZls46}To4ZMQYA&8DQUvf%vy z&PcE+2U0#FUP_X4A015n Date: Wed, 6 May 2020 20:24:04 +0200 Subject: [PATCH 07/13] Rebooting Advancements - Reworked basic advancement tree, to be continued - Removed unused trigger and damage source for sandpaper - Added some new crate assets --- .../java/com/simibubi/create/AllBlocks.java | 6 +- .../create/data/CreateAdvancements.java | 314 ++++++++++++++++++ .../foundation/advancement/AllTriggers.java | 42 ++- .../foundation/advancement/ITriggerable.java | 9 + .../advancement/KineticBlockTrigger.java | 76 +++++ .../advancement/SandpaperUseTrigger.java | 47 --- .../foundation/advancement/SimpleTrigger.java | 6 +- .../foundation/utility/data/Generator.java | 4 +- .../contraptions/base/KineticTileEntity.java | 33 +- .../press/MechanicalPressTileEntity.java | 5 +- .../waterwheel/WaterWheelBlock.java | 12 +- .../contraptions/processing/BasinBlock.java | 6 + .../processing/BasinOperatingTileEntity.java | 10 + .../relays/belt/item/BeltConnectorItem.java | 5 +- .../relays/elementary/CogwheelBlockItem.java | 45 ++- .../curiosities/tools/SandPaperItem.java | 8 +- .../block/inventories/CrateBlock.java | 81 +++++ .../block/inventories/FlexcrateBlock.java | 74 +---- .../schematics/block/CreativeCrateBlock.java | 36 -- .../create/blockstates/creative_crate.json | 17 +- .../create/blockstates/filtered_crate.json | 17 + .../assets/create/blockstates/flexcrate.json | 24 +- .../create/blockstates/warehouse_crate.json | 17 + .../resources/assets/create/lang/en_us.json | 122 ++++--- .../block/crate/andesite/double_bottom.json | 8 + .../block/crate/andesite/double_left.json | 8 + .../block/crate/andesite/double_right.json | 8 + .../block/crate/andesite/double_top.json | 8 + .../models/block/crate/andesite/single.json | 8 + .../block/crate/brass/double_bottom.json | 8 + .../models/block/crate/brass/double_left.json | 8 + .../block/crate/brass/double_right.json | 8 + .../models/block/crate/brass/double_top.json | 8 + .../models/block/crate/brass/single.json | 8 + .../block/crate/copper/double_bottom.json | 8 + .../block/crate/copper/double_left.json | 8 + .../block/crate/copper/double_right.json | 8 + .../models/block/crate/copper/double_top.json | 8 + .../models/block/crate/copper/single.json | 8 + .../block/crate/creative/double_bottom.json | 8 + .../block/crate/creative/double_left.json | 8 + .../block/crate/creative/double_right.json | 8 + .../block/crate/creative/double_top.json | 8 + .../models/block/crate/creative/single.json | 8 + .../{flexcrate => crate}/double_bottom.json | 8 +- .../{flexcrate => crate}/double_left.json | 9 +- .../{flexcrate => crate}/double_right.json | 9 +- .../{flexcrate => crate}/double_top.json | 8 +- .../create/models/block/crate/single.json | 23 ++ .../create/models/block/flexcrate/single.json | 23 -- .../create/models/item/creative_crate.json | 2 +- .../create/models/item/filtered_crate.json | 3 + .../assets/create/models/item/flexcrate.json | 2 +- .../create/models/item/warehouse_crate.json | 3 + .../create/textures/block/brass_casing_14.png | Bin 468 -> 0 bytes .../create/textures/block/crate_andesite.png | Bin 0 -> 1324 bytes .../textures/block/crate_andesite_side.png | Bin 0 -> 1298 bytes .../create/textures/block/crate_brass.png | Bin 0 -> 1253 bytes ...lexcrate_side.png => crate_brass_side.png} | Bin .../create/textures/block/crate_copper.png | Bin 0 -> 1325 bytes .../textures/block/crate_copper_side.png | Bin 0 -> 1387 bytes .../create/textures/block/crate_creative.png | Bin 0 -> 1004 bytes .../textures/block/crate_creative_side.png | Bin 0 -> 1238 bytes .../textures/block/creative_crate_side.png | Bin 524 -> 0 bytes .../textures/block/creative_crate_top.png | Bin 316 -> 0 bytes .../block/double_flexcrate_bottom.png | Bin 763 -> 0 bytes .../create/textures/block/flex_crate.png | Bin 561 -> 0 bytes .../create/advancements/andesite_alloy.json | 59 ++-- .../create/advancements/andesite_casing.json | 59 ++-- .../data/create/advancements/basin.json | 37 +++ .../data/create/advancements/belt.json | 28 ++ .../data/create/advancements/brass.json | 58 ++-- .../create/advancements/brass_casing.json | 59 ++-- .../advancements/chromatic_compound.json | 60 ++-- .../data/create/advancements/compact.json | 28 ++ .../data/create/advancements/crafter.json | 40 +++ .../create/advancements/crushing_wheel.json | 63 ++-- .../data/create/advancements/deployer.json | 62 ++-- .../create/advancements/deployer_secret.json | 23 -- .../data/create/advancements/drill.json | 40 +++ .../create/advancements/electron_tube.json | 35 ++ .../create/advancements/expert_lane_1.json | 35 ++ .../data/create/advancements/fist_bump.json | 28 ++ .../data/create/advancements/goggles.json | 35 ++ .../data/create/advancements/its_alive.json | 28 ++ .../data/create/advancements/lava_wheel.json | 28 ++ .../create/advancements/mechanical_mixer.json | 30 -- .../create/advancements/mechanical_press.json | 48 --- .../data/create/advancements/millstone.json | 40 +++ .../data/create/advancements/mixer.json | 46 +++ .../create/advancements/overstressed.json | 44 +-- .../advancements/polished_rose_quartz.json | 61 ++-- .../data/create/advancements/press.json | 28 ++ .../create/advancements/refined_radiance.json | 60 ++-- .../advancements/refined_radiance_secret.json | 24 -- .../data/create/advancements/root.json | 24 +- .../data/create/advancements/rotation.json | 23 -- .../data/create/advancements/sand_paper.json | 47 --- .../advancements/sand_paper_secret.json | 43 --- .../data/create/advancements/saw.json | 40 +++ .../create/advancements/shadow_steel.json | 59 ++-- .../create/advancements/shifting_gears.json | 28 ++ .../data/create/advancements/speed_gauge.json | 40 +++ .../create/advancements/speed_secret.json | 24 -- .../create/advancements/stress_gauge.json | 40 +++ .../data/create/advancements/water_wheel.json | 28 ++ .../data/create/advancements/wrench.json | 35 ++ 107 files changed, 2020 insertions(+), 863 deletions(-) create mode 100644 src/main/java/com/simibubi/create/data/CreateAdvancements.java create mode 100644 src/main/java/com/simibubi/create/foundation/advancement/ITriggerable.java create mode 100644 src/main/java/com/simibubi/create/foundation/advancement/KineticBlockTrigger.java delete mode 100644 src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java delete mode 100644 src/main/java/com/simibubi/create/modules/schematics/block/CreativeCrateBlock.java create mode 100644 src/main/resources/assets/create/blockstates/filtered_crate.json create mode 100644 src/main/resources/assets/create/blockstates/warehouse_crate.json create mode 100644 src/main/resources/assets/create/models/block/crate/andesite/double_bottom.json create mode 100644 src/main/resources/assets/create/models/block/crate/andesite/double_left.json create mode 100644 src/main/resources/assets/create/models/block/crate/andesite/double_right.json create mode 100644 src/main/resources/assets/create/models/block/crate/andesite/double_top.json create mode 100644 src/main/resources/assets/create/models/block/crate/andesite/single.json create mode 100644 src/main/resources/assets/create/models/block/crate/brass/double_bottom.json create mode 100644 src/main/resources/assets/create/models/block/crate/brass/double_left.json create mode 100644 src/main/resources/assets/create/models/block/crate/brass/double_right.json create mode 100644 src/main/resources/assets/create/models/block/crate/brass/double_top.json create mode 100644 src/main/resources/assets/create/models/block/crate/brass/single.json create mode 100644 src/main/resources/assets/create/models/block/crate/copper/double_bottom.json create mode 100644 src/main/resources/assets/create/models/block/crate/copper/double_left.json create mode 100644 src/main/resources/assets/create/models/block/crate/copper/double_right.json create mode 100644 src/main/resources/assets/create/models/block/crate/copper/double_top.json create mode 100644 src/main/resources/assets/create/models/block/crate/copper/single.json create mode 100644 src/main/resources/assets/create/models/block/crate/creative/double_bottom.json create mode 100644 src/main/resources/assets/create/models/block/crate/creative/double_left.json create mode 100644 src/main/resources/assets/create/models/block/crate/creative/double_right.json create mode 100644 src/main/resources/assets/create/models/block/crate/creative/double_top.json create mode 100644 src/main/resources/assets/create/models/block/crate/creative/single.json rename src/main/resources/assets/create/models/block/{flexcrate => crate}/double_bottom.json (67%) rename src/main/resources/assets/create/models/block/{flexcrate => crate}/double_left.json (66%) rename src/main/resources/assets/create/models/block/{flexcrate => crate}/double_right.json (66%) rename src/main/resources/assets/create/models/block/{flexcrate => crate}/double_top.json (68%) create mode 100644 src/main/resources/assets/create/models/block/crate/single.json delete mode 100644 src/main/resources/assets/create/models/block/flexcrate/single.json create mode 100644 src/main/resources/assets/create/models/item/filtered_crate.json create mode 100644 src/main/resources/assets/create/models/item/warehouse_crate.json delete mode 100644 src/main/resources/assets/create/textures/block/brass_casing_14.png create mode 100644 src/main/resources/assets/create/textures/block/crate_andesite.png create mode 100644 src/main/resources/assets/create/textures/block/crate_andesite_side.png create mode 100644 src/main/resources/assets/create/textures/block/crate_brass.png rename src/main/resources/assets/create/textures/block/{double_flexcrate_side.png => crate_brass_side.png} (100%) create mode 100644 src/main/resources/assets/create/textures/block/crate_copper.png create mode 100644 src/main/resources/assets/create/textures/block/crate_copper_side.png create mode 100644 src/main/resources/assets/create/textures/block/crate_creative.png create mode 100644 src/main/resources/assets/create/textures/block/crate_creative_side.png delete mode 100644 src/main/resources/assets/create/textures/block/creative_crate_side.png delete mode 100644 src/main/resources/assets/create/textures/block/creative_crate_top.png delete mode 100644 src/main/resources/assets/create/textures/block/double_flexcrate_bottom.png delete mode 100644 src/main/resources/assets/create/textures/block/flex_crate.png create mode 100644 src/main/resources/data/create/advancements/basin.json create mode 100644 src/main/resources/data/create/advancements/belt.json create mode 100644 src/main/resources/data/create/advancements/compact.json create mode 100644 src/main/resources/data/create/advancements/crafter.json delete mode 100644 src/main/resources/data/create/advancements/deployer_secret.json create mode 100644 src/main/resources/data/create/advancements/drill.json create mode 100644 src/main/resources/data/create/advancements/electron_tube.json create mode 100644 src/main/resources/data/create/advancements/expert_lane_1.json create mode 100644 src/main/resources/data/create/advancements/fist_bump.json create mode 100644 src/main/resources/data/create/advancements/goggles.json create mode 100644 src/main/resources/data/create/advancements/its_alive.json create mode 100644 src/main/resources/data/create/advancements/lava_wheel.json delete mode 100644 src/main/resources/data/create/advancements/mechanical_mixer.json delete mode 100644 src/main/resources/data/create/advancements/mechanical_press.json create mode 100644 src/main/resources/data/create/advancements/millstone.json create mode 100644 src/main/resources/data/create/advancements/mixer.json create mode 100644 src/main/resources/data/create/advancements/press.json delete mode 100644 src/main/resources/data/create/advancements/refined_radiance_secret.json delete mode 100644 src/main/resources/data/create/advancements/rotation.json delete mode 100644 src/main/resources/data/create/advancements/sand_paper.json delete mode 100644 src/main/resources/data/create/advancements/sand_paper_secret.json create mode 100644 src/main/resources/data/create/advancements/saw.json create mode 100644 src/main/resources/data/create/advancements/shifting_gears.json create mode 100644 src/main/resources/data/create/advancements/speed_gauge.json delete mode 100644 src/main/resources/data/create/advancements/speed_secret.json create mode 100644 src/main/resources/data/create/advancements/stress_gauge.json create mode 100644 src/main/resources/data/create/advancements/water_wheel.json create mode 100644 src/main/resources/data/create/advancements/wrench.json diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 10cde1866..84d8351a0 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -74,6 +74,7 @@ import com.simibubi.create.modules.logistics.block.diodes.ToggleLatchBlock; import com.simibubi.create.modules.logistics.block.extractor.ExtractorBlock; import com.simibubi.create.modules.logistics.block.extractor.LinkedExtractorBlock; import com.simibubi.create.modules.logistics.block.funnel.FunnelBlock; +import com.simibubi.create.modules.logistics.block.inventories.CrateBlock; import com.simibubi.create.modules.logistics.block.inventories.FlexcrateBlock; import com.simibubi.create.modules.logistics.block.transposer.LinkedTransposerBlock; import com.simibubi.create.modules.logistics.block.transposer.TransposerBlock; @@ -85,7 +86,6 @@ import com.simibubi.create.modules.palettes.HorizontalCTGlassBlock; import com.simibubi.create.modules.palettes.LayeredCTBlock; import com.simibubi.create.modules.palettes.ScoriaBlock; import com.simibubi.create.modules.palettes.VerticalCTGlassBlock; -import com.simibubi.create.modules.schematics.block.CreativeCrateBlock; import com.simibubi.create.modules.schematics.block.SchematicTableBlock; import com.simibubi.create.modules.schematics.block.SchematicannonBlock; @@ -115,7 +115,6 @@ public enum AllBlocks { __SCHEMATICS__(), SCHEMATICANNON(new SchematicannonBlock()), - CREATIVE_CRATE(new CreativeCrateBlock()), SCHEMATIC_TABLE(new SchematicTableBlock()), __CONTRAPTIONS__(), @@ -183,7 +182,10 @@ public enum AllBlocks { CONTACT(new ContactBlock()), REDSTONE_BRIDGE(new RedstoneLinkBlock()), STOCKSWITCH(new StockswitchBlock()), + WAREHOUSE_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), FLEXCRATE(new FlexcrateBlock()), + FILTERED_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), + CREATIVE_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), EXTRACTOR(new ExtractorBlock()), VERTICAL_EXTRACTOR(new ExtractorBlock.Vertical()), LINKED_EXTRACTOR(new LinkedExtractorBlock()), diff --git a/src/main/java/com/simibubi/create/data/CreateAdvancements.java b/src/main/java/com/simibubi/create/data/CreateAdvancements.java new file mode 100644 index 000000000..6c8dd3608 --- /dev/null +++ b/src/main/java/com/simibubi/create/data/CreateAdvancements.java @@ -0,0 +1,314 @@ +package com.simibubi.create.data; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.Set; +import java.util.function.Consumer; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.google.common.collect.Sets; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllItems; +import com.simibubi.create.Create; +import com.simibubi.create.foundation.advancement.AllTriggers; +import com.simibubi.create.foundation.advancement.KineticBlockTrigger; + +import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.Advancement.Builder; +import net.minecraft.advancements.FrameType; +import net.minecraft.advancements.IRequirementsStrategy; +import net.minecraft.advancements.criterion.InventoryChangeTrigger; +import net.minecraft.advancements.criterion.PlacedBlockTrigger; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.DirectoryCache; +import net.minecraft.data.IDataProvider; +import net.minecraft.item.Items; +import net.minecraft.util.IItemProvider; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TranslationTextComponent; + +@SuppressWarnings("unused") // dont warn about unused avancements +public class CreateAdvancements implements IDataProvider { + + static final String LANG = "advancement." + Create.ID + "."; + + public void register(Consumer t) { + String id = Create.ID; + + Advancement root = Advancement.Builder + .builder() + .withDisplay(AllItems.BRASS_HAND.asStack(), new TranslationTextComponent(LANG + "root"), + new TranslationTextComponent(LANG + "root.desc"), + new ResourceLocation(Create.ID, "textures/block/scoria_bricks.png"), FrameType.TASK, false, + false, false) + .withCriterion("0", InventoryChangeTrigger.Instance.forItems(new IItemProvider[] {})) + .register(t, id + ":root"); + + Advancement andesite_alloy = advancement("andesite_alloy", AllItems.ANDESITE_ALLOY.get(), TaskType.NORMAL) + .withParent(root) + .withCriterion("0", itemGathered(AllItems.ANDESITE_ALLOY.get())) + .register(t, id + ":andesite_alloy"); + + + kineticsBranch(t, andesite_alloy); + + Advancement water_wheel = advancement("water_wheel", AllBlocks.WATER_WHEEL.get(), TaskType.NORMAL) + .withParent(andesite_alloy) + .withCriterion("0", placeBlock(AllBlocks.WATER_WHEEL.get())) + .withCriterion("1", AllTriggers.WATER_WHEEL.instance()) + .register(t, id + ":water_wheel"); + + Advancement lava_wheel = advancement("lava_wheel", Items.LAVA_BUCKET, TaskType.SECRET) + .withParent(water_wheel) + .withCriterion("0", AllTriggers.LAVA_WHEEL.instance()) + .register(t, id + ":lava_wheel"); + + Advancement millstone = kinecticAdvancement("millstone", AllBlocks.MILLSTONE, TaskType.NORMAL) + .withParent(andesite_alloy) + .register(t, id + ":millstone"); + + Advancement andesite_casing = advancement("andesite_casing", AllBlocks.ANDESITE_CASING.get(), TaskType.GOAL) + .withParent(andesite_alloy) + .withCriterion("0", itemGathered(AllBlocks.ANDESITE_CASING.get())) + .register(t, id + ":andesite_casing"); + + andesiteExpertLane(t, andesite_casing); + + Advancement drill = kinecticAdvancement("drill", AllBlocks.DRILL, TaskType.NORMAL) + .withParent(andesite_casing) + .register(t, id + ":drill"); + + Advancement press = advancement("press", AllBlocks.MECHANICAL_PRESS.get(), TaskType.MILESTONE) + .withParent(andesite_casing) + .withCriterion("0", AllTriggers.BONK.instance()) + .register(t, id + ":press"); + + Advancement rose_quartz = itemAdvancement("polished_rose_quartz", AllItems.POLISHED_ROSE_QUARTZ, TaskType.NORMAL) + .withParent(andesite_casing) + .register(t, id + ":polished_rose_quartz"); + + Advancement electron_tube = itemAdvancement("electron_tube", AllItems.ELECTRON_TUBE, TaskType.NORMAL) + .withParent(rose_quartz) + .register(t, id + ":electron_tube"); + + Advancement saw = + kinecticAdvancement("saw", AllBlocks.SAW, TaskType.NORMAL).withParent(press).register(t, id + ":saw"); + + Advancement basin = advancement("basin", AllBlocks.BASIN.get(), TaskType.NORMAL) + .withParent(press) + .withCriterion("0", placeBlock(AllBlocks.BASIN.get())) + .withCriterion("1", AllTriggers.BASIN_THROW.instance()) + .register(t, id + ":basin"); + + Advancement mixer = advancement("mixer", AllBlocks.MECHANICAL_MIXER.get(), TaskType.MILESTONE) + .withCriterion("0", placeBlock(AllBlocks.MECHANICAL_MIXER.get())) + .withCriterion("1", isPowered(AllBlocks.MECHANICAL_MIXER.get())) + .withCriterion("2", AllTriggers.MIXER_MIX.instance()) + .withParent(basin) + .register(t, id + ":mixer"); + + Advancement compact = advancement("compact", Blocks.IRON_BLOCK, TaskType.NORMAL) + .withCriterion("0", AllTriggers.PRESS_COMPACT.instance()) + .withParent(basin) + .register(t, id + ":compact"); + + Advancement brass = itemAdvancement("brass", AllItems.BRASS_INGOT, TaskType.NORMAL) + .withParent(mixer) + .register(t, id + ":brass"); + + brassAge(t, brass); + } + + void kineticsBranch(Consumer t, Advancement root) { + String id = Create.ID; + + Advancement its_alive = advancement("its_alive", AllBlocks.COGWHEEL.get(), TaskType.NORMAL) + .withParent(root) + .withCriterion("0", AllTriggers.ROTATION.instance()) + .register(t, id + ":its_alive"); + + Advancement belt = advancement("belt", AllItems.BELT_CONNECTOR.get(), TaskType.NORMAL) + .withParent(its_alive) + .withCriterion("0", AllTriggers.CONNECT_BELT.instance()) + .register(t, id + ":belt"); + + Advancement wrench = itemAdvancement("wrench", AllItems.WRENCH, TaskType.NORMAL) + .withParent(its_alive) + .register(t, id + ":wrench"); + + Advancement goggles = itemAdvancement("goggles", AllItems.GOGGLES, TaskType.NORMAL) + .withParent(its_alive) + .register(t, id + ":goggles"); + + Advancement speed_gauge = kinecticAdvancement("speed_gauge", AllBlocks.SPEED_GAUGE, TaskType.NORMAL) + .withParent(goggles) + .register(t, id + ":speed_gauge"); + + Advancement stress_gauge = kinecticAdvancement("stress_gauge", AllBlocks.STRESS_GAUGE, TaskType.NORMAL) + .withParent(goggles) + .register(t, id + ":stress_gauge"); + + Advancement shifting_gears = advancement("shifting_gears", AllBlocks.LARGE_COGWHEEL.get(), TaskType.NORMAL) + .withParent(its_alive) + .withCriterion("0", AllTriggers.SHIFTING_GEARS.instance()) + .register(t, id + ":shifting_gears"); + + Advancement overstressed = advancement("overstressed", Items.BARRIER, TaskType.SECRET) + .withParent(its_alive) + .withCriterion("0", AllTriggers.OVERSTRESSED.instance()) + .register(t, id + ":overstressed"); + + } + + void brassAge(Consumer t, Advancement root) { + String id = Create.ID; + + Advancement brass_casing = advancement("brass_casing", AllBlocks.BRASS_CASING.get(), TaskType.GOAL) + .withParent(root) + .withCriterion("0", itemGathered(AllBlocks.BRASS_CASING.get())) + .register(t, id + ":brass_casing"); + + Advancement crafter = kinecticAdvancement("crafter", AllBlocks.MECHANICAL_CRAFTER, TaskType.MILESTONE) + .withParent(brass_casing) + .register(t, id + ":crafter"); + + Advancement deployer = kinecticAdvancement("deployer", AllBlocks.DEPLOYER, TaskType.GOAL) + .withParent(brass_casing) + .register(t, id + ":deployer"); + + Advancement fist_bump = advancement("fist_bump", AllBlocks.LARGE_COGWHEEL.get(), TaskType.SECRET) + .withParent(deployer) + .withCriterion("0", AllTriggers.DEPLOYER_BOOP.instance()) + .register(t, id + ":fist_bump"); + + Advancement crushing_wheel = advancement("crushing_wheel", AllBlocks.CRUSHING_WHEEL.get(), TaskType.MILESTONE) + .withParent(crafter) + .withCriterion("0", itemGathered(AllBlocks.CRUSHING_WHEEL.get())) + .register(t, id + ":crushing_wheel"); + + Advancement chromatic_compound = + itemAdvancement("chromatic_compound", AllItems.CHROMATIC_COMPOUND, TaskType.NORMAL) + .withParent(crushing_wheel) + .register(t, id + ":chromatic_compound"); + + Advancement shadow_steel = + itemAdvancement("shadow_steel", AllItems.SHADOW_STEEL, TaskType.GOAL) + .withParent(chromatic_compound) + .register(t, id + ":shadow_steel"); + + Advancement refined_radiance = + itemAdvancement("refined_radiance", AllItems.REFINED_RADIANCE, TaskType.GOAL) + .withParent(chromatic_compound) + .register(t, id + ":refined_radiance"); + } + + private void andesiteExpertLane(Consumer t, Advancement root) { + String id = Create.ID; + + Advancement expert_lane_1 = advancement("expert_lane_1", Blocks.ANDESITE, TaskType.SILENT_GATE) + .withParent(root) + .withCriterion("0", itemGathered(AllBlocks.ANDESITE_CASING.get())) + .register(t, id + ":expert_lane_1"); + } + + // Datagen + + private static final Logger LOGGER = LogManager.getLogger(); + private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().create(); + private final DataGenerator generator; + + public CreateAdvancements(DataGenerator generatorIn) { + this.generator = generatorIn; + } + + @Override + public void act(DirectoryCache cache) throws IOException { + Path path = this.generator.getOutputFolder(); + Set set = Sets.newHashSet(); + Consumer consumer = (p_204017_3_) -> { + if (!set.add(p_204017_3_.getId())) + throw new IllegalStateException("Duplicate advancement " + p_204017_3_.getId()); + + Path path1 = getPath(path, p_204017_3_); + + try { + IDataProvider.save(GSON, cache, p_204017_3_.copy().serialize(), path1); + } catch (IOException ioexception) { + LOGGER.error("Couldn't save advancement {}", path1, ioexception); + } + }; + + register(consumer); + } + + private static Path getPath(Path pathIn, Advancement advancementIn) { + return pathIn + .resolve("data/" + advancementIn.getId().getNamespace() + "/advancements/" + + advancementIn.getId().getPath() + ".json"); + } + + @Override + public String getName() { + return "CreateAdvancements"; + } + + public PlacedBlockTrigger.Instance placeBlock(Block block) { + return PlacedBlockTrigger.Instance.placedBlock(block); + } + + public KineticBlockTrigger.Instance isPowered(Block block) { + return AllTriggers.KINETIC_BLOCK.forBlock(block); + } + + public InventoryChangeTrigger.Instance itemGathered(IItemProvider itemprovider) { + return InventoryChangeTrigger.Instance.forItems(itemprovider); + } + + static enum TaskType { + + NORMAL(FrameType.TASK, true, false, false), + MILESTONE(FrameType.TASK, true, true, false), + GOAL(FrameType.GOAL, true, true, false), + SECRET(FrameType.GOAL, true, true, true), + SILENT_GATE(FrameType.CHALLENGE, false, false, false), + + ; + + private FrameType frame; + private boolean toast; + private boolean announce; + private boolean hide; + + private TaskType(FrameType frame, boolean toast, boolean announce, boolean hide) { + this.frame = frame; + this.toast = toast; + this.announce = announce; + this.hide = hide; + } + } + + public Builder kinecticAdvancement(String name, AllBlocks block, TaskType type) { + return advancement(name, block.get(), type) + .withCriterion("0", placeBlock(block.get())) + .withCriterion("1", isPowered(block.get())); + } + + public Builder advancement(String name, IItemProvider icon, TaskType type) { + return Advancement.Builder + .builder() + .withDisplay(icon, new TranslationTextComponent(LANG + name), + new TranslationTextComponent(LANG + name + ".desc"), null, type.frame, type.toast, + type.announce, type.hide); + } + + public Builder itemAdvancement(String name, AllItems item, TaskType type) { + return advancement(name, item.get(), type).withCriterion("0", itemGathered(item.get())); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java index cb8ae3705..99adb7a55 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java @@ -15,17 +15,27 @@ public class AllTriggers { private static List> triggers = new LinkedList<>(); - public static SandpaperUseTrigger SANDPAPER_USE = add(new SandpaperUseTrigger("sandpaper_use")); - public static SimpleTrigger DEPLOYER_BOOP = simple("deployer"); - public static SimpleTrigger ABSORBED_LIGHT = simple("light_absorbed"); - public static SimpleTrigger SPEED_READ = simple("speed_read"); - public static SimpleTrigger OVERSTRESSED = simple("overstressed"); - public static SimpleTrigger ROTATION = simple("rotation"); + public static KineticBlockTrigger KINETIC_BLOCK = add(new KineticBlockTrigger("kinetic_block")); + + public static SimpleTrigger + ROTATION = simple("rotation"), + OVERSTRESSED = simple("overstressed"), + SHIFTING_GEARS = simple("shifting_gears"), + CONNECT_BELT = simple("connect_belt"), + BONK = simple("bonk"), + WATER_WHEEL = simple("water_wheel"), + LAVA_WHEEL = simple("lava_wheel"), + DEPLOYER_BOOP = simple("deployer"), + ABSORBED_LIGHT = simple("light_absorbed"), + SPEED_READ = simple("speed_read"), + BASIN_THROW = simple("basin"), + PRESS_COMPACT = simple("compact"), + MIXER_MIX = simple("mixer"); private static SimpleTrigger simple(String id) { return add(new SimpleTrigger(id)); } - + private static > T add(T instance) { triggers.add(instance); return instance; @@ -35,19 +45,29 @@ public class AllTriggers { triggers.forEach(CriteriaTriggers::register); } - public static void triggerForNearbyPlayers(SimpleTrigger trigger, World world, BlockPos pos, int range) { + public static void triggerFor(ITriggerable trigger, PlayerEntity player) { + if (player instanceof ServerPlayerEntity) + trigger.trigger((ServerPlayerEntity) player); + } + + public static void triggerForNearbyPlayers(ITriggerable trigger, World world, BlockPos pos, int range) { triggerForNearbyPlayers(trigger, world, pos, range, player -> true); } - public static void triggerForNearbyPlayers(SimpleTrigger trigger, World world, BlockPos pos, int range, + public static void triggerForNearbyPlayers(ITriggerable trigger, World world, BlockPos pos, int range, Predicate playerFilter) { if (world == null) return; if (world.isRemote) return; - List players = - world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(range)); + List players = getPlayersInRange(world, pos, range); players.stream().filter(playerFilter).forEach(trigger::trigger); } + public static List getPlayersInRange(World world, BlockPos pos, int range) { + List players = + world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(range)); + return players; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/advancement/ITriggerable.java b/src/main/java/com/simibubi/create/foundation/advancement/ITriggerable.java new file mode 100644 index 000000000..3356815d2 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/ITriggerable.java @@ -0,0 +1,9 @@ +package com.simibubi.create.foundation.advancement; + +import net.minecraft.entity.player.ServerPlayerEntity; + +public interface ITriggerable { + + public void trigger(ServerPlayerEntity player); + +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/KineticBlockTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/KineticBlockTrigger.java new file mode 100644 index 000000000..a72bc6f78 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/KineticBlockTrigger.java @@ -0,0 +1,76 @@ +package com.simibubi.create.foundation.advancement; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSyntaxException; +import com.simibubi.create.Create; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.util.JSONUtils; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.Registry; + +public class KineticBlockTrigger extends CriterionTriggerBase { + + private static final ResourceLocation ID = new ResourceLocation(Create.ID, "kinetic_block"); + + public KineticBlockTrigger(String id) { + super(id); + } + + public Instance forBlock(Block block) { + return new Instance(block); + } + + @Override + @SuppressWarnings("deprecation") + public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { + Block block = null; + if (json.has("block")) { + ResourceLocation resourcelocation = new ResourceLocation(JSONUtils.getString(json, "block")); + block = Registry.BLOCK.getValue(resourcelocation).orElseThrow(() -> { + return new JsonSyntaxException("Unknown block type '" + resourcelocation + "'"); + }); + } + + return new Instance(block); + } + + public void trigger(ServerPlayerEntity player, BlockState state) { + trigger(player, Arrays.asList(() -> state.getBlock())); + } + + public static class Instance extends CriterionTriggerBase.Instance { + private final Block block; + + public Instance(Block block) { + super(KineticBlockTrigger.ID); + this.block = block; + } + + @Override + protected boolean test(List> suppliers) { + if (suppliers.isEmpty()) + return false; + return block == suppliers.get(0).get(); + } + + @Override + @SuppressWarnings("deprecation") + public JsonElement serialize() { + JsonObject jsonobject = new JsonObject(); + if (this.block != null) + jsonobject.addProperty("block", Registry.BLOCK.getKey(this.block).toString()); + return jsonobject; + } + } + + +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java deleted file mode 100644 index 24b33c26e..000000000 --- a/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.simibubi.create.foundation.advancement; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Supplier; - -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonObject; - -import net.minecraft.advancements.criterion.ItemPredicate; -import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -public class SandpaperUseTrigger extends CriterionTriggerBase { - - public SandpaperUseTrigger(String id) { - super(id); - } - - @Override - public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { - return new SandpaperUseTrigger.Instance(getId(), ItemPredicate.deserialize(json.get("target")),ItemPredicate.deserialize(json.get("result"))); - } - - public void trigger(ServerPlayerEntity player, ItemStack target, ItemStack result){ - trigger(player, Arrays.asList(() -> target, () -> result)); - } - - public static class Instance extends CriterionTriggerBase.Instance { - private final ItemPredicate target; - private final ItemPredicate result; - - public Instance(ResourceLocation idIn, ItemPredicate target, ItemPredicate result) { - super(idIn); - this.target = target; - this.result = result; - - } - - @Override - protected boolean test(List> suppliers) { - return this.target.test((ItemStack) suppliers.get(0).get()) && - this.result.test((ItemStack) suppliers.get(1).get()); - } - } -} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/SimpleTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/SimpleTrigger.java index e9df1c110..375bdb3a2 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/SimpleTrigger.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/SimpleTrigger.java @@ -9,7 +9,7 @@ import com.google.gson.JsonObject; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.util.ResourceLocation; -public class SimpleTrigger extends CriterionTriggerBase { +public class SimpleTrigger extends CriterionTriggerBase implements ITriggerable { public SimpleTrigger(String id) { super(id); @@ -23,6 +23,10 @@ public class SimpleTrigger extends CriterionTriggerBase public void trigger(ServerPlayerEntity player){ super.trigger(player, null); } + + public Instance instance() { + return new Instance(getId()); + } public static class Instance extends CriterionTriggerBase.Instance { diff --git a/src/main/java/com/simibubi/create/foundation/utility/data/Generator.java b/src/main/java/com/simibubi/create/foundation/utility/data/Generator.java index 2a0f91586..4c95945fe 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/data/Generator.java +++ b/src/main/java/com/simibubi/create/foundation/utility/data/Generator.java @@ -1,5 +1,7 @@ package com.simibubi.create.foundation.utility.data; +import com.simibubi.create.data.CreateAdvancements; + import net.minecraft.data.DataGenerator; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @@ -11,9 +13,9 @@ public class Generator { @SubscribeEvent public static void gatherData(GatherDataEvent event){ DataGenerator gen = event.getGenerator(); - //gen.addProvider(AllSoundEvents.CUCKOO_PIG); gen.addProvider(new AllBlocksTagProvider(gen)); gen.addProvider(new AllItemsTagProvider(gen)); + gen.addProvider(new CreateAdvancements(gen)); } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java index 21b8f0e60..f0804b5e4 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java @@ -166,9 +166,13 @@ public abstract class KineticTileEntity extends SmartTileEntity public void onSpeedChanged(float previousSpeed) { boolean fromOrToZero = (previousSpeed == 0) != (getSpeed() == 0); boolean directionSwap = !fromOrToZero && Math.signum(previousSpeed) != Math.signum(getSpeed()); - if (fromOrToZero || directionSwap) { + if (fromOrToZero || directionSwap) flickerTally = getFlickerScore() + 5; - } + + if (fromOrToZero && previousSpeed == 0 && !world.isRemote) + AllTriggers + .getPlayersInRange(world, pos, 4) + .forEach(p -> AllTriggers.KINETIC_BLOCK.trigger(p, getBlockState())); } @Override @@ -368,8 +372,7 @@ public abstract class KineticTileEntity extends SmartTileEntity } @Override - public void addBehaviours(List behaviours) { - } + public void addBehaviours(List behaviours) {} @Override public boolean hasFastRenderer() { @@ -382,8 +385,9 @@ public abstract class KineticTileEntity extends SmartTileEntity if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) { tooltip.add(spacing + GOLD + Lang.translate("gui.stress_gauge.overstressed")); - String hint = Lang.translate("gui.contraptions.network_overstressed", - I18n.format(getBlockState().getBlock().getTranslationKey())); + String hint = Lang + .translate("gui.contraptions.network_overstressed", + I18n.format(getBlockState().getBlock().getTranslationKey())); List cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE); for (int i = 0; i < cutString.size(); i++) tooltip.add((i == 0 ? "" : spacing) + cutString.get(i)); @@ -392,8 +396,9 @@ public abstract class KineticTileEntity extends SmartTileEntity if (notFastEnough) { tooltip.add(spacing + GOLD + Lang.translate("tooltip.speedRequirement")); - String hint = Lang.translate("gui.contraptions.not_fast_enough", - I18n.format(getBlockState().getBlock().getTranslationKey())); + String hint = Lang + .translate("gui.contraptions.not_fast_enough", + I18n.format(getBlockState().getBlock().getTranslationKey())); List cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE); for (int i = 0; i < cutString.size(); i++) tooltip.add((i == 0 ? "" : spacing) + cutString.get(i)); @@ -417,10 +422,14 @@ public abstract class KineticTileEntity extends SmartTileEntity String stressString = spacing + "%s%s" + Lang.translate("generic.unit.stress") + " " + TextFormatting.DARK_GRAY + "%s"; - tooltip.add(String.format(stressString, TextFormatting.AQUA, IHaveGoggleInformation.format(stressAtBase), - Lang.translate("gui.goggles.base_value"))); - tooltip.add(String.format(stressString, TextFormatting.GRAY, IHaveGoggleInformation.format(stressTotal), - Lang.translate("gui.goggles.at_current_speed"))); + tooltip + .add(String + .format(stressString, TextFormatting.AQUA, IHaveGoggleInformation.format(stressAtBase), + Lang.translate("gui.goggles.base_value"))); + tooltip + .add(String + .format(stressString, TextFormatting.GRAY, IHaveGoggleInformation.format(stressTotal), + Lang.translate("gui.goggles.at_current_speed"))); added = true; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntity.java index e7e48ee0f..5f7e5529b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntity.java @@ -7,6 +7,7 @@ import java.util.Optional; import com.simibubi.create.AllRecipes; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.modules.contraptions.processing.BasinOperatingTileEntity; @@ -163,8 +164,10 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { pressedItems.add(itemEntity.getItem()); sendData(); Optional recipe = getRecipe(itemEntity.getItem()); - if (recipe.isPresent()) + if (recipe.isPresent()) { InWorldProcessing.applyRecipeOn(itemEntity, recipe.get()); + AllTriggers.triggerForNearbyPlayers(AllTriggers.BONK, world, pos, 4); + } } } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java index dbb8723ae..09800ca42 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java @@ -2,11 +2,13 @@ package com.simibubi.create.modules.contraptions.components.waterwheel; import com.simibubi.create.AllBlocks; import com.simibubi.create.config.AllConfigs; +import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.fluid.Fluids; import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; @@ -109,6 +111,12 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE 0 ^ !clockwise ? -flow.y * clockwiseMultiplier : -flow.y; } + + if (te.getSpeed() == 0 && flowStrength != 0 && !world.isRemote) { + AllTriggers.triggerForNearbyPlayers(AllTriggers.WATER_WHEEL, world, pos, 5); + if (fluid.getFluid() == Fluids.FLOWING_LAVA ||fluid.getFluid() == Fluids.LAVA) + AllTriggers.triggerForNearbyPlayers(AllTriggers.LAVA_WHEEL, world, pos, 5); + } te.setFlow(f, (float) (flowStrength * AllConfigs.SERVER.kinetics.waterWheelSpeed.get() / 2f)); }); @@ -125,8 +133,8 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE { if (insertItem.isEmpty()) { itemEntity.remove(); + + if (!itemEntity.world.isRemote) + AllTriggers + .triggerForNearbyPlayers(AllTriggers.BASIN_THROW, itemEntity.world, + itemEntity.getPosition(), 3); return; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinOperatingTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinOperatingTileEntity.java index e2d21cbe1..e09fa863b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinOperatingTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinOperatingTileEntity.java @@ -5,6 +5,9 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.advancement.AllTriggers; +import com.simibubi.create.foundation.advancement.SimpleTrigger; import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; import com.simibubi.create.foundation.behaviour.simple.DeferralBehaviour; import com.simibubi.create.foundation.utility.recipe.RecipeFinder; @@ -149,6 +152,13 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity { // something wasn't found return; } + + if (!world.isRemote) { + SimpleTrigger trigger = AllTriggers.MIXER_MIX; + if (getType() == AllTileEntities.MECHANICAL_PRESS.type) + trigger = AllTriggers.PRESS_COMPACT; + AllTriggers.triggerForNearbyPlayers(trigger, world, pos, 4); + } ItemHandlerHelper.insertItemStacked(outputs, lastRecipe.getRecipeOutput().copy(), false); containers.forEach(stack -> ItemHandlerHelper.insertItemStacked(outputs, stack, false)); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java index 5adcbd64d..92f64ae5f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java @@ -5,6 +5,7 @@ import java.util.List; import com.simibubi.create.AllBlocks; import com.simibubi.create.config.AllConfigs; +import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.item.IAddedByOther; import com.simibubi.create.modules.contraptions.base.KineticTileEntity; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; @@ -71,9 +72,9 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther { if (!canConnect(world, firstPulley, pos)) return ActionResultType.FAIL; - if (firstPulley != null && !firstPulley.equals(pos)) { + if (firstPulley != null && !firstPulley.equals(pos) && !world.isRemote) { createBelts(world, firstPulley, pos); - + AllTriggers.triggerFor(AllTriggers.CONNECT_BELT, context.getPlayer()); if (!context.getPlayer().isCreative()) context.getItem().shrink(1); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/elementary/CogwheelBlockItem.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/elementary/CogwheelBlockItem.java index ef1f12939..f3b8b94eb 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/elementary/CogwheelBlockItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/elementary/CogwheelBlockItem.java @@ -1,10 +1,13 @@ package com.simibubi.create.modules.contraptions.relays.elementary; import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.advancement.AllTriggers; +import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItemUseContext; import net.minecraft.util.ActionResultType; @@ -13,6 +16,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; public class CogwheelBlockItem extends BlockItem { @@ -54,8 +58,8 @@ public class CogwheelBlockItem extends BlockItem { hitVec = hitVec .mul(new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, offsetAxis).getDirectionVec())); - BlockPos correctPos = context.getPos().add(Math.signum(hitVec.x), Math.signum(hitVec.y), - Math.signum(hitVec.z)); + BlockPos correctPos = + context.getPos().add(Math.signum(hitVec.x), Math.signum(hitVec.y), Math.signum(hitVec.z)); if (context.getWorld().getBlockState(correctPos).getMaterial().isReplaceable()) context = BlockItemUseContext.func_221536_a(context, correctPos, largeOnLarge ? face @@ -67,4 +71,41 @@ public class CogwheelBlockItem extends BlockItem { return super.tryPlace(context); } + @Override + // Trigger cogwheel criterion + protected boolean placeBlock(BlockItemUseContext context, BlockState state) { + World world = context.getWorld(); + PlayerEntity player = context.getPlayer(); + + if (!world.isRemote && player != null) { + Axis axis = state.get(CogWheelBlock.AXIS); + for (Axis perpendicular1 : Iterate.axes) { + if (perpendicular1 == axis) + continue; + Direction d1 = Direction.getFacingFromAxis(AxisDirection.POSITIVE, perpendicular1); + for (Axis perpendicular2 : Iterate.axes) { + if (perpendicular1 == perpendicular2) + continue; + if (axis == perpendicular2) + continue; + Direction d2 = Direction.getFacingFromAxis(AxisDirection.POSITIVE, perpendicular2); + for (int offset1 : Iterate.positiveAndNegative) { + for (int offset2 : Iterate.positiveAndNegative) { + BlockPos connectedPos = context.getPos().offset(d1, offset1).offset(d2, offset2); + BlockState blockState = world.getBlockState(connectedPos); + if (!(blockState.getBlock() instanceof CogWheelBlock)) + continue; + if (blockState.get(CogWheelBlock.AXIS) != axis) + continue; + if (AllBlocks.LARGE_COGWHEEL.typeOf(blockState) == large) + continue; + AllTriggers.triggerFor(AllTriggers.SHIFTING_GEARS, player); + } + } + } + } + } + return super.placeBlock(context, state); + } + } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java index b80f3c34b..6747f1f5a 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java @@ -1,10 +1,8 @@ package com.simibubi.create.modules.curiosities.tools; -import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.VecHelper; -import com.simibubi.create.modules.contraptions.components.deployer.DeployerFakePlayer; import com.simibubi.create.modules.curiosities.tools.SandPaperItemRenderer.SandPaperModel; import net.minecraft.client.renderer.model.IBakedModel; @@ -12,7 +10,6 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; @@ -31,6 +28,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.util.FakePlayer; public class SandPaperItem extends Item implements IHaveCustomItemModel { @@ -136,11 +134,9 @@ public class SandPaperItem extends Item implements IHaveCustomItemModel { } if (!polished.isEmpty()) { - if (player instanceof DeployerFakePlayer) { + if (player instanceof FakePlayer) { player.dropItem(polished, false, false); } else { - AllTriggers.SANDPAPER_USE.trigger((ServerPlayerEntity) player, toPolish, polished); - player.inventory.placeItemBackInInventory(worldIn, polished); } } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java new file mode 100644 index 000000000..bb355a6c4 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java @@ -0,0 +1,81 @@ +package com.simibubi.create.modules.logistics.block.inventories; + +import com.simibubi.create.foundation.block.ProperDirectionalBlock; +import com.simibubi.create.foundation.utility.AllShapes; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; + +public class CrateBlock extends ProperDirectionalBlock { + + public static final BooleanProperty DOUBLE = BooleanProperty.create("double"); + + public CrateBlock(Properties p_i48415_1_) { + super(p_i48415_1_); + setDefaultState(getDefaultState().with(FACING, Direction.UP).with(DOUBLE, false)); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + return AllShapes.CRATE_BLOCK_SHAPE; + } + + @Override + public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, + BlockPos currentPos, BlockPos facingPos) { + + boolean isDouble = stateIn.get(DOUBLE); + Direction blockFacing = stateIn.get(FACING); + boolean isFacingOther = facingState.getBlock() == this && facingState.get(DOUBLE) + && facingState.get(FACING) == facing.getOpposite(); + + if (!isDouble) { + if (!isFacingOther) + return stateIn; + return stateIn.with(DOUBLE, true).with(FACING, facing); + } + + if (facing != blockFacing) + return stateIn; + if (!isFacingOther) + return stateIn.with(DOUBLE, false); + + return stateIn; + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + BlockPos pos = context.getPos(); + World world = context.getWorld(); + + if (!context.isPlacerSneaking()) { + for (Direction d : Direction.values()) { + BlockState state = world.getBlockState(pos.offset(d)); + if (state.getBlock() == this && !state.get(DOUBLE)) + return getDefaultState().with(FACING, d).with(DOUBLE, true); + } + } + + Direction placedOnFace = context.getFace().getOpposite(); + BlockState state = world.getBlockState(pos.offset(placedOnFace)); + if (state.getBlock() == this && !state.get(DOUBLE)) + return getDefaultState().with(FACING, placedOnFace).with(DOUBLE, true); + return getDefaultState(); + } + + @Override + protected void fillStateContainer(Builder builder) { + super.fillStateContainer(builder.add(DOUBLE)); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java index bf70659a3..b5371a0b1 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java @@ -1,74 +1,36 @@ package com.simibubi.create.modules.logistics.block.inventories; import com.simibubi.create.AllBlocks; -import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.item.ItemHelper; -import com.simibubi.create.foundation.utility.AllShapes; -import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; -import net.minecraft.state.BooleanProperty; -import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.shapes.ISelectionContext; -import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraftforge.fml.network.NetworkHooks; -public class FlexcrateBlock extends ProperDirectionalBlock { - - public static final BooleanProperty DOUBLE = BooleanProperty.create("double"); +public class FlexcrateBlock extends CrateBlock { public FlexcrateBlock() { super(Properties.from(Blocks.ANDESITE)); - setDefaultState(getDefaultState().with(FACING, Direction.UP).with(DOUBLE, false)); - } - - @Override - public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - return AllShapes.CRATE_BLOCK_SHAPE; - } - - @Override - protected void fillStateContainer(Builder builder) { - super.fillStateContainer(builder.add(DOUBLE)); } @Override public boolean hasTileEntity(BlockState state) { return true; } - + @Override - public BlockState getStateForPlacement(BlockItemUseContext context) { - BlockPos pos = context.getPos(); - World world = context.getWorld(); - - if (!context.isPlacerSneaking()) { - for (Direction d : Direction.values()) { - BlockState state = world.getBlockState(pos.offset(d)); - if (AllBlocks.FLEXCRATE.typeOf(state) && !state.get(DOUBLE)) - return getDefaultState().with(FACING, d).with(DOUBLE, true); - } - } - - Direction placedOnFace = context.getFace().getOpposite(); - BlockState state = world.getBlockState(pos.offset(placedOnFace)); - if (AllBlocks.FLEXCRATE.typeOf(state) && !state.get(DOUBLE)) - return getDefaultState().with(FACING, placedOnFace).with(DOUBLE, true); - return getDefaultState(); + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new FlexcrateTileEntity(); } @Override @@ -93,29 +55,6 @@ public class FlexcrateBlock extends ProperDirectionalBlock { } } - @Override - public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, - BlockPos currentPos, BlockPos facingPos) { - - boolean isDouble = stateIn.get(DOUBLE); - Direction blockFacing = stateIn.get(FACING); - boolean isFacingOther = AllBlocks.FLEXCRATE.typeOf(facingState) && facingState.get(DOUBLE) - && facingState.get(FACING) == facing.getOpposite(); - - if (!isDouble) { - if (!isFacingOther) - return stateIn; - return stateIn.with(DOUBLE, true).with(FACING, facing); - } - - if (facing != blockFacing) - return stateIn; - if (!isFacingOther) - return stateIn.with(DOUBLE, false); - - return stateIn; - } - @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { @@ -133,11 +72,6 @@ public class FlexcrateBlock extends ProperDirectionalBlock { } } - @Override - public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new FlexcrateTileEntity(); - } - public static void splitCrate(World world, BlockPos pos) { BlockState state = world.getBlockState(pos); if (!AllBlocks.FLEXCRATE.typeOf(state)) diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/CreativeCrateBlock.java b/src/main/java/com/simibubi/create/modules/schematics/block/CreativeCrateBlock.java deleted file mode 100644 index b8a328bfe..000000000 --- a/src/main/java/com/simibubi/create/modules/schematics/block/CreativeCrateBlock.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.simibubi.create.modules.schematics.block; - -import com.simibubi.create.foundation.utility.AllShapes; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.shapes.ISelectionContext; -import net.minecraft.util.math.shapes.VoxelShape; -import net.minecraft.world.IBlockReader; - -public class CreativeCrateBlock extends Block { - - public CreativeCrateBlock() { - super(Properties.create(Material.WOOD)); - } - - @Override - public boolean isSolid(BlockState state) { - return false; - } - - @Override - public void fillItemGroup(ItemGroup group, NonNullList items) { - } - - @Override - public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - return AllShapes.CRATE_BLOCK_SHAPE; - } - -} diff --git a/src/main/resources/assets/create/blockstates/creative_crate.json b/src/main/resources/assets/create/blockstates/creative_crate.json index e2e554c11..e8c3b0338 100644 --- a/src/main/resources/assets/create/blockstates/creative_crate.json +++ b/src/main/resources/assets/create/blockstates/creative_crate.json @@ -1,6 +1,17 @@ { - "forgemarker": 1, "variants": { - "": { "model": "create:block/creative_crate" } + "double=true,facing=up": { "model": "create:block/crate/creative/double_bottom" }, + "double=true,facing=down": { "model": "create:block/crate/creative/double_top" }, + "double=true,facing=west": { "model": "create:block/crate/creative/double_left", "y": 90 }, + "double=true,facing=east": { "model": "create:block/crate/creative/double_right", "y": 90 }, + "double=true,facing=north": { "model": "create:block/crate/creative/double_right" }, + "double=true,facing=south": { "model": "create:block/crate/creative/double_left" }, + + "double=false,facing=up": { "model": "create:block/crate/creative/single" }, + "double=false,facing=down": { "model": "create:block/crate/creative/single" }, + "double=false,facing=west": { "model": "create:block/crate/creative/single" }, + "double=false,facing=east": { "model": "create:block/crate/creative/single" }, + "double=false,facing=north": { "model": "create:block/crate/creative/single" }, + "double=false,facing=south": { "model": "create:block/crate/creative/single" } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/filtered_crate.json b/src/main/resources/assets/create/blockstates/filtered_crate.json new file mode 100644 index 000000000..4a297e253 --- /dev/null +++ b/src/main/resources/assets/create/blockstates/filtered_crate.json @@ -0,0 +1,17 @@ +{ + "variants": { + "double=true,facing=up": { "model": "create:block/crate/copper/double_bottom" }, + "double=true,facing=down": { "model": "create:block/crate/copper/double_top" }, + "double=true,facing=west": { "model": "create:block/crate/copper/double_left", "y": 90 }, + "double=true,facing=east": { "model": "create:block/crate/copper/double_right", "y": 90 }, + "double=true,facing=north": { "model": "create:block/crate/copper/double_right" }, + "double=true,facing=south": { "model": "create:block/crate/copper/double_left" }, + + "double=false,facing=up": { "model": "create:block/crate/copper/single" }, + "double=false,facing=down": { "model": "create:block/crate/copper/single" }, + "double=false,facing=west": { "model": "create:block/crate/copper/single" }, + "double=false,facing=east": { "model": "create:block/crate/copper/single" }, + "double=false,facing=north": { "model": "create:block/crate/copper/single" }, + "double=false,facing=south": { "model": "create:block/crate/copper/single" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/flexcrate.json b/src/main/resources/assets/create/blockstates/flexcrate.json index cb94c53e6..887558a53 100644 --- a/src/main/resources/assets/create/blockstates/flexcrate.json +++ b/src/main/resources/assets/create/blockstates/flexcrate.json @@ -1,17 +1,17 @@ { "variants": { - "double=true,facing=up": { "model": "create:block/flexcrate/double_bottom" }, - "double=true,facing=down": { "model": "create:block/flexcrate/double_top" }, - "double=true,facing=west": { "model": "create:block/flexcrate/double_left", "y": 90 }, - "double=true,facing=east": { "model": "create:block/flexcrate/double_right", "y": 90 }, - "double=true,facing=north": { "model": "create:block/flexcrate/double_right" }, - "double=true,facing=south": { "model": "create:block/flexcrate/double_left" }, + "double=true,facing=up": { "model": "create:block/crate/brass/double_bottom" }, + "double=true,facing=down": { "model": "create:block/crate/brass/double_top" }, + "double=true,facing=west": { "model": "create:block/crate/brass/double_left", "y": 90 }, + "double=true,facing=east": { "model": "create:block/crate/brass/double_right", "y": 90 }, + "double=true,facing=north": { "model": "create:block/crate/brass/double_right" }, + "double=true,facing=south": { "model": "create:block/crate/brass/double_left" }, - "double=false,facing=up": { "model": "create:block/flexcrate/single" }, - "double=false,facing=down": { "model": "create:block/flexcrate/single" }, - "double=false,facing=west": { "model": "create:block/flexcrate/single" }, - "double=false,facing=east": { "model": "create:block/flexcrate/single" }, - "double=false,facing=north": { "model": "create:block/flexcrate/single" }, - "double=false,facing=south": { "model": "create:block/flexcrate/single" } + "double=false,facing=up": { "model": "create:block/crate/brass/single" }, + "double=false,facing=down": { "model": "create:block/crate/brass/single" }, + "double=false,facing=west": { "model": "create:block/crate/brass/single" }, + "double=false,facing=east": { "model": "create:block/crate/brass/single" }, + "double=false,facing=north": { "model": "create:block/crate/brass/single" }, + "double=false,facing=south": { "model": "create:block/crate/brass/single" } } } \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/warehouse_crate.json b/src/main/resources/assets/create/blockstates/warehouse_crate.json new file mode 100644 index 000000000..0d6635db5 --- /dev/null +++ b/src/main/resources/assets/create/blockstates/warehouse_crate.json @@ -0,0 +1,17 @@ +{ + "variants": { + "double=true,facing=up": { "model": "create:block/crate/andesite/double_bottom" }, + "double=true,facing=down": { "model": "create:block/crate/andesite/double_top" }, + "double=true,facing=west": { "model": "create:block/crate/andesite/double_left", "y": 90 }, + "double=true,facing=east": { "model": "create:block/crate/andesite/double_right", "y": 90 }, + "double=true,facing=north": { "model": "create:block/crate/andesite/double_right" }, + "double=true,facing=south": { "model": "create:block/crate/andesite/double_left" }, + + "double=false,facing=up": { "model": "create:block/crate/andesite/single" }, + "double=false,facing=down": { "model": "create:block/crate/andesite/single" }, + "double=false,facing=west": { "model": "create:block/crate/andesite/single" }, + "double=false,facing=east": { "model": "create:block/crate/andesite/single" }, + "double=false,facing=north": { "model": "create:block/crate/andesite/single" }, + "double=false,facing=south": { "model": "create:block/crate/andesite/single" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index 9afcf6b02..b6bd3b61f 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -131,7 +131,10 @@ "block.create.contact": "Redstone Contact", "block.create.redstone_bridge": "Redstone Link", "block.create.stockswitch": "Stockpile Switch", + "block.create.warehouse_crate": "Warehouse Crate", "block.create.flexcrate": "Adjustable Crate", + "block.create.filtered_crate": "Filtered Crate", + "block.create.creative_crate": "The Endless Crate", "block.create.extractor": "Extractor", "block.create.belt_funnel": "Funnel", "block.create.linked_extractor": "Linked Extractor", @@ -256,7 +259,6 @@ "block.create.schematicannon": "Schematicannon", "block.create.schematic_table": "Schematic Table", - "block.create.creative_crate": "Schematicannon Creatifier", "block.create.cocoa_log": "Cocoa Jungle Log", @@ -272,7 +274,6 @@ "death.attack.create.drill": "%1$s was impaled by Mechanical Drill", "death.attack.create.saw": "%1$s got cut in half by Mechanical Saw", "create.block.deployer.damage_source_name": "a rogue Deployer", - "death.attack.create.curse_polish": "%1$s tried to polish a cursed item", "death.attack.create.cuckoo_clock_explosion": "%1$s was blown up by tampered cuckoo clock", "create.recipe.crushing": "Crushing", @@ -628,47 +629,77 @@ "create.command.killTPSCommand.status.usage.1": "[Create]: use /killtps start to artificially slow down the server tick", "create.command.killTPSCommand.argument.tickTime": "tickTime", - "advancement.create:root": "In the beginning, let's Create!", - "advancement.create:root.desc": "It's time to start building some amazing Contraptions!", - "advancement.create:andesite_alloy": "Alliterations Aplenty", - "advancement.create:andesite_alloy.desc": "Create's materials have weird names, Andesite Alloy is one of them.", - "advancement.create:andesite_casing": "The Andesite Age ", - "advancement.create:andesite_casing.desc": "Use some Andesite, Meta, and Wood to create a basic Casing.", - "advancement.create:crushing_wheel": "A Pair of Giants", - "advancement.create:crushing_wheel.desc": "Create some Crushing Wheels to break down materials.", - "advancement.create:rotation": "It's Alive!", - "advancement.create:rotation.desc": "Watch your first kinetic component spin.", - "advancement.create:overstressed": "Overstressed", - "advancement.create:overstressed.desc": "Experience the laws of physics firsthand.", - "advancement.create:sand_paper": "Power Polish", - "advancement.create:sand_paper.desc": "Create some Sand Paper to make things pretty.", - "advancement.create:polished_rose_quartz": "Pink Diamonds", - "advancement.create:polished_rose_quartz.desc": "Polish Rose Quartz until you can see through it.", - "advancement.create:sand_paper_secret": "9001 Grit Sand Paper", - "advancement.create:sand_paper_secret.desc": "Use your Sand Paper to sand some Sand Paper.", - "advancement.create:press": "'Bonk!'", - "advancement.create:press.desc": "Make a Mechanical Press and use it to create some Plates.", - "advancement.create:mixer": "Mixin' it Up", - "advancement.create:mixer.desc": "Create a Mechanical Mixer.", - "advancement.create:brass": "An Actual Alloy", - "advancement.create:brass.desc": "Use Copper and Zinc to create some Brass.", - "advancement.create:brass_casing": "The Brass Age", - "advancement.create:brass_casing.desc": "Use newly obtained Brass and some Wood to create a more advanced Casing.", - "advancement.create:deployer": "Poke, Place, and Attack", - "advancement.create:deployer.desc": "Create a Deployer, the perfect reflection of yourself.", - "advancement.create:deployer_secret": "Pound It, Bro!", - "advancement.create:deployer_secret.desc": "Make two Deployers fist-bump.", - "advancement.create:chromatic_compound": "Bipolar Materials", - "advancement.create:chromatic_compound.desc": "Craft a Bar of Chromatic Compound.", - "advancement.create:shadow_steel": "Void Returner", - "advancement.create:shadow_steel.desc": "Create Shadow Steel, a metal bar of nothingness.", - "advancement.create:refined_radiance": "Bright and Inspiring", - "advancement.create:refined_radiance.desc": "Create Refined Radiance, a powerful chromatic substance.", - "advancement.create:refined_radiance_secret": "Forged by the Beam of Light", - "advancement.create:refined_radiance_secret.desc": "Find the alternative way to make Refined Radiance.", - "advancement.create:speed_secret": "Nice ", - "advancement.create:speed_secret.desc": "Watch a Speedometer reach exactly 69 rpm.", + "advancement.create.root": "Welcome to Create", + "advancement.create.root.desc": "It's time to start building some amazing Contraptions!", + "advancement.create.andesite_alloy": "Alliterations Aplenty", + "advancement.create.andesite_alloy.desc": "Create's materials have weird names, Andesite Alloy is one of them.", + "advancement.create.its_alive": "It's Alive!", + "advancement.create.its_alive.desc": "Watch your first kinetic component spin.", + "advancement.create.shifting_gears": "Shifting Gear", + "advancement.create.shifting_gears.desc": "Connect a large to a small cogwheel allowing you to change the speed of your contraption.", + "advancement.create.overstressed": "Overstressed", + "advancement.create.overstressed.desc": "Experience the limits of stress firsthand.", + "advancement.create.belt": "Convey it all", + "advancement.create.belt.desc": "Connect two shafts with a Mechanical Belt.", + "advancement.create.wrench": "Configure Conveniently", + "advancement.create.wrench.desc": "Create a Wrench to aid you in building your contraptions.", + "advancement.create.goggles": "Stress-o-vision", + "advancement.create.goggles.desc": "Create some goggles to aid you in getting more kinetic information for components.", + "advancement.create.speed_gauge": "But how fast exactly?", + "advancement.create.speed_gauge.desc": "Place and power a Speedometer. Look at it through your goggles to read its exact value.", + "advancement.create.stress_gauge": "But how stressed exactly?", + "advancement.create.stress_gauge.desc": "Place and power a Stressometer. Look at it through your goggles to read its exact value.", + + "advancement.create.water_wheel": "Harnessing Hydraulics", + "advancement.create.water_wheel.desc": "Place a Water Wheel and try getting it to spin!", + "advancement.create.lava_wheel": "Magma Wheel", + "advancement.create.lava_wheel.desc": "This shouldn't have worked.", + "advancement.create.millstone": "Pocket Crusher", + "advancement.create.millstone.desc": "Place and power a Millstone", + "advancement.create.andesite_casing": "The Andesite Age", + "advancement.create.andesite_casing.desc": "Use some Andesite Alloy and Wood to create a basic Casing.", + "advancement.create.drill": "Stationary breakers", + "advancement.create.drill.desc": "Place and power a Mechanical Drill", + "advancement.create.press": "Press goes 'Bonk!'", + "advancement.create.press.desc": "Power a Mechanical Press and use it to create some Plates.", + "advancement.create.polished_rose_quartz": "Pink Diamonds", + "advancement.create.polished_rose_quartz.desc": "Use a piece of sand paper to polish Rose Quartz until it becomes transparent.", + "advancement.create.electron_tube": "Beep boop", + "advancement.create.electron_tube.desc": "Make some Electron Tubes, useful in crafting less primitive machinery.", + "advancement.create.saw": "Stationary Chopping", + "advancement.create.saw.desc": "Place and power a Mechanical Saw", + "advancement.create.basin": "Basin Operation", + "advancement.create.basin.desc": "Place a basin and try throwing items into it.", + "advancement.create.mixer": "Mixin' it Up", + "advancement.create.mixer.desc": "Place a Mechanical Mixer above the basin, power it, and start mixing some ingredients.", + "advancement.create.compact": "Automated Compacting", + "advancement.create.compact.desc": "Use a press and a basin to compact some items.", + + "advancement.create.expert_lane_1": "The Andesite Expert Lane", + "advancement.create.expert_lane_1.desc": "Work in Progress", + + "advancement.create.brass": "An Actual Alloy", + "advancement.create.brass.desc": "Use Crushed Copper and Crushed Zinc to create some Brass.", + "advancement.create.brass_casing": "The Brass Age", + "advancement.create.brass_casing.desc": "Use newly obtained Brass and some Wood to create a more advanced Casing.", + + "advancement.create.crafter": "Automated Assembly", + "advancement.create.crafter.desc": "Place and power some Mechanical Crafters", + "advancement.create.deployer": "Poke, Place, and Attack", + "advancement.create.deployer.desc": "Place and power a Deployer, the perfect reflection of yourself.", + "advancement.create.fist_bump": "Pound It, Bro!", + "advancement.create.fist_bump.desc": "Make two Deployers fist-bump.", + "advancement.create.crushing_wheel": "A Pair of Giants", + "advancement.create.crushing_wheel.desc": "Create some Crushing Wheels to break down more materials more effectively.", + + "advancement.create.chromatic_compound": "Bipolar Minerals", + "advancement.create.chromatic_compound.desc": "Create a Bar of Chromatic Compound.", + "advancement.create.shadow_steel": "Void Returner", + "advancement.create.shadow_steel.desc": "Create Shadow Steel, a metal bar of nothingness.", + "advancement.create.refined_radiance": "Bright and Inspiring", + "advancement.create.refined_radiance.desc": "Create Refined Radiance, a powerful chromatic substance.", + "create.subtitle.schematicannon_launch_block": "Schematicannon shoots", "create.subtitle.schematicannon_finish": "Schematicannon finishes", "create.subtitle.slime_added": "Slime squishes", @@ -769,9 +800,6 @@ "item.create.blueprint_and_quill.tooltip.control3": "R-Click while Sneaking", "item.create.blueprint_and_quill.tooltip.action3": "_Resets_ and removes the selection.", - "block.create.creative_crate.tooltip": "CREATIVE CRATE", - "block.create.creative_crate.tooltip.summary": "Provides an endless supply of blocks to adjacent _Schematicannons_.", - "block.create.schematicannon.tooltip": "SCHEMATICANNON", "block.create.schematicannon.tooltip.summary": "Shoots blocks to recreate a deployed _Schematic_ in the World. Uses items from adjacent Inventories and _Gunpowder_ as fuel.", "block.create.schematicannon.tooltip.control1": "When R-Clicked", @@ -1176,5 +1204,9 @@ "tool.create.rose_quartz.tooltip": "ROSE QUARTZ TOOLS", "tool.create.rose_quartz.tooltip.summary": "This tool grants you a _greater_ _reach_ for _breaking_ _blocks_ or _placing_ _blocks_ from the off-hand.", + "block.create.warehouse_crate.tooltip": "WIP", + "block.create.filtered_crate.tooltip": "WIP", + "block.create.creative_crate.tooltip": "WIP", + "itemGroup.create": "Create" } diff --git a/src/main/resources/assets/create/models/block/crate/andesite/double_bottom.json b/src/main/resources/assets/create/models/block/crate/andesite/double_bottom.json new file mode 100644 index 000000000..1f64b86a4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/andesite/double_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_bottom", + "textures": { + "side": "create:block/crate_andesite_side", + "crate": "create:block/crate_andesite", + "casing": "create:block/andesite_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/andesite/double_left.json b/src/main/resources/assets/create/models/block/crate/andesite/double_left.json new file mode 100644 index 000000000..7e80d3c0f --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/andesite/double_left.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_left", + "textures": { + "side": "create:block/crate_andesite_side", + "crate": "create:block/crate_andesite", + "casing": "create:block/andesite_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/andesite/double_right.json b/src/main/resources/assets/create/models/block/crate/andesite/double_right.json new file mode 100644 index 000000000..ef4e4879b --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/andesite/double_right.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_right", + "textures": { + "side": "create:block/crate_andesite_side", + "crate": "create:block/crate_andesite", + "casing": "create:block/andesite_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/andesite/double_top.json b/src/main/resources/assets/create/models/block/crate/andesite/double_top.json new file mode 100644 index 000000000..1365289d2 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/andesite/double_top.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_top", + "textures": { + "side": "create:block/crate_andesite_side", + "crate": "create:block/crate_andesite", + "casing": "create:block/andesite_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/andesite/single.json b/src/main/resources/assets/create/models/block/crate/andesite/single.json new file mode 100644 index 000000000..fd13c504e --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/andesite/single.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/single", + "textures": { + "side": "create:block/crate_andesite_side", + "crate": "create:block/crate_andesite", + "casing": "create:block/andesite_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/brass/double_bottom.json b/src/main/resources/assets/create/models/block/crate/brass/double_bottom.json new file mode 100644 index 000000000..17421d454 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/brass/double_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_bottom", + "textures": { + "side": "create:block/crate_brass_side", + "crate": "create:block/crate_brass", + "casing": "create:block/brass_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/brass/double_left.json b/src/main/resources/assets/create/models/block/crate/brass/double_left.json new file mode 100644 index 000000000..1bafd8483 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/brass/double_left.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_left", + "textures": { + "side": "create:block/crate_brass_side", + "crate": "create:block/crate_brass", + "casing": "create:block/brass_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/brass/double_right.json b/src/main/resources/assets/create/models/block/crate/brass/double_right.json new file mode 100644 index 000000000..8a2fae584 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/brass/double_right.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_right", + "textures": { + "side": "create:block/crate_brass_side", + "crate": "create:block/crate_brass", + "casing": "create:block/brass_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/brass/double_top.json b/src/main/resources/assets/create/models/block/crate/brass/double_top.json new file mode 100644 index 000000000..1f143378e --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/brass/double_top.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_top", + "textures": { + "side": "create:block/crate_brass_side", + "crate": "create:block/crate_brass", + "casing": "create:block/brass_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/brass/single.json b/src/main/resources/assets/create/models/block/crate/brass/single.json new file mode 100644 index 000000000..b1caf4cf2 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/brass/single.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/single", + "textures": { + "side": "create:block/crate_brass_side", + "crate": "create:block/crate_brass", + "casing": "create:block/brass_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/copper/double_bottom.json b/src/main/resources/assets/create/models/block/crate/copper/double_bottom.json new file mode 100644 index 000000000..8f3c1d55f --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/copper/double_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_bottom", + "textures": { + "side": "create:block/crate_copper_side", + "crate": "create:block/crate_copper", + "casing": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/copper/double_left.json b/src/main/resources/assets/create/models/block/crate/copper/double_left.json new file mode 100644 index 000000000..6cb52e843 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/copper/double_left.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_left", + "textures": { + "side": "create:block/crate_copper_side", + "crate": "create:block/crate_copper", + "casing": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/copper/double_right.json b/src/main/resources/assets/create/models/block/crate/copper/double_right.json new file mode 100644 index 000000000..fc4f8230b --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/copper/double_right.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_right", + "textures": { + "side": "create:block/crate_copper_side", + "crate": "create:block/crate_copper", + "casing": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/copper/double_top.json b/src/main/resources/assets/create/models/block/crate/copper/double_top.json new file mode 100644 index 000000000..a1c05fdf4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/copper/double_top.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_top", + "textures": { + "side": "create:block/crate_copper_side", + "crate": "create:block/crate_copper", + "casing": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/copper/single.json b/src/main/resources/assets/create/models/block/crate/copper/single.json new file mode 100644 index 000000000..9424436d3 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/copper/single.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/single", + "textures": { + "side": "create:block/crate_copper_side", + "crate": "create:block/crate_copper", + "casing": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/creative/double_bottom.json b/src/main/resources/assets/create/models/block/crate/creative/double_bottom.json new file mode 100644 index 000000000..a6a52312c --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/creative/double_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_bottom", + "textures": { + "side": "create:block/crate_creative_side", + "crate": "create:block/crate_creative", + "casing": "create:block/chorus_chrome_mesh" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/creative/double_left.json b/src/main/resources/assets/create/models/block/crate/creative/double_left.json new file mode 100644 index 000000000..17188e56f --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/creative/double_left.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_left", + "textures": { + "side": "create:block/crate_creative_side", + "crate": "create:block/crate_creative", + "casing": "create:block/chorus_chrome_mesh" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/creative/double_right.json b/src/main/resources/assets/create/models/block/crate/creative/double_right.json new file mode 100644 index 000000000..e23a11c5e --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/creative/double_right.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_right", + "textures": { + "side": "create:block/crate_creative_side", + "crate": "create:block/crate_creative", + "casing": "create:block/chorus_chrome_mesh" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/creative/double_top.json b/src/main/resources/assets/create/models/block/crate/creative/double_top.json new file mode 100644 index 000000000..fe10d5395 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/creative/double_top.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/double_top", + "textures": { + "side": "create:block/crate_creative_side", + "crate": "create:block/crate_creative", + "casing": "create:block/chorus_chrome_mesh" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/crate/creative/single.json b/src/main/resources/assets/create/models/block/crate/creative/single.json new file mode 100644 index 000000000..bf83bf254 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/creative/single.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/crate/single", + "textures": { + "side": "create:block/crate_creative_side", + "crate": "create:block/crate_creative", + "casing": "create:block/chorus_chrome_mesh" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexcrate/double_bottom.json b/src/main/resources/assets/create/models/block/crate/double_bottom.json similarity index 67% rename from src/main/resources/assets/create/models/block/flexcrate/double_bottom.json rename to src/main/resources/assets/create/models/block/crate/double_bottom.json index 3d3ec3d4e..36ead3ace 100644 --- a/src/main/resources/assets/create/models/block/flexcrate/double_bottom.json +++ b/src/main/resources/assets/create/models/block/crate/double_bottom.json @@ -2,9 +2,9 @@ "credit": "Made with Blockbench", "parent": "block/block", "textures": { - "0": "create:block/double_flexcrate_side", - "3": "create:block/brass_casing_14", - "particle": "create:block/flex_crate" + "0": "#side", + "4": "#crate", + "particle": "#casing" }, "elements": [ { @@ -15,7 +15,7 @@ "east": {"uv": [8.5, 8, 15.5, 16], "texture": "#0"}, "south": {"uv": [8.5, 8, 15.5, 16], "texture": "#0"}, "west": {"uv": [8.5, 8, 15.5, 16], "texture": "#0"}, - "down": {"uv": [1, 1, 15, 15], "rotation": 270, "texture": "#3"} + "down": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 270, "texture": "#4"} } } ] diff --git a/src/main/resources/assets/create/models/block/flexcrate/double_left.json b/src/main/resources/assets/create/models/block/crate/double_left.json similarity index 66% rename from src/main/resources/assets/create/models/block/flexcrate/double_left.json rename to src/main/resources/assets/create/models/block/crate/double_left.json index 4055d2672..f1e327587 100644 --- a/src/main/resources/assets/create/models/block/flexcrate/double_left.json +++ b/src/main/resources/assets/create/models/block/crate/double_left.json @@ -2,17 +2,16 @@ "credit": "Made with Blockbench", "parent": "block/block", "textures": { - "0": "create:block/double_flexcrate_side", - "1": "create:block/double_flexcrate_bottom", - "2": "create:block/flex_crate", - "particle": "create:block/flex_crate" + "0": "#side", + "1": "#crate", + "particle": "#casing" }, "elements": [ { "from": [1, 0, 1], "to": [15, 14, 16], "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#2"}, + "north": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#1"}, "east": {"uv": [8, 0.5, 15.5, 7.5], "texture": "#0"}, "west": {"uv": [0.5, 0.5, 8, 7.5], "texture": "#0"}, "up": {"uv": [0.5, 0.5, 8, 7.5], "rotation": 90, "texture": "#1"}, diff --git a/src/main/resources/assets/create/models/block/flexcrate/double_right.json b/src/main/resources/assets/create/models/block/crate/double_right.json similarity index 66% rename from src/main/resources/assets/create/models/block/flexcrate/double_right.json rename to src/main/resources/assets/create/models/block/crate/double_right.json index 92b457020..8d7a73675 100644 --- a/src/main/resources/assets/create/models/block/flexcrate/double_right.json +++ b/src/main/resources/assets/create/models/block/crate/double_right.json @@ -2,10 +2,9 @@ "credit": "Made with Blockbench", "parent": "block/block", "textures": { - "0": "create:block/double_flexcrate_side", - "1": "create:block/double_flexcrate_bottom", - "2": "create:block/flex_crate", - "particle": "create:block/flex_crate" + "0": "#side", + "1": "#crate", + "particle": "#casing" }, "elements": [ { @@ -13,7 +12,7 @@ "to": [15, 14, 15], "faces": { "east": {"uv": [0.5, 0.5, 8, 7.5], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#2"}, + "south": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#1"}, "west": {"uv": [8, 0.5, 15.5, 7.5], "texture": "#0"}, "up": {"uv": [8, 0.5, 15.5, 7.5], "rotation": 90, "texture": "#1"}, "down": {"uv": [8, 0.5, 15.5, 7.5], "rotation": 270, "texture": "#1"} diff --git a/src/main/resources/assets/create/models/block/flexcrate/double_top.json b/src/main/resources/assets/create/models/block/crate/double_top.json similarity index 68% rename from src/main/resources/assets/create/models/block/flexcrate/double_top.json rename to src/main/resources/assets/create/models/block/crate/double_top.json index 8defc54ef..ce2106e66 100644 --- a/src/main/resources/assets/create/models/block/flexcrate/double_top.json +++ b/src/main/resources/assets/create/models/block/crate/double_top.json @@ -2,9 +2,9 @@ "credit": "Made with Blockbench", "parent": "block/block", "textures": { - "0": "create:block/double_flexcrate_side", - "3": "create:block/brass_casing_14", - "particle": "create:block/flex_crate" + "0": "#side", + "2": "#crate", + "particle": "#casing" }, "elements": [ { @@ -15,7 +15,7 @@ "east": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"}, "south": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"}, "west": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"}, - "up": {"uv": [1, 1, 15, 15], "rotation": 90, "texture": "#3"} + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 90, "texture": "#2"} } } ] diff --git a/src/main/resources/assets/create/models/block/crate/single.json b/src/main/resources/assets/create/models/block/crate/single.json new file mode 100644 index 000000000..acc71e720 --- /dev/null +++ b/src/main/resources/assets/create/models/block/crate/single.json @@ -0,0 +1,23 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "2": "#crate", + "particle": "#casing" + }, + "elements": [ + { + "name": "Crate", + "from": [1, 0, 1], + "to": [15, 14, 15], + "faces": { + "north": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#2"}, + "east": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#2"}, + "south": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#2"}, + "west": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#2"}, + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "texture": "#2"}, + "down": {"uv": [8.5, 8.5, 15.5, 15.5], "texture": "#2"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexcrate/single.json b/src/main/resources/assets/create/models/block/flexcrate/single.json deleted file mode 100644 index c397bfad0..000000000 --- a/src/main/resources/assets/create/models/block/flexcrate/single.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "particle": "create:block/flex_crate", - "side": "create:block/flex_crate", - "top": "create:block/brass_casing_14" - }, - "elements": [ - { - "name": "Crate", - "from": [ 1, 0, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "north": { "texture": "#side", "uv": [ 1, 1, 15, 15 ] }, - "east": { "texture": "#side", "uv": [ 1, 1, 15, 15 ] }, - "south": { "texture": "#side", "uv": [ 1, 1, 15, 15 ] }, - "west": { "texture": "#side", "uv": [ 1, 1, 15, 15 ] }, - "up": { "texture": "#top", "uv": [ 1, 1, 15, 15 ] }, - "down": { "texture": "#top", "uv": [ 1, 1, 15, 15 ] } - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/creative_crate.json b/src/main/resources/assets/create/models/item/creative_crate.json index 5cea86295..b206b9358 100644 --- a/src/main/resources/assets/create/models/item/creative_crate.json +++ b/src/main/resources/assets/create/models/item/creative_crate.json @@ -1,3 +1,3 @@ { - "parent": "create:block/creative_crate" + "parent": "create:block/crate/creative/single" } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/filtered_crate.json b/src/main/resources/assets/create/models/item/filtered_crate.json new file mode 100644 index 000000000..9478a7f23 --- /dev/null +++ b/src/main/resources/assets/create/models/item/filtered_crate.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/crate/copper/single" +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/flexcrate.json b/src/main/resources/assets/create/models/item/flexcrate.json index 90610cbde..2f1d31d32 100644 --- a/src/main/resources/assets/create/models/item/flexcrate.json +++ b/src/main/resources/assets/create/models/item/flexcrate.json @@ -1,3 +1,3 @@ { - "parent": "create:block/flexcrate/single" + "parent": "create:block/crate/brass/single" } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/warehouse_crate.json b/src/main/resources/assets/create/models/item/warehouse_crate.json new file mode 100644 index 000000000..20c00f2c1 --- /dev/null +++ b/src/main/resources/assets/create/models/item/warehouse_crate.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/crate/andesite/single" +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/brass_casing_14.png b/src/main/resources/assets/create/textures/block/brass_casing_14.png deleted file mode 100644 index 3f5d6ab98d7e8a57a0ebb4920d80334fac77f7d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 468 zcmV;_0W1EAP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0clA@K~y+TrIWEv z!!Qtr&q zNvehcKI!ydZTY{;)n>*R_zz@odAj3WI1id^JxWzg25@ut$_AL^xrU>IeOi>6u2p6r z#0Dvn6(#9(b42>MSdfxI5HgTU1y|P(Afm9|;0#J-NZa7r{Opj%J7=`!t~?!!CTkhUtn9es(B4z+hw1431YQ073pg~4tt9LW6Tu>R zbEyzAP^G<|O>rFBXIk_IGD?Q^84JCIi<6nzo9)`m!R>|utqp|sra47KJS3IN946x! zo?f2e_Wq5L!TIqv)fX|{Z2LL(U|U2jCl^@V=SDy3k1g0000< KMNUMnLSTY>`oxO> diff --git a/src/main/resources/assets/create/textures/block/crate_andesite.png b/src/main/resources/assets/create/textures/block/crate_andesite.png new file mode 100644 index 0000000000000000000000000000000000000000..f79955709f73f00330c03016629d1b48b113ae38 GIT binary patch literal 1324 zcmV+{1=IS8P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TML8u?T#xHM7Y^?wS5BDYT)ZyE+Y{OtkV{^oWnT5V4A*E^KAP5S#Fpl#2g za6Bd}lOZVi*Ygh5Hwu)q4K;b1We=3>(sqf4!IXkSqbiPH0$Oxxi}wl<4Ya&zPsEXq4ss;Yr#S2s6k_d=OcDI=D-MVq!NMgH&AT8XNj zk}KJ&vFL+vJf)mt#m5yZ&}{s}I{;xgBrBUC&&_imKz8p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^JkW2xm}afYb|YOA41~fx`hDaiPOnY9x}^GLc12xd$1r!RpzQZvUpDXlD}US@$X{DS zHAXVt+m2+rAIVOCqPnJsEVILA%iX2k&RFNL^D*ZD@iHo*4~o~98%nE<^Ua*miw@K- zYFE4ya}F4w&S>2lMtYiBy`pp))#%Uw)PhCqikNd?H4Jh(p$ocM1ln%h-cdS@Y9th+ z=ZE1aJN7uy4YM6R2L_`wu1c5P@a#6zhf2H6=osC8IEr?Rqi+qJ(mRk$(|^`zg~G!q zwGhzkyJ+XznjL$Lv!n#n0ZpA*GKMN{In8LZTMdj-#-JK$xDEq;1EGylXeDnQxd#RYWAXQ59 zdop!~6}Nzsz#gb+wy8gEV?GYEx3Td!*>m7Hkzc~&f--RBt&2Ggqw!QKnOpUYy2!O$OXxJS#)gTZhj?|=G}2Dq%AI0y&U17BTxX|~dB%I0sq{JoCjSmnt5x7j_?7nAu1 zPlj3_Tz>Imohhp)!mznmJ#hZv?uc3q8mP^?ZMne?MrH#Zw#^#q$^M{C!ET>6bQ_tgXD zH4+ak$G~Yx+Fb95XJx(&(2#S0l#cYoz6MQYViGU<^hGjjvmTF<|TvE*h{olZNy-9*7em zfM#H{6VI?UPx~S;R*KS~4)8{^G4$F=x$U+&z^PyFr0==u9tHGp9QY^SR}T;~ql(xA zzKJ>ImjCwqx<05U{L^vi{_ZFFWi%WZf;9G#78AfW=NF`J_X26LFa8D86Sg>)j&`zL zox6+xC->C@fd3!ZZ8xWAd=nZZU=jWhgI`bJFuG+8?5hVpx%%wv)LKXG-rFgC>v`vS z(|OO&o>`OIcedo^cW&sB@28$9tq1&C02JT)O14n(F+tu>J@G%Q2Sok@2s$UXR7qHA P00000NkvXXu0mjfs10I& literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/create/textures/block/double_flexcrate_side.png b/src/main/resources/assets/create/textures/block/crate_brass_side.png similarity index 100% rename from src/main/resources/assets/create/textures/block/double_flexcrate_side.png rename to src/main/resources/assets/create/textures/block/crate_brass_side.png diff --git a/src/main/resources/assets/create/textures/block/crate_copper.png b/src/main/resources/assets/create/textures/block/crate_copper.png new file mode 100644 index 0000000000000000000000000000000000000000..993ef700750c905f62602560840c94955cef8e21 GIT binary patch literal 1325 zcmV+|1=9M7P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1j0!~K~z{r%~nll zTvZf4Gnskw(@ZDnL?ui~^J7Un38d-Lorq8ogzj2gxlu4wkt&4>rWJA5B2rMqF5Flb zQl$_q_=8aV2})z778Kh~My83AOef>~W@g&)e&@aOa^K6FNnOPc4)^!m``vTTJ@@$9 z?KW*En7~_ypD|fPqeRszS9MftHHtF|wZ(sh>XA^koomnboZc}T$ zW=(P8eyho)KM>>+@apRXnQQFWNx5r3)7bQ59%&yr`Zygw z_c0}tNggN^*SG|F{LGVf#(KHbv8#V$le>it5}ow3*(@EK+)dwH&+!%bdBj4sUSmZ_ zf4t8YC=L%Lc{9kPqeGSk(arRtEuz~^AC}PJATZG1$7Nj+`KMIog#gsknXJ9hl^^D5 z>F*_b9Gi>{?_mMD>8}>dzHrNQUXy_GGtSz|%4273tFG7gaw0x&;h zEB$EL`5GJ+fFpr57z=Az7Ft0f%RgZ*$Mlr*KW{H3%@dZEFufxl<)xv?o{^$(e0+MKUctE zf!%`x%v#vuG+0bGznpYp-##8kDR(WW?xwHD2EYzPaKaZKo7gfCt*oqYc~c4c@vZ@{ zK;)%=?)76F@WQ{OxowByr=Cc0gsRn>>MG2z>4k8}8FnLKXB+zH>$J}3)Hv_+y&`~6 z%mhvzdeZSF${Y29IFG*YU3-BW*yJVEr$Z%RS( z0eEP9c!XaCas&M1_``wt(1<+;|G5s)M?4W-fxZTy>u<^j;Gwe@zvaPTG{SEl!KPWQ z(R-&~wdd&2^-o@$=RQNdmWFx-D0Q5A`rzh#V0uryogCZG8w%b%F++`Vi7Lx?s97n| z`GpJ<0oL+)TD!AI3yVeb3aor$=IkewNc8iZPAHYj^zy_*&U^ry4~>jcYJ8k3l`4hR zkM+^}pVEa7KBG&Q=IM*CZ>W%ZmyCeHk#B!$l6BmW)7I3l3TfTD$0BV2R?)!(V(~bK zNdYpLAD7ZJUs|Q#jW%8PHK=UGdxTufg^nAtctts2L?s@9o*ov|-EiasC1q*>Hb)%q z8+e$e4op$3H>Nh-MF*y*tr;d9@x#g|!~#34*8p=vfS_UeyW1z2K%-%r2S1k=#5ySd zyp`cPp3#FqtkP_>xb(aNfzRjT(+fHg0v;rS#(H~grxXha9QlA@gm_~tDj5yh;`IQ? z2sv}^eXa}e{`J$r=~nXv+ZhF(SCIYVH_F_;Ma#Km#W=wO0%Sk3v7UNC#|>E=P6ruK zr`Meka9;u2TJT4MNBz00000NkvXXu0mjfk5_R` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/create/textures/block/crate_copper_side.png b/src/main/resources/assets/create/textures/block/crate_copper_side.png new file mode 100644 index 0000000000000000000000000000000000000000..37213e3c3016528fc514ac76632ad6112376a715 GIT binary patch literal 1387 zcmV-x1(f=UP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1prAzK~z{r#a3Hu zTvZfab31cMCo_{tm9{vUBrUnLkVX(eAGM$$LVtq#;6qUqD?)_^gZSiwh@gml@JS!M zltNLo1w|^BO46z=Roiqj(k87*X2!|PoVk0xb!MH}=k%OZq|gs$_TFb-*05`{@a?Uyzx7!JUVLYcO8IMa z>%z}8G`Y7otdCBs$)!ISqPAY8a3W2udX2wp1B2X$wihsN`_znO`S%nFYgE+@=8>quK1>_MGB1Sh?M9vJp;(l5+`ofXZmv+XTBCSk(AZg> z$D;(W#&9ah?e|`P!LlJ>56q4vy1T}wctKzw7N^1ZHeMJ8hEfUID3s`*@+M_7yXfNO z%k=JRhp4exrpoFKYF5g0Y%$Ms0gTV(uk#u*2lKHWP+VW9;*DimTrQa&fbq=e7^RYf zbZ%jhjTTBp9=v-jLsypiivtnED<6OGne7a0_!@@cAvOpC07|q4T2P}syT_PJK5CvN zKmOtg`#>O-NU|X(Fgf54(oZWnI$K_&-?c9NW*Fb>5f-#NEiT~&cuXLqU=v^hWy6&M zEG_^E7z8j$!h$k6d>_s1pP~4+IPZM_>@1H1WX@KQ>(2xly+fr=lo0$Ei1!dKkOOq% z@JT4dlNcxA#5Dw%fWYVT@d8*#08(m9Rk-a`4W$@Uy(+MIK-0o(7$0TlaKGvW^ur)_ zqlQC(K9!Jqe#9$k+3j|?&IGRiagp-ZmT2|XDy7qD+d|m2v{8p^Rj6*qI5~U(HlTV9 zZIH$fHUZXw`NtpaJ~Q_+iv;lY=>--J5s|e*(Gn!o!+yV|8Q3XEL5Ko|Cq=vfRfP0< zgFc#n#j+tvXi4#tk4;+&RVaCDd?Xy|)rg{zeqB)0oBSQ6UN_}iFg7z`+4%8%u20~| z69;T5G1BrTpa)}Czgic_H@7|~ECTlucZI-H2OjArQ^Pd!z)o5?|0_kJ8q2xd7976u z>M-+$wn*W20#L6Hk(u~SGeA4nTp8-obQ3H^1U1;$>%`3 zZ7x==>0F9Ik!_Jjkbi3^D){aJ~mB)iQe|F*MBi-e*X!n(qO(>x*xi7P4(d z1!iP~Qt(01NqAP@)|#==~$_1q4~ zJ3vAqW6aXU19FeS-0d2vP(u(11gxD)YypH4z$+W)LdK|GVgk6w0A9t|B^bNqc94_T z(tuMn|0i5S;B}3>Lg0MRs8G)mHsO4b*dA*V0^2n*>NtQRCIU4C2lwnF^+5wA75AT8 z{Ds$nk{+9X)f#hBH#Nfw0SseN81lMCvJ-Qxd7S`%JZ(ude$P*5=-KRcIyAYHp3A1V teCfe)+Ze%JNylCfnmav8j-EQ>`xn}rYJSE)-JSpd002ovPDHLkV1iJvfJy)W literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/create/textures/block/crate_creative.png b/src/main/resources/assets/create/textures/block/crate_creative.png new file mode 100644 index 0000000000000000000000000000000000000000..18803da2651a9c138b7204d80cf6cd749c568c93 GIT binary patch literal 1004 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!Tj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7ns{MA>;_xO}ob8`fQtS`VAWAc8#;?m*&L@{69+Zo3Fjy(Gm~ptt!z2 zc28&b?DnN~vPszwKmBprB=92fTnNleUt`5m1<{CV6{22J*Lc%v`K@Kwd8yBuCvcK^ zKtlF&`fRtw*jPM{jm=GH+9>jQqeGTTI|%a*NxJl#96yD%^+l5aJwmZ-3nzI*B*W@7 zYcIbt>t5xz{WOy4Urhpi=Ya~Befl{Opr2OupIpzZ+vS)Z1Np^c8aB4qc?l@nL^u3o z><08i*E|q4=YgecsYwHLF z14w69;dZ&OoT299w)AIySxm%r5i1B#Pful1IH$j2%>%0&e*d&E};a2JUb8kKCh5Lu7_0xs-p70AVT~KNtb?JuNQX5h=>($V32u$9uoC) z+GLnFaIATtUq2@d(~OQa5A^Nl97DeW`U1-GR{2Yj-Diz&g``uE*^{KK$?kQ#koqer zHXsc11_S}Wj|XuQKE8p>x_g?D>tv@RR6{Yb0YMUz*VIkCUjl*v83&!|2+!pW3_R0u z4D$xeQar@Zh&CCfmk0vG;*Cr1Seu+|Ah~V(4?ZFE8v@;vQvd(}07*qoM6N<$g0$pE AjsO4v literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/create/textures/block/creative_crate_side.png b/src/main/resources/assets/create/textures/block/creative_crate_side.png deleted file mode 100644 index b5273f68d54738dc9f0428c8c79c7289552abfc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 524 zcmV+n0`vWeP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E;jv63FrU-0ewkCK~y+TrIOD|0#OvkeUHqt66rsQNmMFX zive8(7A56K(ii<}L-j)*jylcn>s@=#QYe z{D9bS7@xs5p4Td<`zy!|9;3BVMRp*G@@x^8qgk|l4WuTbGJuLB#t>4DDDr~H8Z)K@ zo)&LdV`(POKsDDL(tS}>=dW=x8Iu8T>n()MA>8_lDA+|bJoh*<9iZ&|^r6Cr%1cy-u(C}z5=hGRS zTH@?9@_ew$A#>3%djO9MC48*D;8mz~rp+4&LY_oxO#r=@u1$mDr>G%3b^)k}64XrZ zqsW`IAi4mGTGE1O0(b#Q*+5c5dH|H<|GS>3hH7Hz*O$?yZ0w>eNjR_T}k O00000#LT=By}Z;C1rt3( zJ+r@loG*ZC)_S@)hFJJ7owQN#kO7bDW-d`%TLXqvF17_ttPu@n)m7X@=gaS_dr#xm zh|BSg*FP6KE$CGImE+%b)!FwKx9&Z9{q0UpjXm#|bM<~LdQow&@1YEfi0VeC=Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0+2~WK~z{r?NvRC z6Hyes`It#E`B<}Tz_n083?jI_RyJE&SPB+)Vxy&vwLic{>?{N;e}JWIqq3ES$l9zn z3K2sRGs%4W&V6$yF9XS@OEU)^_vPJt-kdq_=1nO{651wMz~cwkG8L9pPG>|x5T`RW z4`Z^bi`+V(7H}F>jwZ}KU%dWSVgV2DT}|#D-sVMj9_i@LY2pUt)b%Elsi)-flq%&) zww{M&RXEmdl`oZfA7Ji>9Cy#PIKDqRqE~OfYXOh$_mjh$x9HjPcbo)j>TMlcZ|3?D zdFfl3K#f51oA91KxkDen9Mj7;CrY9Mtc605`{!G9{bGkY%_{BhHF#XPpx4aN+p+1= zo=l9_VBQ0T|hZP?__A{vb59L+gm80faKDZQTh;~aP< zmIUCu#7fu)i+i0K+bZk$jhxtv8d$q2FW(bO0tB#5Y#q*gew(UYW;?}d)L;Ox7TAQB z$C7}qV`X;2F4&DtVB6Q9W42SQMuf$vGmqgc9-gt=cG4#r0^GSiSGG$!Jnd%8VWo64 zYQ%2yIPyHKqh1DTR`x&?>;J6S3Jcd+Do21Jzw$qSWSj=5YuQXf6 tSrcvxg@8gpA)pXY2q**;0=6uG=s$#jPfOiWBdGuY002ovPDHLkV1g@}SPK9E diff --git a/src/main/resources/assets/create/textures/block/flex_crate.png b/src/main/resources/assets/create/textures/block/flex_crate.png deleted file mode 100644 index 27e78bb3369eb3dbfc35baf2e58d693a88eaaa4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 561 zcmV-10?z%3P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizW@LZzX3P}QzQTY0mey0K~y+TrBlmF z!$1_hNt3iqUsfx=Kn2l7H~xm;7r51h3wQkmKR|G)ApV2@q9TYOs0D@6cbmz>IcGXj zw|Zc5Z!-6s`xTT(W7H&ley=3@aPH-}Q-vjvn1*s?K`uxQGj2L!lUct_9M%O$pgSzyh_0zWfArmaTEkCu!hgm32pYkU873INU@u+z4pSa?Tk zumFx1Cj@wSw9XD?wNaM#S5H)&NTT}(D&+#L(sx0{N)Iuw6HH}ivmvkV9q#d0K0Vsa z!XmXKNe$W87b%?y0q*QVK+NLu_R-vhzeD63rcEH@J~yxS00000NkvXXu0mjf++y^- diff --git a/src/main/resources/data/create/advancements/andesite_alloy.json b/src/main/resources/data/create/advancements/andesite_alloy.json index 82a8a22b1..044362e9c 100644 --- a/src/main/resources/data/create/advancements/andesite_alloy.json +++ b/src/main/resources/data/create/advancements/andesite_alloy.json @@ -1,30 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:andesite_alloy" - }, - "description": { - "translate": "advancement.create:andesite_alloy.desc" - }, - "icon": { + "parent": "create:root", + "display": { + "icon": { + "item": "create:andesite_alloy" + }, + "title": { + "translate": "advancement.create.andesite_alloy" + }, + "description": { + "translate": "advancement.create.andesite_alloy.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:andesite_alloy" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": true - }, - "criteria": { - "alloy": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:andesite_alloy" - } - ] - } - } - }, - "parent": "create:root" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/andesite_casing.json b/src/main/resources/data/create/advancements/andesite_casing.json index 0d2396e9f..a0b4a7b9a 100644 --- a/src/main/resources/data/create/advancements/andesite_casing.json +++ b/src/main/resources/data/create/advancements/andesite_casing.json @@ -1,30 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:andesite_casing" - }, - "description": { - "translate": "advancement.create:andesite_casing.desc" - }, - "icon": { + "parent": "create:andesite_alloy", + "display": { + "icon": { + "item": "create:andesite_casing" + }, + "title": { + "translate": "advancement.create.andesite_casing" + }, + "description": { + "translate": "advancement.create.andesite_casing.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:andesite_casing" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "casing": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:andesite_casing" - } - ] - } - } - }, - "parent": "create:andesite_alloy" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/basin.json b/src/main/resources/data/create/advancements/basin.json new file mode 100644 index 000000000..8d31e5f81 --- /dev/null +++ b/src/main/resources/data/create/advancements/basin.json @@ -0,0 +1,37 @@ +{ + "parent": "create:press", + "display": { + "icon": { + "item": "create:basin" + }, + "title": { + "translate": "advancement.create.basin" + }, + "description": { + "translate": "advancement.create.basin.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:basin" + } + }, + "1": { + "trigger": "create:basin" + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/belt.json b/src/main/resources/data/create/advancements/belt.json new file mode 100644 index 000000000..a19fd4674 --- /dev/null +++ b/src/main/resources/data/create/advancements/belt.json @@ -0,0 +1,28 @@ +{ + "parent": "create:its_alive", + "display": { + "icon": { + "item": "create:belt_connector" + }, + "title": { + "translate": "advancement.create.belt" + }, + "description": { + "translate": "advancement.create.belt.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:connect_belt" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/brass.json b/src/main/resources/data/create/advancements/brass.json index b43592d94..105ed5831 100644 --- a/src/main/resources/data/create/advancements/brass.json +++ b/src/main/resources/data/create/advancements/brass.json @@ -1,31 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:brass", - "color": "gold" - }, - "description": { - "translate": "advancement.create:brass.desc" - }, - "icon": { - "item": "create:crushed_brass" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false + "parent": "create:mixer", + "display": { + "icon": { + "item": "create:brass_ingot" }, - "criteria": { - "brass": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:crushed_brass" - } - ] - } - } + "title": { + "translate": "advancement.create.brass" }, - "parent": "create:mechanical_mixer" + "description": { + "translate": "advancement.create.brass.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:brass_ingot" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/brass_casing.json b/src/main/resources/data/create/advancements/brass_casing.json index a91749db6..f3161f63e 100644 --- a/src/main/resources/data/create/advancements/brass_casing.json +++ b/src/main/resources/data/create/advancements/brass_casing.json @@ -1,30 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:brass_casing" - }, - "description": { - "translate": "advancement.create:brass_casing.desc" - }, - "icon": { + "parent": "create:brass", + "display": { + "icon": { + "item": "create:brass_casing" + }, + "title": { + "translate": "advancement.create.brass_casing" + }, + "description": { + "translate": "advancement.create.brass_casing.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:brass_casing" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "casing": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:brass_casing" - } - ] - } - } - }, - "parent": "create:brass" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/chromatic_compound.json b/src/main/resources/data/create/advancements/chromatic_compound.json index 65e496c4d..6091139ea 100644 --- a/src/main/resources/data/create/advancements/chromatic_compound.json +++ b/src/main/resources/data/create/advancements/chromatic_compound.json @@ -1,31 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:chromatic_compound", - "color": "dark_purple" - }, - "description": { - "translate": "advancement.create:chromatic_compound.desc" - }, - "icon": { + "parent": "create:crushing_wheel", + "display": { + "icon": { + "item": "create:chromatic_compound" + }, + "title": { + "translate": "advancement.create.chromatic_compound" + }, + "description": { + "translate": "advancement.create.chromatic_compound.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:chromatic_compound" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "alloy": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:chromatic_compound" - } - ] - } - } - }, - "parent": "create:mechanical_mixer" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/compact.json b/src/main/resources/data/create/advancements/compact.json new file mode 100644 index 000000000..e83071815 --- /dev/null +++ b/src/main/resources/data/create/advancements/compact.json @@ -0,0 +1,28 @@ +{ + "parent": "create:basin", + "display": { + "icon": { + "item": "minecraft:iron_block" + }, + "title": { + "translate": "advancement.create.compact" + }, + "description": { + "translate": "advancement.create.compact.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:compact" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/crafter.json b/src/main/resources/data/create/advancements/crafter.json new file mode 100644 index 000000000..24ef66ee9 --- /dev/null +++ b/src/main/resources/data/create/advancements/crafter.json @@ -0,0 +1,40 @@ +{ + "parent": "create:brass_casing", + "display": { + "icon": { + "item": "create:mechanical_crafter" + }, + "title": { + "translate": "advancement.create.crafter" + }, + "description": { + "translate": "advancement.create.crafter.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:mechanical_crafter" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:mechanical_crafter" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/crushing_wheel.json b/src/main/resources/data/create/advancements/crushing_wheel.json index 26af94ec9..5660cae98 100644 --- a/src/main/resources/data/create/advancements/crushing_wheel.json +++ b/src/main/resources/data/create/advancements/crushing_wheel.json @@ -1,34 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:crushing_wheel" - }, - "description": { - "translate": "advancement.create:crushing_wheel.desc" - }, - "icon": { + "parent": "create:crafter", + "display": { + "icon": { + "item": "create:crushing_wheel" + }, + "title": { + "translate": "advancement.create.crushing_wheel" + }, + "description": { + "translate": "advancement.create.crushing_wheel.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:crushing_wheel" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "crushers": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:crushing_wheel", - "count": { - "min": 2, - "max": 64 - } - } - ] - } - } - }, - "parent": "create:andesite_alloy" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/deployer.json b/src/main/resources/data/create/advancements/deployer.json index 88169d3a7..44b4cf6e6 100644 --- a/src/main/resources/data/create/advancements/deployer.json +++ b/src/main/resources/data/create/advancements/deployer.json @@ -1,30 +1,40 @@ { - "display": { - "title": { - "translate": "advancement.create:deployer" - }, - "description": { - "translate": "advancement.create:deployer.desc" - }, - "icon": { - "item": "create:deployer" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false + "parent": "create:brass_casing", + "display": { + "icon": { + "item": "create:deployer" }, - "criteria": { - "deployer": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:deployer" - } - ] - } - } + "title": { + "translate": "advancement.create.deployer" }, - "parent": "create:brass" + "description": { + "translate": "advancement.create.deployer.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:deployer" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:deployer" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/deployer_secret.json b/src/main/resources/data/create/advancements/deployer_secret.json deleted file mode 100644 index b87806234..000000000 --- a/src/main/resources/data/create/advancements/deployer_secret.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:deployer_secret" - }, - "description": { - "translate": "advancement.create:deployer_secret.desc" - }, - "icon": { - "item": "create:deployer" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "touching": { - "trigger": "create:deployer" - } - }, - "parent": "create:deployer" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/drill.json b/src/main/resources/data/create/advancements/drill.json new file mode 100644 index 000000000..efae45af5 --- /dev/null +++ b/src/main/resources/data/create/advancements/drill.json @@ -0,0 +1,40 @@ +{ + "parent": "create:andesite_casing", + "display": { + "icon": { + "item": "create:drill" + }, + "title": { + "translate": "advancement.create.drill" + }, + "description": { + "translate": "advancement.create.drill.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:drill" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:drill" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/electron_tube.json b/src/main/resources/data/create/advancements/electron_tube.json new file mode 100644 index 000000000..6070eb238 --- /dev/null +++ b/src/main/resources/data/create/advancements/electron_tube.json @@ -0,0 +1,35 @@ +{ + "parent": "create:polished_rose_quartz", + "display": { + "icon": { + "item": "create:electron_tube" + }, + "title": { + "translate": "advancement.create.electron_tube" + }, + "description": { + "translate": "advancement.create.electron_tube.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:electron_tube" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/expert_lane_1.json b/src/main/resources/data/create/advancements/expert_lane_1.json new file mode 100644 index 000000000..aeca3d781 --- /dev/null +++ b/src/main/resources/data/create/advancements/expert_lane_1.json @@ -0,0 +1,35 @@ +{ + "parent": "create:andesite_casing", + "display": { + "icon": { + "item": "minecraft:andesite" + }, + "title": { + "translate": "advancement.create.expert_lane_1" + }, + "description": { + "translate": "advancement.create.expert_lane_1.desc" + }, + "frame": "challenge", + "show_toast": false, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:andesite_casing" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/fist_bump.json b/src/main/resources/data/create/advancements/fist_bump.json new file mode 100644 index 000000000..8bd15daf2 --- /dev/null +++ b/src/main/resources/data/create/advancements/fist_bump.json @@ -0,0 +1,28 @@ +{ + "parent": "create:deployer", + "display": { + "icon": { + "item": "create:large_cogwheel" + }, + "title": { + "translate": "advancement.create.fist_bump" + }, + "description": { + "translate": "advancement.create.fist_bump.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "0": { + "trigger": "create:deployer" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/goggles.json b/src/main/resources/data/create/advancements/goggles.json new file mode 100644 index 000000000..e4c06682c --- /dev/null +++ b/src/main/resources/data/create/advancements/goggles.json @@ -0,0 +1,35 @@ +{ + "parent": "create:its_alive", + "display": { + "icon": { + "item": "create:goggles" + }, + "title": { + "translate": "advancement.create.goggles" + }, + "description": { + "translate": "advancement.create.goggles.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:goggles" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/its_alive.json b/src/main/resources/data/create/advancements/its_alive.json new file mode 100644 index 000000000..b826055f1 --- /dev/null +++ b/src/main/resources/data/create/advancements/its_alive.json @@ -0,0 +1,28 @@ +{ + "parent": "create:andesite_alloy", + "display": { + "icon": { + "item": "create:cogwheel" + }, + "title": { + "translate": "advancement.create.its_alive" + }, + "description": { + "translate": "advancement.create.its_alive.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:rotation" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/lava_wheel.json b/src/main/resources/data/create/advancements/lava_wheel.json new file mode 100644 index 000000000..16aff1ad9 --- /dev/null +++ b/src/main/resources/data/create/advancements/lava_wheel.json @@ -0,0 +1,28 @@ +{ + "parent": "create:water_wheel", + "display": { + "icon": { + "item": "minecraft:lava_bucket" + }, + "title": { + "translate": "advancement.create.lava_wheel" + }, + "description": { + "translate": "advancement.create.lava_wheel.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "0": { + "trigger": "create:lava_wheel" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/mechanical_mixer.json b/src/main/resources/data/create/advancements/mechanical_mixer.json deleted file mode 100644 index 8c633569e..000000000 --- a/src/main/resources/data/create/advancements/mechanical_mixer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:mixer" - }, - "description": { - "translate": "advancement.create:mixer.desc" - }, - "icon": { - "item": "create:mechanical_mixer" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "mixer": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:mechanical_mixer" - } - ] - } - } - }, - "parent": "create:mechanical_press" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/mechanical_press.json b/src/main/resources/data/create/advancements/mechanical_press.json deleted file mode 100644 index aff99de88..000000000 --- a/src/main/resources/data/create/advancements/mechanical_press.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:press" - }, - "description": { - "translate": "advancement.create:press.desc" - }, - "icon": { - "item": "create:mechanical_press" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "press": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:mechanical_press" - } - ] - } - }, - "plate": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "tag": "forge:plates" - } - ] - } - } - }, - "requirements": [ - [ - "press" - ], - [ - "plate" - ] - ], - "parent": "create:andesite_casing" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/millstone.json b/src/main/resources/data/create/advancements/millstone.json new file mode 100644 index 000000000..eaca3ad04 --- /dev/null +++ b/src/main/resources/data/create/advancements/millstone.json @@ -0,0 +1,40 @@ +{ + "parent": "create:andesite_alloy", + "display": { + "icon": { + "item": "create:millstone" + }, + "title": { + "translate": "advancement.create.millstone" + }, + "description": { + "translate": "advancement.create.millstone.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:millstone" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:millstone" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/mixer.json b/src/main/resources/data/create/advancements/mixer.json new file mode 100644 index 000000000..5988c6b10 --- /dev/null +++ b/src/main/resources/data/create/advancements/mixer.json @@ -0,0 +1,46 @@ +{ + "parent": "create:basin", + "display": { + "icon": { + "item": "create:mechanical_mixer" + }, + "title": { + "translate": "advancement.create.mixer" + }, + "description": { + "translate": "advancement.create.mixer.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:mechanical_mixer" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:mechanical_mixer" + } + }, + "2": { + "trigger": "create:mixer" + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ], + [ + "2" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/overstressed.json b/src/main/resources/data/create/advancements/overstressed.json index 614d5d50c..54dc44251 100644 --- a/src/main/resources/data/create/advancements/overstressed.json +++ b/src/main/resources/data/create/advancements/overstressed.json @@ -1,24 +1,28 @@ { - "display": { - "title": { - "translate": "advancement.create:overstressed", - "color": "red" - }, - "description": { - "translate": "advancement.create:overstressed.desc" - }, - "icon": { - "item": "minecraft:barrier" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": true + "parent": "create:its_alive", + "display": { + "icon": { + "item": "minecraft:barrier" }, - "criteria": { - "alloy": { - "trigger": "create:overstressed" - } + "title": { + "translate": "advancement.create.overstressed" }, - "parent": "create:rotation" + "description": { + "translate": "advancement.create.overstressed.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "0": { + "trigger": "create:overstressed" + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/polished_rose_quartz.json b/src/main/resources/data/create/advancements/polished_rose_quartz.json index 1684697b4..b1decb17f 100644 --- a/src/main/resources/data/create/advancements/polished_rose_quartz.json +++ b/src/main/resources/data/create/advancements/polished_rose_quartz.json @@ -1,32 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:polished_rose_quartz", - "color": "red" - }, - "description": { - "translate": "advancement.create:polished_rose_quartz.desc" - }, - "icon": { + "parent": "create:andesite_casing", + "display": { + "icon": { + "item": "create:polished_rose_quartz" + }, + "title": { + "translate": "advancement.create.polished_rose_quartz" + }, + "description": { + "translate": "advancement.create.polished_rose_quartz.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:polished_rose_quartz" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": true - }, - "criteria": { - "quartz": { - "trigger": "create:sandpaper_use", - "conditions": { - "target": { - "item": "create:rose_quartz" - }, - "result": { - "item": "create:polished_rose_quartz" - } - } - } - }, - "parent": "create:sand_paper" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/press.json b/src/main/resources/data/create/advancements/press.json new file mode 100644 index 000000000..500a857a2 --- /dev/null +++ b/src/main/resources/data/create/advancements/press.json @@ -0,0 +1,28 @@ +{ + "parent": "create:andesite_casing", + "display": { + "icon": { + "item": "create:mechanical_press" + }, + "title": { + "translate": "advancement.create.press" + }, + "description": { + "translate": "advancement.create.press.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:bonk" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/refined_radiance.json b/src/main/resources/data/create/advancements/refined_radiance.json index 6b3a5adfe..ade3d9379 100644 --- a/src/main/resources/data/create/advancements/refined_radiance.json +++ b/src/main/resources/data/create/advancements/refined_radiance.json @@ -1,31 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:refined_radiance", - "color": "white" - }, - "description": { - "translate": "advancement.create:refined_radiance.desc" - }, - "icon": { + "parent": "create:chromatic_compound", + "display": { + "icon": { + "item": "create:refined_radiance" + }, + "title": { + "translate": "advancement.create.refined_radiance" + }, + "description": { + "translate": "advancement.create.refined_radiance.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:refined_radiance" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "radiance": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:refined_radiance" - } - ] - } - } - }, - "parent": "create:chromatic_compound" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/refined_radiance_secret.json b/src/main/resources/data/create/advancements/refined_radiance_secret.json deleted file mode 100644 index 02272aa91..000000000 --- a/src/main/resources/data/create/advancements/refined_radiance_secret.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:refined_radiance_secret", - "color": "white" - }, - "description": { - "translate": "advancement.create:refined_radiance_secret.desc" - }, - "icon": { - "item": "create:refined_radiance" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "ritual": { - "trigger": "create:light_absorbed" - } - }, - "parent": "create:chromatic_compound" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/root.json b/src/main/resources/data/create/advancements/root.json index bb037c316..8242acf23 100644 --- a/src/main/resources/data/create/advancements/root.json +++ b/src/main/resources/data/create/advancements/root.json @@ -1,21 +1,29 @@ { "display": { "icon": { - "item": "create:brass_ingot" + "item": "create:brass_hand" }, "title": { - "translate": "advancement.create:root" + "translate": "advancement.create.root" }, "description": { - "translate": "advancement.create:root.desc" + "translate": "advancement.create.root.desc" }, - "background": "create:textures/block/scoria_bricks.png", + "frame": "task", "show_toast": false, - "announce_to_chat": false + "announce_to_chat": false, + "hidden": false, + "background": "create:textures/block/scoria_bricks.png" }, "criteria": { - "flower": { - "trigger": "minecraft:inventory_changed" + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": {} } - } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/rotation.json b/src/main/resources/data/create/advancements/rotation.json deleted file mode 100644 index 5f987ec18..000000000 --- a/src/main/resources/data/create/advancements/rotation.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:rotation" - }, - "description": { - "translate": "advancement.create:rotation.desc" - }, - "icon": { - "item": "create:cogwheel" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "alloy": { - "trigger": "create:rotation" - } - }, - "parent": "create:andesite_alloy" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/sand_paper.json b/src/main/resources/data/create/advancements/sand_paper.json deleted file mode 100644 index fd289f9dd..000000000 --- a/src/main/resources/data/create/advancements/sand_paper.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:sand_paper", - "color": "yellow" - }, - "description": { - "translate": "advancement.create:sand_paper.desc" - }, - "icon": { - "item": "create:sand_paper" - }, - "frame": "task", - "show_toast": true, - "announce_to_chat": false, - "hidden": true - }, - "criteria": { - "paperNormal": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:sand_paper" - } - ] - } - }, - "paperRed": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:red_sand_paper" - } - ] - } - } - }, - "requirements": [ - [ - "paperNormal", - "paperRed" - ] - ], - "parent": "create:root" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/sand_paper_secret.json b/src/main/resources/data/create/advancements/sand_paper_secret.json deleted file mode 100644 index 79097b1a2..000000000 --- a/src/main/resources/data/create/advancements/sand_paper_secret.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:sand_paper_secret", - "color": "yellow" - }, - "description": { - "translate": "advancement.create:sand_paper_secret.desc" - }, - "icon": { - "item": "create:red_sand_paper" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "normal": { - "trigger": "create:sandpaper_use", - "conditions": { - "result": { - "item": "create:sand_paper" - } - } - }, - "red": { - "trigger": "create:sandpaper_use", - "conditions": { - "result": { - "item": "create:red_sand_paper" - } - } - } - }, - "requirements": [ - [ - "normal", - "red" - ] - ], - "parent": "create:sand_paper" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/saw.json b/src/main/resources/data/create/advancements/saw.json new file mode 100644 index 000000000..575553fc8 --- /dev/null +++ b/src/main/resources/data/create/advancements/saw.json @@ -0,0 +1,40 @@ +{ + "parent": "create:press", + "display": { + "icon": { + "item": "create:saw" + }, + "title": { + "translate": "advancement.create.saw" + }, + "description": { + "translate": "advancement.create.saw.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:saw" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:saw" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/shadow_steel.json b/src/main/resources/data/create/advancements/shadow_steel.json index 8c4f7b7a1..a9df6c1c0 100644 --- a/src/main/resources/data/create/advancements/shadow_steel.json +++ b/src/main/resources/data/create/advancements/shadow_steel.json @@ -1,30 +1,35 @@ { - "display": { - "title": { - "translate": "advancement.create:shadow_steel" - }, - "description": { - "translate": "advancement.create:shadow_steel.desc" - }, - "icon": { + "parent": "create:chromatic_compound", + "display": { + "icon": { + "item": "create:shadow_steel" + }, + "title": { + "translate": "advancement.create.shadow_steel" + }, + "description": { + "translate": "advancement.create.shadow_steel.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "item": "create:shadow_steel" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "criteria": { - "alloy": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:shadow_steel" - } - ] - } - } - }, - "parent": "create:chromatic_compound" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/shifting_gears.json b/src/main/resources/data/create/advancements/shifting_gears.json new file mode 100644 index 000000000..5c1039659 --- /dev/null +++ b/src/main/resources/data/create/advancements/shifting_gears.json @@ -0,0 +1,28 @@ +{ + "parent": "create:its_alive", + "display": { + "icon": { + "item": "create:large_cogwheel" + }, + "title": { + "translate": "advancement.create.shifting_gears" + }, + "description": { + "translate": "advancement.create.shifting_gears.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:shifting_gears" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/speed_gauge.json b/src/main/resources/data/create/advancements/speed_gauge.json new file mode 100644 index 000000000..3b738054c --- /dev/null +++ b/src/main/resources/data/create/advancements/speed_gauge.json @@ -0,0 +1,40 @@ +{ + "parent": "create:goggles", + "display": { + "icon": { + "item": "create:speed_gauge" + }, + "title": { + "translate": "advancement.create.speed_gauge" + }, + "description": { + "translate": "advancement.create.speed_gauge.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:speed_gauge" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:speed_gauge" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/speed_secret.json b/src/main/resources/data/create/advancements/speed_secret.json deleted file mode 100644 index d867129ad..000000000 --- a/src/main/resources/data/create/advancements/speed_secret.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "display": { - "title": { - "translate": "advancement.create:speed_secret", - "color": "red" - }, - "description": { - "translate": "advancement.create:speed_secret.desc" - }, - "icon": { - "item": "create:speed_gauge" - }, - "frame": "goal", - "show_toast": true, - "announce_to_chat": true, - "hidden": true - }, - "criteria": { - "alloy": { - "trigger": "create:speed_read" - } - }, - "parent": "create:root" -} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/stress_gauge.json b/src/main/resources/data/create/advancements/stress_gauge.json new file mode 100644 index 000000000..cb6bd9b88 --- /dev/null +++ b/src/main/resources/data/create/advancements/stress_gauge.json @@ -0,0 +1,40 @@ +{ + "parent": "create:goggles", + "display": { + "icon": { + "item": "create:stress_gauge" + }, + "title": { + "translate": "advancement.create.stress_gauge" + }, + "description": { + "translate": "advancement.create.stress_gauge.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:stress_gauge" + } + }, + "1": { + "trigger": "create:kinetic_block", + "conditions": { + "block": "create:stress_gauge" + } + } + }, + "requirements": [ + [ + "0" + ], + [ + "1" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/water_wheel.json b/src/main/resources/data/create/advancements/water_wheel.json new file mode 100644 index 000000000..677d41082 --- /dev/null +++ b/src/main/resources/data/create/advancements/water_wheel.json @@ -0,0 +1,28 @@ +{ + "parent": "create:andesite_alloy", + "display": { + "icon": { + "item": "create:water_wheel" + }, + "title": { + "translate": "advancement.create.water_wheel" + }, + "description": { + "translate": "advancement.create.water_wheel.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:water_wheel" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/wrench.json b/src/main/resources/data/create/advancements/wrench.json new file mode 100644 index 000000000..9c50bf400 --- /dev/null +++ b/src/main/resources/data/create/advancements/wrench.json @@ -0,0 +1,35 @@ +{ + "parent": "create:its_alive", + "display": { + "icon": { + "item": "create:wrench" + }, + "title": { + "translate": "advancement.create.wrench" + }, + "description": { + "translate": "advancement.create.wrench.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:wrench" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file From 65853c9da090c32a887833dd4e016bcf3feaaf0d Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 7 May 2020 19:52:36 +0200 Subject: [PATCH 08/13] Creative Crate Revival - The creative crate is back on the menu - Schematicannons with creative crates no longer require gunpowder to operate - Creative crates can now be used for infinite item supply and voiding - Added a few more advancements --- .../java/com/simibubi/create/AllBlocks.java | 6 +- .../com/simibubi/create/AllTileEntities.java | 3 + .../com/simibubi/create/ScreenResources.java | 1 + .../create/data/CreateAdvancements.java | 80 ++++++++++--- .../foundation/advancement/AllTriggers.java | 1 + .../filtering/FilteringBehaviour.java | 12 ++ .../behaviour/filtering/FilteringHandler.java | 2 + .../filtering/FilteringRenderer.java | 4 + .../zapper/blockzapper/BlockzapperItem.java | 39 +++++-- .../logistics/block/diodes/LatchBlock.java | 2 +- .../block/inventories/CrateTileEntity.java | 37 ++++++ .../block/inventories/CreativeCrateBlock.java | 36 ++++++ .../inventories/CreativeCrateInventory.java | 52 +++++++++ .../inventories/CreativeCrateTileEntity.java | 106 ++++++++++++++++++ .../inventories/FlexcrateTileEntity.java | 26 +---- .../block/SchematicannonScreen.java | 44 +++++--- .../block/SchematicannonTileEntity.java | 38 ++++--- .../resources/assets/create/lang/en_us.json | 25 ++++- .../create/textures/block/crate_andesite.png | Bin 1324 -> 1320 bytes .../textures/block/crate_andesite_side.png | Bin 1298 -> 1321 bytes .../create/textures/block/crate_brass.png | Bin 1253 -> 1243 bytes .../textures/block/crate_brass_side.png | Bin 1531 -> 1538 bytes .../create/textures/block/crate_copper.png | Bin 1325 -> 1343 bytes .../textures/block/crate_copper_side.png | Bin 1387 -> 1401 bytes .../create/textures/gui/schematicannon.png | Bin 12936 -> 13735 bytes .../assets/create/textures/item/belt.png | Bin 384 -> 419 bytes .../create/advancements/copper_casing.json | 35 ++++++ .../data/create/advancements/copper_end.json | 35 ++++++ .../data/create/advancements/deforester.json | 35 ++++++ .../data/create/advancements/fist_bump.json | 2 +- .../data/create/advancements/shadow_end.json | 35 ++++++ .../create/advancements/symmetry_wand.json | 35 ++++++ .../create/advancements/upgraded_zapper.json | 29 +++++ .../data/create/advancements/water_wheel.json | 9 ++ .../data/create/advancements/zapper.json | 35 ++++++ 35 files changed, 674 insertions(+), 90 deletions(-) create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateTileEntity.java create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateBlock.java create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateInventory.java create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateTileEntity.java create mode 100644 src/main/resources/data/create/advancements/copper_casing.json create mode 100644 src/main/resources/data/create/advancements/copper_end.json create mode 100644 src/main/resources/data/create/advancements/deforester.json create mode 100644 src/main/resources/data/create/advancements/shadow_end.json create mode 100644 src/main/resources/data/create/advancements/symmetry_wand.json create mode 100644 src/main/resources/data/create/advancements/upgraded_zapper.json create mode 100644 src/main/resources/data/create/advancements/zapper.json diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 84d8351a0..d5edf2bb4 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -74,7 +74,7 @@ import com.simibubi.create.modules.logistics.block.diodes.ToggleLatchBlock; import com.simibubi.create.modules.logistics.block.extractor.ExtractorBlock; import com.simibubi.create.modules.logistics.block.extractor.LinkedExtractorBlock; import com.simibubi.create.modules.logistics.block.funnel.FunnelBlock; -import com.simibubi.create.modules.logistics.block.inventories.CrateBlock; +import com.simibubi.create.modules.logistics.block.inventories.CreativeCrateBlock; import com.simibubi.create.modules.logistics.block.inventories.FlexcrateBlock; import com.simibubi.create.modules.logistics.block.transposer.LinkedTransposerBlock; import com.simibubi.create.modules.logistics.block.transposer.TransposerBlock; @@ -182,10 +182,8 @@ public enum AllBlocks { CONTACT(new ContactBlock()), REDSTONE_BRIDGE(new RedstoneLinkBlock()), STOCKSWITCH(new StockswitchBlock()), - WAREHOUSE_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), FLEXCRATE(new FlexcrateBlock()), - FILTERED_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), - CREATIVE_CRATE(new CrateBlock(Properties.from(Blocks.ANDESITE))), + CREATIVE_CRATE(new CreativeCrateBlock(Properties.from(Blocks.ANDESITE))), EXTRACTOR(new ExtractorBlock()), VERTICAL_EXTRACTOR(new ExtractorBlock.Vertical()), LINKED_EXTRACTOR(new LinkedExtractorBlock()), diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 53519a6c0..803716846 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -82,6 +82,7 @@ import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterTileEntityRe import com.simibubi.create.modules.logistics.block.extractor.ExtractorTileEntity; import com.simibubi.create.modules.logistics.block.extractor.LinkedExtractorTileEntity; import com.simibubi.create.modules.logistics.block.funnel.FunnelTileEntity; +import com.simibubi.create.modules.logistics.block.inventories.CreativeCrateTileEntity; import com.simibubi.create.modules.logistics.block.inventories.FlexcrateTileEntity; import com.simibubi.create.modules.logistics.block.transposer.LinkedTransposerTileEntity; import com.simibubi.create.modules.logistics.block.transposer.TransposerTileEntity; @@ -153,6 +154,7 @@ public enum AllTileEntities { REDSTONE_BRIDGE(RedstoneLinkTileEntity::new, AllBlocks.REDSTONE_BRIDGE), STOCKSWITCH(StockswitchTileEntity::new, AllBlocks.STOCKSWITCH), FLEXCRATE(FlexcrateTileEntity::new, AllBlocks.FLEXCRATE), + CREATIVE_CRATE(CreativeCrateTileEntity::new, AllBlocks.CREATIVE_CRATE), EXTRACTOR(ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR), LINKED_EXTRACTOR(LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, AllBlocks.VERTICAL_LINKED_EXTRACTOR), TRANSPOSER(TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER), @@ -235,6 +237,7 @@ public enum AllTileEntities { bind(FurnaceEngineTileEntity.class, new EngineRenderer<>()); bind(SpeedControllerTileEntity.class, new SpeedControllerRenderer()); + bind(CreativeCrateTileEntity.class, new SmartTileEntityRenderer<>()); bind(RedstoneLinkTileEntity.class, new SmartTileEntityRenderer<>()); bind(ExtractorTileEntity.class, new SmartTileEntityRenderer<>()); bind(LinkedExtractorTileEntity.class, new SmartTileEntityRenderer<>()); diff --git a/src/main/java/com/simibubi/create/ScreenResources.java b/src/main/java/com/simibubi/create/ScreenResources.java index 19f7f780a..98a4e1a6f 100644 --- a/src/main/java/com/simibubi/create/ScreenResources.java +++ b/src/main/java/com/simibubi/create/ScreenResources.java @@ -26,6 +26,7 @@ public enum ScreenResources { SCHEMATICANNON_PROGRESS_2("schematicannon.png", 122, 161, 16, 15), SCHEMATICANNON_HIGHLIGHT("schematicannon.png", 0, 182, 28, 28), SCHEMATICANNON_FUEL("schematicannon.png", 0, 215, 82, 4), + SCHEMATICANNON_FUEL_CREATIVE("schematicannon.png", 0, 219, 82, 4), FLEXCRATE("flex_crate_and_stockpile_switch.png", 125, 129), FLEXCRATE_DOUBLE("double_flexcrate.png", 197, 129), diff --git a/src/main/java/com/simibubi/create/data/CreateAdvancements.java b/src/main/java/com/simibubi/create/data/CreateAdvancements.java index 6c8dd3608..4c1599ffd 100644 --- a/src/main/java/com/simibubi/create/data/CreateAdvancements.java +++ b/src/main/java/com/simibubi/create/data/CreateAdvancements.java @@ -16,11 +16,13 @@ import com.simibubi.create.AllItems; import com.simibubi.create.Create; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.advancement.KineticBlockTrigger; +import com.simibubi.create.modules.curiosities.zapper.blockzapper.BlockzapperItem; +import com.simibubi.create.modules.curiosities.zapper.blockzapper.BlockzapperItem.ComponentTier; +import com.simibubi.create.modules.curiosities.zapper.blockzapper.BlockzapperItem.Components; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.Advancement.Builder; import net.minecraft.advancements.FrameType; -import net.minecraft.advancements.IRequirementsStrategy; import net.minecraft.advancements.criterion.InventoryChangeTrigger; import net.minecraft.advancements.criterion.PlacedBlockTrigger; import net.minecraft.block.Block; @@ -28,6 +30,7 @@ import net.minecraft.block.Blocks; import net.minecraft.data.DataGenerator; import net.minecraft.data.DirectoryCache; import net.minecraft.data.IDataProvider; +import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.IItemProvider; import net.minecraft.util.ResourceLocation; @@ -55,7 +58,6 @@ public class CreateAdvancements implements IDataProvider { .withCriterion("0", itemGathered(AllItems.ANDESITE_ALLOY.get())) .register(t, id + ":andesite_alloy"); - kineticsBranch(t, andesite_alloy); Advancement water_wheel = advancement("water_wheel", AllBlocks.WATER_WHEEL.get(), TaskType.NORMAL) @@ -77,7 +79,7 @@ public class CreateAdvancements implements IDataProvider { .withParent(andesite_alloy) .withCriterion("0", itemGathered(AllBlocks.ANDESITE_CASING.get())) .register(t, id + ":andesite_casing"); - + andesiteExpertLane(t, andesite_casing); Advancement drill = kinecticAdvancement("drill", AllBlocks.DRILL, TaskType.NORMAL) @@ -89,9 +91,10 @@ public class CreateAdvancements implements IDataProvider { .withCriterion("0", AllTriggers.BONK.instance()) .register(t, id + ":press"); - Advancement rose_quartz = itemAdvancement("polished_rose_quartz", AllItems.POLISHED_ROSE_QUARTZ, TaskType.NORMAL) - .withParent(andesite_casing) - .register(t, id + ":polished_rose_quartz"); + Advancement rose_quartz = + itemAdvancement("polished_rose_quartz", AllItems.POLISHED_ROSE_QUARTZ, TaskType.NORMAL) + .withParent(andesite_casing) + .register(t, id + ":polished_rose_quartz"); Advancement electron_tube = itemAdvancement("electron_tube", AllItems.ELECTRON_TUBE, TaskType.NORMAL) .withParent(rose_quartz) @@ -123,6 +126,7 @@ public class CreateAdvancements implements IDataProvider { .register(t, id + ":brass"); brassAge(t, brass); + copperAge(t, press); } void kineticsBranch(Consumer t, Advancement root) { @@ -166,6 +170,20 @@ public class CreateAdvancements implements IDataProvider { } + void copperAge(Consumer t, Advancement root) { + String id = Create.ID; + + Advancement copper_casing = advancement("copper_casing", AllBlocks.COPPER_CASING.get(), TaskType.GOAL) + .withParent(root) + .withCriterion("0", itemGathered(AllBlocks.COPPER_CASING.get())) + .register(t, id + ":copper_casing"); + + Advancement copper_end = deadEnd() + .withParent(copper_casing) + .withCriterion("0", itemGathered(AllBlocks.COPPER_CASING.get())) + .register(t, id + ":copper_end"); + } + void brassAge(Consumer t, Advancement root) { String id = Create.ID; @@ -182,7 +200,7 @@ public class CreateAdvancements implements IDataProvider { .withParent(brass_casing) .register(t, id + ":deployer"); - Advancement fist_bump = advancement("fist_bump", AllBlocks.LARGE_COGWHEEL.get(), TaskType.SECRET) + Advancement fist_bump = advancement("fist_bump", AllBlocks.DEPLOYER.get(), TaskType.SECRET) .withParent(deployer) .withCriterion("0", AllTriggers.DEPLOYER_BOOP.instance()) .register(t, id + ":fist_bump"); @@ -196,21 +214,44 @@ public class CreateAdvancements implements IDataProvider { itemAdvancement("chromatic_compound", AllItems.CHROMATIC_COMPOUND, TaskType.NORMAL) .withParent(crushing_wheel) .register(t, id + ":chromatic_compound"); - - Advancement shadow_steel = - itemAdvancement("shadow_steel", AllItems.SHADOW_STEEL, TaskType.GOAL) + + Advancement shadow_steel = itemAdvancement("shadow_steel", AllItems.SHADOW_STEEL, TaskType.GOAL) .withParent(chromatic_compound) .register(t, id + ":shadow_steel"); - - Advancement refined_radiance = - itemAdvancement("refined_radiance", AllItems.REFINED_RADIANCE, TaskType.GOAL) + + Advancement refined_radiance = itemAdvancement("refined_radiance", AllItems.REFINED_RADIANCE, TaskType.GOAL) .withParent(chromatic_compound) .register(t, id + ":refined_radiance"); + + Advancement deforester = itemAdvancement("deforester", AllItems.DEFORESTER, TaskType.NORMAL) + .withParent(refined_radiance) + .register(t, id + ":deforester"); + + Advancement zapper = itemAdvancement("zapper", AllItems.PLACEMENT_HANDGUN, TaskType.NORMAL) + .withParent(refined_radiance) + .register(t, id + ":zapper"); + + ItemStack gunWithPurpurStuff = AllItems.PLACEMENT_HANDGUN.asStack(); + for (Components c : Components.values()) + BlockzapperItem.setTier(c, ComponentTier.Chromatic, gunWithPurpurStuff); + Advancement upgraded_zapper = advancement("upgraded_zapper", gunWithPurpurStuff, TaskType.CHALLENGE) + .withCriterion("0", AllTriggers.UPGRADED_ZAPPER.instance()) + .withParent(zapper) + .register(t, id + ":upgraded_zapper"); + + Advancement symmetry_wand = itemAdvancement("symmetry_wand", AllItems.SYMMETRY_WAND, TaskType.NORMAL) + .withParent(refined_radiance) + .register(t, id + ":symmetry_wand"); + + Advancement shadow_end = deadEnd() + .withParent(shadow_steel) + .withCriterion("0", itemGathered(AllItems.SHADOW_STEEL.get())) + .register(t, id + ":shadow_end"); } - + private void andesiteExpertLane(Consumer t, Advancement root) { String id = Create.ID; - + Advancement expert_lane_1 = advancement("expert_lane_1", Blocks.ANDESITE, TaskType.SILENT_GATE) .withParent(root) .withCriterion("0", itemGathered(AllBlocks.ANDESITE_CASING.get())) @@ -277,6 +318,7 @@ public class CreateAdvancements implements IDataProvider { GOAL(FrameType.GOAL, true, true, false), SECRET(FrameType.GOAL, true, true, true), SILENT_GATE(FrameType.CHALLENGE, false, false, false), + CHALLENGE(FrameType.CHALLENGE, true, true, false), ; @@ -300,6 +342,14 @@ public class CreateAdvancements implements IDataProvider { } public Builder advancement(String name, IItemProvider icon, TaskType type) { + return advancement(name, new ItemStack(icon), type); + } + + public Builder deadEnd() { + return advancement("eob", Items.OAK_SAPLING, TaskType.SILENT_GATE); + } + + public Builder advancement(String name, ItemStack icon, TaskType type) { return Advancement.Builder .builder() .withDisplay(icon, new TranslationTextComponent(LANG + name), diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java index 99adb7a55..e264f7509 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java @@ -30,6 +30,7 @@ public class AllTriggers { SPEED_READ = simple("speed_read"), BASIN_THROW = simple("basin"), PRESS_COMPACT = simple("compact"), + UPGRADED_ZAPPER = simple("upgraded_zapper"), MIXER_MIX = simple("mixer"); private static SimpleTrigger simple(String id) { diff --git a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringBehaviour.java index 901ff7c8e..7c8b02381 100644 --- a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringBehaviour.java @@ -1,6 +1,7 @@ package com.simibubi.create.foundation.behaviour.filtering; import java.util.function.Consumer; +import java.util.function.Supplier; import com.simibubi.create.AllPackets; import com.simibubi.create.foundation.behaviour.ValueBoxTransform; @@ -29,6 +30,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { private ItemStack filter; public int count; private Consumer callback; + private Supplier isActive; int scrollableValue; int ticksUntilScrollPacket; @@ -40,6 +42,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { slotPositioning = slot; showCount = false; callback = stack -> {}; + isActive = () -> true; textShift = Vec3d.ZERO; count = 0; ticksUntilScrollPacket = -1; @@ -93,6 +96,11 @@ public class FilteringBehaviour extends TileEntityBehaviour { callback = filterCallback; return this; } + + public FilteringBehaviour onlyActiveWhen(Supplier condition) { + isActive = condition; + return this; + } public FilteringBehaviour showCount() { showCount = true; @@ -161,5 +169,9 @@ public class FilteringBehaviour extends TileEntityBehaviour { public boolean anyAmount() { return count == 0; } + + public boolean isActive() { + return isActive.get(); + } } diff --git a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringHandler.java b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringHandler.java index 215f5355e..7e30aab98 100644 --- a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringHandler.java +++ b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringHandler.java @@ -41,6 +41,8 @@ public class FilteringHandler { FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE); if (behaviour == null) return; + if (!behaviour.isActive()) + return; BlockRayTraceResult ray = RaycastHelper.rayTraceRange(world, player, 10); if (ray == null) diff --git a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringRenderer.java b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringRenderer.java index bf5f1cfe9..87d00bf23 100644 --- a/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/behaviour/filtering/FilteringRenderer.java @@ -41,6 +41,8 @@ public class FilteringRenderer { FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE); if (behaviour == null) return; + if (!behaviour.isActive()) + return; if (Minecraft.getInstance().player.isSneaking()) return; @@ -75,6 +77,8 @@ public class FilteringRenderer { FilteringBehaviour behaviour = TileEntityBehaviour.get(tileEntityIn, FilteringBehaviour.TYPE); if (behaviour == null) return; + if (!behaviour.isActive()) + return; if (behaviour.getFilter().isEmpty()) return; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/zapper/blockzapper/BlockzapperItem.java b/src/main/java/com/simibubi/create/modules/curiosities/zapper/blockzapper/BlockzapperItem.java index 20c0480b6..5cc8cd05a 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/zapper/blockzapper/BlockzapperItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/zapper/blockzapper/BlockzapperItem.java @@ -7,6 +7,7 @@ import java.util.Set; import com.simibubi.create.AllItems; import com.simibubi.create.Create; +import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.item.IHaveCustomItemModel; @@ -110,8 +111,10 @@ public class BlockzapperItem extends ZapperItem implements IHaveCustomItemModel continue; if (!player.isCreative() && BlockHelper.findAndRemoveInInventory(selectedState, player, 1) == 0) { player.getCooldownTracker().setCooldown(stack.getItem(), 20); - player.sendStatusMessage( - new StringTextComponent(TextFormatting.RED + Lang.translate("blockzapper.empty")), true); + player + .sendStatusMessage( + new StringTextComponent(TextFormatting.RED + Lang.translate("blockzapper.empty")), + true); return false; } @@ -119,9 +122,9 @@ public class BlockzapperItem extends ZapperItem implements IHaveCustomItemModel dropBlocks(world, player, stack, face, placed); for (Direction updateDirection : Direction.values()) - selectedState = selectedState.updatePostPlacement(updateDirection, - world.getBlockState(placed.offset(updateDirection)), world, placed, - placed.offset(updateDirection)); + selectedState = selectedState + .updatePostPlacement(updateDirection, world.getBlockState(placed.offset(updateDirection)), + world, placed, placed.offset(updateDirection)); BlockSnapshot blocksnapshot = BlockSnapshot.getBlockSnapshot(world, placed); IFluidState ifluidstate = world.getFluidState(placed); @@ -132,9 +135,20 @@ public class BlockzapperItem extends ZapperItem implements IHaveCustomItemModel return false; } - if (player instanceof ServerPlayerEntity) - CriteriaTriggers.PLACED_BLOCK.trigger((ServerPlayerEntity) player, placed, - new ItemStack(selectedState.getBlock())); + if (player instanceof ServerPlayerEntity && world instanceof ServerWorld) { + ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; + CriteriaTriggers.PLACED_BLOCK.trigger(serverPlayer, placed, new ItemStack(selectedState.getBlock())); + + boolean fullyUpgraded = true; + for (Components c : Components.values()) { + if (getTier(c, stack) != ComponentTier.Chromatic) { + fullyUpgraded = false; + break; + } + } + if (fullyUpgraded) + AllTriggers.UPGRADED_ZAPPER.trigger(serverPlayer); + } } return true; @@ -179,8 +193,9 @@ public class BlockzapperItem extends ZapperItem implements IHaveCustomItemModel Vec3d start = player.getPositionVec().add(0, player.getEyeHeight(), 0); Vec3d range = player.getLookVec().scale(getRange(stack)); - BlockRayTraceResult raytrace = player.world.rayTraceBlocks( - new RayTraceContext(start, start.add(range), BlockMode.COLLIDER, FluidMode.NONE, player)); + BlockRayTraceResult raytrace = player.world + .rayTraceBlocks( + new RayTraceContext(start, start.add(range), BlockMode.COLLIDER, FluidMode.NONE, player)); BlockPos pos = raytrace.getPos().toImmutable(); if (pos == null) @@ -318,8 +333,8 @@ public class BlockzapperItem extends ZapperItem implements IHaveCustomItemModel Block.spawnDrops(worldIn.getBlockState(placed), worldIn, playerIn.getPosition(), tileentity); if (getTier(Components.Retriever, item) == ComponentTier.Chromatic) - for (ItemStack stack : Block.getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed, - tileentity)) + for (ItemStack stack : Block + .getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed, tileentity)) if (!playerIn.inventory.addItemStackToInventory(stack)) Block.spawnAsEntity(worldIn, placed, stack); } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java index a1dbe7134..241e68a62 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java @@ -34,7 +34,7 @@ public class LatchBlock extends ToggleLatchBlock { Direction direction = state.get(HORIZONTAL_FACING); Direction left = direction.rotateY(); Direction right = direction.rotateYCCW(); - boolean shouldSide = worldIn.isBlockPowered(pos.offset(left)) || worldIn.isBlockPowered(pos.offset(right)); + boolean shouldSide = worldIn.isSidePowered(pos, left) || worldIn.isSidePowered(pos, right); TickPriority tickpriority = TickPriority.HIGH; if (this.isFacingTowardsRepeater(worldIn, pos, state)) diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateTileEntity.java new file mode 100644 index 000000000..a30a76486 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateTileEntity.java @@ -0,0 +1,37 @@ +package com.simibubi.create.modules.logistics.block.inventories; + +import java.util.List; + +import com.simibubi.create.foundation.behaviour.base.SmartTileEntity; +import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; + +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; + +public abstract class CrateTileEntity extends SmartTileEntity { + + public CrateTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + } + + @Override + public void addBehaviours(List behaviours) {} + + public boolean isDoubleCrate() { + return getBlockState().get(FlexcrateBlock.DOUBLE); + } + + public boolean isSecondaryCrate() { + if (!hasWorld()) + return false; + if (!(getBlockState().getBlock() instanceof CrateBlock)) + return false; + return isDoubleCrate() && getFacing().getAxisDirection() == AxisDirection.NEGATIVE; + } + + public Direction getFacing() { + return getBlockState().get(FlexcrateBlock.FACING); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateBlock.java new file mode 100644 index 000000000..cd63d9a89 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateBlock.java @@ -0,0 +1,36 @@ +package com.simibubi.create.modules.logistics.block.inventories; + +import com.simibubi.create.foundation.block.ITE; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; + +public class CreativeCrateBlock extends CrateBlock implements ITE { + + public CreativeCrateBlock(Properties p_i48415_1_) { + super(p_i48415_1_); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new CreativeCrateTileEntity(); + } + + @Override + public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) { + withTileEntityDo(worldIn, pos, CreativeCrateTileEntity::onPlaced); + } + + @Override + public Class getTileEntityClass() { + return CreativeCrateTileEntity.class; + } +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateInventory.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateInventory.java new file mode 100644 index 000000000..2e0fb5f14 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateInventory.java @@ -0,0 +1,52 @@ +package com.simibubi.create.modules.logistics.block.inventories; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.items.IItemHandler; + +public class CreativeCrateInventory implements IItemHandler { + + private CreativeCrateTileEntity te; + + public CreativeCrateInventory(CreativeCrateTileEntity te) { + this.te = te; + } + + @Override + public int getSlots() { + return 2; + } + + @Override + public ItemStack getStackInSlot(int slot) { + if (slot == 1) + return ItemStack.EMPTY; + ItemStack filter = te.filter.getFilter().copy(); + if (!filter.isEmpty()) + filter.setCount(filter.getMaxStackSize()); + return filter; + } + + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + return ItemStack.EMPTY; + } + + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + ItemStack filter = te.filter.getFilter().copy(); + if (!filter.isEmpty()) + filter.setCount(amount); + return filter; + } + + @Override + public int getSlotLimit(int slot) { + return getStackInSlot(slot).getMaxStackSize(); + } + + @Override + public boolean isItemValid(int slot, ItemStack stack) { + return true; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateTileEntity.java new file mode 100644 index 000000000..ccf5bb73b --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CreativeCrateTileEntity.java @@ -0,0 +1,106 @@ +package com.simibubi.create.modules.logistics.block.inventories; + +import java.util.List; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.behaviour.ValueBoxTransform; +import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; +import com.simibubi.create.foundation.behaviour.filtering.FilteringBehaviour; + +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; + +public class CreativeCrateTileEntity extends CrateTileEntity { + + public CreativeCrateTileEntity() { + super(AllTileEntities.CREATIVE_CRATE.type); + inv = new CreativeCrateInventory(this); + itemHandler = LazyOptional.of(() -> inv); + } + + FilteringBehaviour filter; + LazyOptional itemHandler; + private CreativeCrateInventory inv; + + @Override + public void addBehaviours(List behaviours) { + filter = createFilter(); + filter.onlyActiveWhen(this::filterVisible); + filter.withCallback(this::filterChanged); + behaviours.add(filter); + } + + private boolean filterVisible() { + if (!hasWorld() || isDoubleCrate() && !isSecondaryCrate()) + return false; + return true; + } + + private void filterChanged(ItemStack filter) { + if (!filterVisible()) + return; + CreativeCrateTileEntity otherCrate = getOtherCrate(); + if (otherCrate == null) + return; + if (ItemStack.areItemsEqual(filter, otherCrate.filter.getFilter())) + return; + otherCrate.filter.setFilter(filter); + } + + private CreativeCrateTileEntity getOtherCrate() { + if (!AllBlocks.CREATIVE_CRATE.typeOf(getBlockState())) + return null; + TileEntity tileEntity = world.getTileEntity(pos.offset(getFacing())); + if (tileEntity instanceof CreativeCrateTileEntity) + return (CreativeCrateTileEntity) tileEntity; + return null; + } + + public void onPlaced() { + if (!isDoubleCrate()) + return; + CreativeCrateTileEntity otherCrate = getOtherCrate(); + if (otherCrate == null) + return; + + filter.withCallback($ -> {}); + filter.setFilter(otherCrate.filter.getFilter()); + filter.withCallback(this::filterChanged); + } + + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return itemHandler.cast(); + return super.getCapability(cap, side); + } + + public FilteringBehaviour createFilter() { + return new FilteringBehaviour(this, new ValueBoxTransform() { + + @Override + protected Vec3d getOrientation(BlockState state) { + return new Vec3d(0, 0, 90); + } + + @Override + protected Vec3d getLocation(BlockState state) { + return new Vec3d(0.5, 13 / 16d, 0.5); + } + + protected float getScale() { + return super.getScale() * 1.5f; + }; + + }); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java index 7de4030b2..234d63c48 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java @@ -2,7 +2,6 @@ package com.simibubi.create.modules.logistics.block.inventories; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllTileEntities; -import com.simibubi.create.foundation.block.SyncedTileEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -15,7 +14,6 @@ import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.common.capabilities.Capability; @@ -24,7 +22,7 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; -public class FlexcrateTileEntity extends SyncedTileEntity implements INamedContainerProvider { +public class FlexcrateTileEntity extends CrateTileEntity implements INamedContainerProvider { public class Inv extends ItemStackHandler { public Inv() { @@ -81,20 +79,6 @@ public class FlexcrateTileEntity extends SyncedTileEntity implements INamedConta return new FlexcrateContainer(id, inventory, this); } - public boolean isDoubleCrate() { - return getBlockState().get(FlexcrateBlock.DOUBLE); - } - - public FlexcrateTileEntity getMainCrate() { - if (isSecondaryCrate()) - return getOtherCrate(); - return this; - } - - public boolean isSecondaryCrate() { - return isDoubleCrate() && getFacing().getAxisDirection() == AxisDirection.NEGATIVE; - } - public FlexcrateTileEntity getOtherCrate() { if (!AllBlocks.FLEXCRATE.typeOf(getBlockState())) return null; @@ -104,10 +88,12 @@ public class FlexcrateTileEntity extends SyncedTileEntity implements INamedConta return null; } - public Direction getFacing() { - return getBlockState().get(FlexcrateBlock.FACING); + public FlexcrateTileEntity getMainCrate() { + if (isSecondaryCrate()) + return getOtherCrate(); + return this; } - + public void onSplit() { FlexcrateTileEntity other = getOtherCrate(); if (other == null) diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java index e189ea4a5..a2994b5d2 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java @@ -82,18 +82,20 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen(4); replaceLevelIndicators = new Vector<>(4); - List icons = ImmutableList.of(ScreenResources.I_DONT_REPLACE, ScreenResources.I_REPLACE_SOLID, - ScreenResources.I_REPLACE_ANY, ScreenResources.I_REPLACE_EMPTY); - List toolTips = ImmutableList.of(Lang.translate("gui.schematicannon.option.dontReplaceSolid"), - Lang.translate("gui.schematicannon.option.replaceWithSolid"), - Lang.translate("gui.schematicannon.option.replaceWithAny"), - Lang.translate("gui.schematicannon.option.replaceWithEmpty")); + List icons = ImmutableList + .of(ScreenResources.I_DONT_REPLACE, ScreenResources.I_REPLACE_SOLID, ScreenResources.I_REPLACE_ANY, + ScreenResources.I_REPLACE_EMPTY); + List toolTips = ImmutableList + .of(Lang.translate("gui.schematicannon.option.dontReplaceSolid"), + Lang.translate("gui.schematicannon.option.replaceWithSolid"), + Lang.translate("gui.schematicannon.option.replaceWithAny"), + Lang.translate("gui.schematicannon.option.replaceWithEmpty")); for (int i = 0; i < 4; i++) { replaceLevelIndicators.add(new Indicator(x + 16 + i * 18, y + 96, "")); @@ -189,8 +191,10 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen tip = button.getToolTip(); tip.add(TextFormatting.BLUE + (enabled ? optionEnabled : optionDisabled)); - tip.addAll(TooltipHelper.cutString(Lang.translate("gui.schematicannon.option." + tooltipKey + ".description"), - GRAY, GRAY)); + tip + .addAll(TooltipHelper + .cutString(Lang.translate("gui.schematicannon.option." + tooltipKey + ".description"), GRAY, + GRAY)); } @Override @@ -221,8 +225,9 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen tooltip = new ArrayList<>(); - tooltip.add(Lang.translate(_gunpowderLevel, "" + (int) (te.fuelLevel * 100))); - tooltip.add(GRAY + Lang.translate(_shotsRemaining, "" + TextFormatting.BLUE + shotsLeft)); + float f = te.hasCreativeCrate ? 100 : te.fuelLevel * 100; + tooltip.add(Lang.translate(_gunpowderLevel, "" + (int) f)); + if (!te.hasCreativeCrate) + tooltip.add(GRAY + Lang.translate(_shotsRemaining, "" + TextFormatting.BLUE + shotsLeft)); if (shotsLeftWithItems != shotsLeft) - tooltip.add(GRAY - + Lang.translate(_shotsRemainingWithBackup, "" + TextFormatting.BLUE + shotsLeftWithItems)); + tooltip + .add(GRAY + Lang + .translate(_shotsRemainingWithBackup, "" + TextFormatting.BLUE + shotsLeftWithItems)); renderTooltip(tooltip, mouseX, mouseY); } diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java index b09beee26..3ebed6948 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java @@ -359,7 +359,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } // Check Fuel - if (fuelLevel <= 0) { + if (fuelLevel <= 0 && !hasCreativeCrate) { fuelLevel = 0; state = State.PAUSED; statusMsg = "noGunpowder"; @@ -466,7 +466,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } public double getFuelUsageRate() { - return config().schematicannonFuelUsage.get() / 100f; + return hasCreativeCrate ? 0 : config().schematicannonFuelUsage.get() / 100f; } protected void initializePrinter(ItemStack blueprint) { @@ -556,8 +556,10 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC int amountFound = 0; for (IItemHandler iItemHandler : attachedInventories) { - amountFound += ItemHelper.extract(iItemHandler, s -> ItemRequirement.validate(required, s), - ExtractionCountMode.UPTO, required.getCount(), true).getCount(); + amountFound += ItemHelper + .extract(iItemHandler, s -> ItemRequirement.validate(required, s), ExtractionCountMode.UPTO, + required.getCount(), true) + .getCount(); if (amountFound < required.getCount()) continue; @@ -570,14 +572,16 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC if (!simulate && success) { int amountFound = 0; for (IItemHandler iItemHandler : attachedInventories) { - amountFound += ItemHelper.extract(iItemHandler, s -> ItemRequirement.validate(required, s), - ExtractionCountMode.UPTO, required.getCount(), false).getCount(); + amountFound += ItemHelper + .extract(iItemHandler, s -> ItemRequirement.validate(required, s), ExtractionCountMode.UPTO, + required.getCount(), false) + .getCount(); if (amountFound < required.getCount()) continue; break; } } - + return success; } @@ -618,14 +622,16 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC public void finishedPrinting() { inventory.setStackInSlot(0, ItemStack.EMPTY); - inventory.setStackInSlot(1, - new ItemStack(AllItems.EMPTY_BLUEPRINT.get(), inventory.getStackInSlot(1).getCount() + 1)); + inventory + .setStackInSlot(1, + new ItemStack(AllItems.EMPTY_BLUEPRINT.get(), inventory.getStackInSlot(1).getCount() + 1)); state = State.STOPPED; statusMsg = "finished"; resetPrinter(); target = getPos().add(1, 0, 0); - world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_FINISH.get(), - SoundCategory.BLOCKS, 1, .7f); + world + .playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_FINISH.get(), + SoundCategory.BLOCKS, 1, .7f); sendUpdate = true; } @@ -703,6 +709,8 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } protected void refillFuelIfPossible() { + if (hasCreativeCrate) + return; if (1 - fuelLevel + 1 / 128f < getFuelAddedByGunPowder()) return; if (inventory.getStackInSlot(4).isEmpty()) @@ -772,8 +780,9 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } public void playFiringSound() { - world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_LAUNCH_BLOCK.get(), - SoundCategory.BLOCKS, .1f, 1.1f); + world + .playSound(null, pos.getX(), pos.getY(), pos.getZ(), AllSoundEvents.SCHEMATICANNON_LAUNCH_BLOCK.get(), + SoundCategory.BLOCKS, .1f, 1.1f); } public void sendToContainer(PacketBuffer buffer) { @@ -837,8 +846,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } @Override - public void addBehaviours(List behaviours) { - } + public void addBehaviours(List behaviours) {} @Override public void lazyTick() { diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index b6bd3b61f..d9bdd07d8 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -131,9 +131,7 @@ "block.create.contact": "Redstone Contact", "block.create.redstone_bridge": "Redstone Link", "block.create.stockswitch": "Stockpile Switch", - "block.create.warehouse_crate": "Warehouse Crate", "block.create.flexcrate": "Adjustable Crate", - "block.create.filtered_crate": "Filtered Crate", "block.create.creative_crate": "The Endless Crate", "block.create.extractor": "Extractor", "block.create.belt_funnel": "Funnel", @@ -683,6 +681,8 @@ "advancement.create.brass.desc": "Use Crushed Copper and Crushed Zinc to create some Brass.", "advancement.create.brass_casing": "The Brass Age", "advancement.create.brass_casing.desc": "Use newly obtained Brass and some Wood to create a more advanced Casing.", + "advancement.create.copper_casing": "The Copper Age", + "advancement.create.copper_casing.desc": "Use some copper sheets to create Copper Casing.", "advancement.create.crafter": "Automated Assembly", "advancement.create.crafter.desc": "Place and power some Mechanical Crafters", @@ -700,6 +700,18 @@ "advancement.create.refined_radiance": "Bright and Inspiring", "advancement.create.refined_radiance.desc": "Create Refined Radiance, a powerful chromatic substance.", + "advancement.create.zapper": "Building with style", + "advancement.create.zapper.desc": "Craft a Blockzapper. A radiant laser gun that helps you build.", + "advancement.create.upgraded_zapper": "Radiant Overdrive", + "advancement.create.upgraded_zapper.desc": "Create and activate a fully upgraded Blockzapper.", + "advancement.create.symmetry_wand": "Radiant Mirrors", + "advancement.create.symmetry_wand.desc": "Craft a Staff of Symmetry.", + "advancement.create.deforester": "Radiant Chopping", + "advancement.create.deforester.desc": "Craft a Deforester, and say goodbye to the local forest.", + + "advancement.create.eob": "End of Beta", + "advancement.create.eob.desc": "Expect more content here in the future. <3", + "create.subtitle.schematicannon_launch_block": "Schematicannon shoots", "create.subtitle.schematicannon_finish": "Schematicannon finishes", "create.subtitle.slime_added": "Slime squishes", @@ -1074,6 +1086,11 @@ "block.create.flexcrate.tooltip.summary": "This _Storage_ _Container_ allows Manual control over its capacity. It can hold up to _16_ _Stacks_ of any Item. Supports _Redstone_ _Comparators_.", "block.create.flexcrate.tooltip.control1": "When R-Clicked", "block.create.flexcrate.tooltip.action1": "Opens the _Interface_.", + + "block.create.creative_crate.tooltip": "THE ENDLESS CRATE", + "block.create.creative_crate.tooltip.summary": "This _Storage_ _Container_ allows infinite replication of any item. Place next to a _Schematicannon_ to remove any material requirements.", + "block.create.creative_crate.tooltip.condition1": "When Item in Filter Slot", + "block.create.creative_crate.tooltip.behaviour1": "Anything _extracting_ from this container will provide an _endless_ _supply_ of the item specified. Items _inserted_ into this crate will be _voided._", "block.create.extractor.tooltip": "EXTRACTOR", "block.create.extractor.tooltip.summary": "_Takes_ _Items_ from an attached _Inventory_ and drops them onto the ground. Will not drop Items unless the space is clear. Can be assigned an item-stack as a _filter_.", @@ -1204,9 +1221,5 @@ "tool.create.rose_quartz.tooltip": "ROSE QUARTZ TOOLS", "tool.create.rose_quartz.tooltip.summary": "This tool grants you a _greater_ _reach_ for _breaking_ _blocks_ or _placing_ _blocks_ from the off-hand.", - "block.create.warehouse_crate.tooltip": "WIP", - "block.create.filtered_crate.tooltip": "WIP", - "block.create.creative_crate.tooltip": "WIP", - "itemGroup.create": "Create" } diff --git a/src/main/resources/assets/create/textures/block/crate_andesite.png b/src/main/resources/assets/create/textures/block/crate_andesite.png index f79955709f73f00330c03016629d1b48b113ae38..6668942774007dd4c0d1c611769be5b53827d17f 100644 GIT binary patch delta 1263 zcmVT zVSCn(89!qBU*nqX8QW3zlmkDhr@O1CyQ{mayNX^kIee~sc7J8YwG6}Ia9$#E9Ea=3 zb+Z5Htm-fM&bK?cM1k|$uhL)`QL$)phw1bw83mKf_!sJQJLHr-GICG3Z8REEwc^rb zHcS0esZ_cAtp289(49YS)79^<=Hl7rw0^xtW!t2`4?^1V9g4Com{ zg-W)e2G6tXwtteH-|}b>PAQBgWLqZPJ?hc9roXgrr278*q(>J%_;fxaQGTA2X*)c~ z#(I@Jw?uBmqOwz@hU$oNV||Ub&(tWFGZL9wwP~YX<^Nu8derchT*;R8MIA)rDU}>6 zIj%&3*4{t70uV(5vWf-r-7?n!WWV3tqi#g>aKBHFgMTrN2V-t4*+r#TPVK~qEUTo( zi6;}#7ykgOU~n!Z3e^2|-T{Dt+d-dGG#ZmzF0icPd*oR}n_iJ#+br?F025=Y0VW#^ z<8k!9_=ja`2ViS8zsB`M0Ub<)l_KqRM|5v*z;a9uWUysmvTzh~S^p1X9d%>*Fg&JC zyTj#_4Sxu|c9$pHa0|RrS#5LeWYt-QQG6VNV-+}W9i1q@=Gk1vZp#&A1+X1~(nxHe zP>MSP89=~U&Suk;T+Y`n#uH$*u#v+~pUdExHh}GbWfo17g1)*w%8&pIOFBX+Zd1ky zAYYI zJjWzFd7@dR%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zQ7LbcVOWH>2f-3G zD`TX&KTrYh!doBElP8Z^0rmlC1Q5@G_ka3(Th##FTcy*^ti4gSJTToWzLy-H;>E?2KzC%h3TVBMRJd_rDEL{JpWha!C-5mjIX zM)TcZ@@mndKYzYMjl17b>;Cuj$B(z@_aFAyy!a+cCM|#nC*UbZEWmsyXbT8V@PCzs zd?1MOhXpF-JZp>k+HRHOd~akd#PuYyyQC$6d_%pI4^#?S&R%49g2Z$IgHa@|>*)E! zDkLnUUdjg~pNrbYLikLw$_FH$NCMM~`NaZBA}5?oSTiZ>@&RcBxj8`c3E3rp>GxGS zj#{@Y6j{m#;84)?%64?_>+%7#^=!DFM0P1V-+86XHRclKq2y9N01(TcHs^7DO+J9O z9@hn&r-WPCu{dC|fTesuo?-#99IT7?64T`=K5IS!mhu7dN;w-KG9YqYmJCM8Io9=s dSb_6{=syb0L&~5mb)*0Q002ovPDHLkV1iZhVc-A& diff --git a/src/main/resources/assets/create/textures/block/crate_andesite_side.png b/src/main/resources/assets/create/textures/block/crate_andesite_side.png index b291afe77952a8003e7a83240e478b0d19e1e416..b0b2a96bb6ac14c58bc1d2c784bbdf16d4f1f190 100644 GIT binary patch delta 1251 zcmV<91RVR43aJW^R)4-pL_t(oN5xmoZyQw*AJ^-TwVibw$9B>Wg|Rp} zPg=i^nKy4{-n^M-dfG_g=hnNoVjevKf*=_6EL_*+7W32k0)Na24ek2v^%N`c$!DLk z0^J~_Y}P@SF&rLq+wTW7SMs<&h+}f>GRC2Q$gNu}Q#xh&ophRx+AUtA`N1oE;Q8Ra z_buh^8!K^n&ZS(&p?lkh^h~2dVHBBhhBliAv{Ij^lwrkOCmK*MB+BPlW`fpHkG#1& z6^)ESK23u`ihpG-FO*nLY!s0(==ZnV^z~2oQs=N3+FqQ^qKQjUslmTHC><4lIx zs8%U)TY2#&(em}Nukq@eOv5^$3^`CpbnU!7cZp`<5ul&XWjP1PTH$FdSfzz7U#LW>G9@w|azGG99Du)X z?k1U1XTszN;2Q0w$GJ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`cU@&|Bt6_I;hm?&G#+^1kM~A^iNGBD8K7a-3u5-jWF5f0QViWh{y%_ z5A@3g@*luD`hObGwYXKLxqlA=0x#xLelBA(0lW<}OgqIIjixM~Ab@N*W>TZ+Q>78? z5M#VXi{}7(UkBtnr8*N4U4P_@As#6^#T$!bFcdk}CM%V<=LVr-Dx1d52sexcFh=@# z<6C5Cg=&M0NT^2_aL59>3xIy}4cig^24oTazwR3Jb$_|YbPIH1U^Hc_T{hT1x;bGH zz>WpVAp0*D=`wvjTn4Mc_o53iaM)Q2x;bHPG;zbjTqNIU`h1CTb-#-Q@*mL0z=fi#;{wD$GHy_*;?Zkcj2GY9urHNdi>jFAK2-6gtAh*SQGFW#<{}_Sp z0vRvaqW=R#SEmsD_~qOFL?%I7yCrhHCN95T0|HMI zPlNzs=;YKWUH|)*s&Y}z`)wyoGsnj{Yp&1!LrLX#WXj5>L$AGbnrfh3QEOyWNWm05XMx3VD8r zs&(Ze&!?gyD!{Jg(1JBa6)}l{;HeO|gR&`R7GR>SnEQ%CM3Dqyi6B!1AhTbt(lgmK z)s^Yzme$Eo7RFjIySPArLrgZn1b<+{p?Hi3LLnwOstF>o1f4yZ<^I**7s$4{I}lXb z^`YT;JqocNETC`fpzO4JS`0`U$y?0ks-OZ}$X&HNz;0VhfDND_vh&*|vf>GDcWMTw zsf#e;EILzu!{+9!^otb zG?Whn8~iWn5;me-QW4q9s~a?uFnjzfxN_+u`sS;5xsMb@L;8YHvC`nTq%X++{N0E2 z#rd~*JTE7^LEypf5JFLX-q$=t$9r<6aD diff --git a/src/main/resources/assets/create/textures/block/crate_copper.png b/src/main/resources/assets/create/textures/block/crate_copper.png index 993ef700750c905f62602560840c94955cef8e21..291bafc0edf9530b0e46fe86f499cafeb18a9d18 100644 GIT binary patch delta 1286 zcmV+h1^N1|3cm`FNq@os01mEhwg) zj!Y9LnNBA2n>W*r_dD;Mm-}AcOmwB-2j|`U?!D*do_p@OhkyQU`0#n-$tT+U7mX6t zYTVUPtJf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} zr9T*=wqB)hB2BG&jlXLHgWQL<7cg%7)Qn~0$D;(W#&9ah?e|`P z!LlJ>56q4vy1T}wctKzw7N^1ZHeMJ8hEfUID3s`*@+M_7yXfNO%k=JRhp4exrpoFK zYF5g0Y%$Ms0gTV(uk#u*2lKHWP+VW9;*DimTrQa&fPeAK=oqDvgLH0Tk&PBgMIO9+ zEJIh8`ilb*!z&+u@R{ulZ1@_6;UP8%0su<11zJ#}J-f%4Og?I!B|rY+3Hv}Gl}NH7 zConnS57JL7IXYWjqu;eI{bm^7>=72UJ1s8Z1$ay#q+kt@1RA|VrB0L({1=G#5H64dbmQIL+}AaM-+zDOur)@7Q^=fJBBCT@P!YG`W+W%Pgk2eCfe) p+Ze%JNylCfnmav8j-EQ>`xn}rYJSE)-JSpd002ovPDHLkV1j!{d1U|q diff --git a/src/main/resources/assets/create/textures/gui/schematicannon.png b/src/main/resources/assets/create/textures/gui/schematicannon.png index 8a54fcfdf6fd2c565542be7e170e5f16d6a5913a..cb838679c815ea20f8dff3b09b71d1d340a2452f 100644 GIT binary patch literal 13735 zcmd6OWmuHk-uDa*QZgVNDk(@v=YWdHrbI+QfuSS>0ZGXjLXbvLLShtDK#=Yn8l<}$ zrMqF6dGA5@KKqf*lFfBo05)|!xenkp1zOk^Msh(h)5?fW1Q71JwP`D7vpEGkXW}B;AC=Ee%N=|n?qqe&-Z0Jl;nkWoj86DOHJcI=l#{z8rFAk_10<-7B!i+NmsZSBiBS;}lFZ=)!NZEz z6SE|i&GS<>C_5wDX^R|f&nmFTq7%Mb&F*Psr2-gNjufyREyKnj%AHQQa!%!I(l=`k z{%coxVB*9VzNiQe^%vqbNO9{h@L@hV(1?KT$e;8SzN6q!9$6XE?Uj6L5=WPr=2OH^ z6JsRqshlJ%|0Z7aRA!#sozSW6alqVksRMG{?Up)-SxJ0pQeRT}{vfE*kfF#%z4|-v zUDn>Nb}n64z4sdSQ0^~eU)uPZ9c6@HPA_qn*fbL44ZWRBAueV90infe#-i6QQJ@N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7>|m}6H51h;9+m*wO$!@cDG1;5kN4QSF% zpG0zkW2ZzzYPjt3w)-jW5`E6@okNqshXv2P(x??Y35fT@(Dy$B&;+0;@c8d_4m-V$ z5)BN1DWD{N0juvb!%>U-&z$25sqTXmA zGjZJQWTskGor{>Jsdt45#-Z40Vcqf#bLdjH$e! zRH6SaiYl*NIbXJZh ohbmIcm>Uq9=xr&P@V@|j0%@0%k0O|hYP7Eb3c=UsiO(y?8GubF>EnPRNqnhMCM>xX&!hC^v>y z%P%LWmGfC3ZlrglwWcIVC@$vvZr@#;Gr+;e;S-N?%VDxT>3`(LnfS1QWJ%MM4~R*# z)wU?x6lMGPRRmi=pAg5fE_Y5<0I34^7c@Wyi1XaAnN-0hMGR}K?n-tD#=2T>Grj12~(vHjg{=y1qguzuU%Z{Wv-N`opO1W54t z{-&IPlw5_h11uoM?4EMy0fqQjydH(}{9$kjIDgU*{Q;1AvA>VX*I)nu002ovPDHLk FV1i?ilso_c diff --git a/src/main/resources/data/create/advancements/copper_casing.json b/src/main/resources/data/create/advancements/copper_casing.json new file mode 100644 index 000000000..bbe9ce860 --- /dev/null +++ b/src/main/resources/data/create/advancements/copper_casing.json @@ -0,0 +1,35 @@ +{ + "parent": "create:press", + "display": { + "icon": { + "item": "create:copper_casing" + }, + "title": { + "translate": "advancement.create.copper_casing" + }, + "description": { + "translate": "advancement.create.copper_casing.desc" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:copper_casing" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/copper_end.json b/src/main/resources/data/create/advancements/copper_end.json new file mode 100644 index 000000000..26aadef85 --- /dev/null +++ b/src/main/resources/data/create/advancements/copper_end.json @@ -0,0 +1,35 @@ +{ + "parent": "create:copper_casing", + "display": { + "icon": { + "item": "minecraft:oak_sapling" + }, + "title": { + "translate": "advancement.create.eob" + }, + "description": { + "translate": "advancement.create.eob.desc" + }, + "frame": "challenge", + "show_toast": false, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:copper_casing" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/deforester.json b/src/main/resources/data/create/advancements/deforester.json new file mode 100644 index 000000000..55f8d4606 --- /dev/null +++ b/src/main/resources/data/create/advancements/deforester.json @@ -0,0 +1,35 @@ +{ + "parent": "create:refined_radiance", + "display": { + "icon": { + "item": "create:deforester" + }, + "title": { + "translate": "advancement.create.deforester" + }, + "description": { + "translate": "advancement.create.deforester.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:deforester" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/fist_bump.json b/src/main/resources/data/create/advancements/fist_bump.json index 8bd15daf2..0e5b04869 100644 --- a/src/main/resources/data/create/advancements/fist_bump.json +++ b/src/main/resources/data/create/advancements/fist_bump.json @@ -2,7 +2,7 @@ "parent": "create:deployer", "display": { "icon": { - "item": "create:large_cogwheel" + "item": "create:deployer" }, "title": { "translate": "advancement.create.fist_bump" diff --git a/src/main/resources/data/create/advancements/shadow_end.json b/src/main/resources/data/create/advancements/shadow_end.json new file mode 100644 index 000000000..0926bf69f --- /dev/null +++ b/src/main/resources/data/create/advancements/shadow_end.json @@ -0,0 +1,35 @@ +{ + "parent": "create:shadow_steel", + "display": { + "icon": { + "item": "minecraft:oak_sapling" + }, + "title": { + "translate": "advancement.create.eob" + }, + "description": { + "translate": "advancement.create.eob.desc" + }, + "frame": "challenge", + "show_toast": false, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:shadow_steel" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/symmetry_wand.json b/src/main/resources/data/create/advancements/symmetry_wand.json new file mode 100644 index 000000000..4a8ace7f4 --- /dev/null +++ b/src/main/resources/data/create/advancements/symmetry_wand.json @@ -0,0 +1,35 @@ +{ + "parent": "create:refined_radiance", + "display": { + "icon": { + "item": "create:symmetry_wand" + }, + "title": { + "translate": "advancement.create.symmetry_wand" + }, + "description": { + "translate": "advancement.create.symmetry_wand.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:symmetry_wand" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/upgraded_zapper.json b/src/main/resources/data/create/advancements/upgraded_zapper.json new file mode 100644 index 000000000..283a70ea8 --- /dev/null +++ b/src/main/resources/data/create/advancements/upgraded_zapper.json @@ -0,0 +1,29 @@ +{ + "parent": "create:zapper", + "display": { + "icon": { + "item": "create:placement_handgun", + "nbt": "{Retriever:\"Chromatic\",Scope:\"Chromatic\",Amplifier:\"Chromatic\",Body:\"Chromatic\",Accelerator:\"Chromatic\"}" + }, + "title": { + "translate": "advancement.create.upgraded_zapper" + }, + "description": { + "translate": "advancement.create.upgraded_zapper.desc" + }, + "frame": "challenge", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "create:upgraded_zapper" + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/water_wheel.json b/src/main/resources/data/create/advancements/water_wheel.json index 677d41082..e5f32c139 100644 --- a/src/main/resources/data/create/advancements/water_wheel.json +++ b/src/main/resources/data/create/advancements/water_wheel.json @@ -17,12 +17,21 @@ }, "criteria": { "0": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "create:water_wheel" + } + }, + "1": { "trigger": "create:water_wheel" } }, "requirements": [ [ "0" + ], + [ + "1" ] ] } \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/zapper.json b/src/main/resources/data/create/advancements/zapper.json new file mode 100644 index 000000000..8fd2c563c --- /dev/null +++ b/src/main/resources/data/create/advancements/zapper.json @@ -0,0 +1,35 @@ +{ + "parent": "create:refined_radiance", + "display": { + "icon": { + "item": "create:placement_handgun" + }, + "title": { + "translate": "advancement.create.zapper" + }, + "description": { + "translate": "advancement.create.zapper.desc" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": false, + "hidden": false + }, + "criteria": { + "0": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:placement_handgun" + } + ] + } + } + }, + "requirements": [ + [ + "0" + ] + ] +} \ No newline at end of file From 4cbf424f4d6eaa84cc45ca55856e71926aa496d5 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 9 May 2020 00:09:10 +0200 Subject: [PATCH 09/13] The Bugs win - Condensed mechanical crafting into one JEI page category, scaling down slots if necessary - Fixed ploughs trying to break water blocks - Fixed stationary contraptions getting nudged around by expiring farmland blocks - Shulker boxes can now be used as portable storage on contraptions - Added vertical rotation support to buttons, levers - Fixed certain directional blocks flipping around inconsistently when contraptions rotate by 180 degress - Random safety checks - Vertical belts no longer pop when rotated horizontally - Fixed inconsistent funnel activation when items are inserted on the same segment - Fixed adjustable pulley popping off due to floating point precision issues - Fixed toggle latch acting strangely with input signals - Schematicannons can now place belts safely - Removed invalid Schematic item from creative tab --- .../simibubi/create/compat/jei/CreateJEI.java | 78 ++++---- .../category/MechanicalCraftingCategory.java | 164 ++++++++++++---- .../category/animations/AnimatedCrafter.java | 30 +-- .../create/data/CreateAdvancements.java | 5 - .../contraptions/RotationPropagator.java | 3 +- .../actors/PloughMovementBehaviour.java | 8 +- .../contraptions/ContraptionEntity.java | 30 ++- .../contraptions/MountedStorage.java | 3 + .../contraptions/StructureTransform.java | 182 +++++++++++------- .../deployer/DeployerTileEntity.java | 15 +- .../contraptions/relays/belt/BeltBlock.java | 38 +++- .../relays/belt/BeltTileEntity.java | 8 +- .../relays/belt/item/BeltConnectorItem.java | 22 ++- .../relays/belt/transport/BeltInventory.java | 50 ++--- .../encased/AdjustablePulleyTileEntity.java | 2 + .../block/StockswitchTileEntity.java | 4 +- .../logistics/block/diodes/LatchBlock.java | 32 +-- .../inventories/FlexcrateTileEntity.java | 4 +- .../schematics/block/LaunchedItem.java | 62 +++++- .../block/SchematicannonTileEntity.java | 53 ++++- .../schematics/item/SchematicItem.java | 5 + .../create/advancements/expert_lane_1.json | 35 ---- 22 files changed, 546 insertions(+), 287 deletions(-) delete mode 100644 src/main/resources/data/create/advancements/expert_lane_1.json diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index ff99bd785..118c775ed 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -24,7 +24,6 @@ import com.simibubi.create.compat.jei.category.SawingCategory; import com.simibubi.create.compat.jei.category.SmokingViaFanCategory; import com.simibubi.create.compat.jei.category.SplashingCategory; import com.simibubi.create.foundation.utility.Lang; -import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCraftingRecipe; import com.simibubi.create.modules.contraptions.components.mixer.MixingRecipe; import com.simibubi.create.modules.contraptions.components.press.MechanicalPressTileEntity; import com.simibubi.create.modules.logistics.block.inventories.FlexcrateScreen; @@ -66,8 +65,7 @@ public class CreateJEI implements IModPlugin { private PackingCategory packingCategory; private PolishingCategory polishingCategory; private MysteriousItemConversionCategory mysteryConversionCategory; - private MechanicalCraftingCategory smallMechanicalCraftingCategory; - private MechanicalCraftingCategory largeMechanicalCraftingCategory; + private MechanicalCraftingCategory mechanicalCraftingCategory; @Override public ResourceLocation getPluginUid() { @@ -88,8 +86,7 @@ public class CreateJEI implements IModPlugin { packingCategory = new PackingCategory(); polishingCategory = new PolishingCategory(); mysteryConversionCategory = new MysteriousItemConversionCategory(); - smallMechanicalCraftingCategory = new MechanicalCraftingCategory(false); - largeMechanicalCraftingCategory = new MechanicalCraftingCategory(true); + mechanicalCraftingCategory = new MechanicalCraftingCategory(); } @Override @@ -99,10 +96,11 @@ public class CreateJEI implements IModPlugin { @Override public void registerCategories(IRecipeCategoryRegistration registration) { - registration.addRecipeCategories(millingCategory, crushingCategory, splashingCategory, pressingCategory, - smokingCategory, blastingCategory, blockzapperCategory, mixingCategory, sawingCategory, - blockCuttingCategory, packingCategory, polishingCategory, mysteryConversionCategory, - smallMechanicalCraftingCategory, largeMechanicalCraftingCategory); + registration + .addRecipeCategories(millingCategory, crushingCategory, splashingCategory, pressingCategory, + smokingCategory, blastingCategory, blockzapperCategory, mixingCategory, sawingCategory, + blockCuttingCategory, packingCategory, polishingCategory, mysteryConversionCategory, + mechanicalCraftingCategory); } @Override @@ -132,33 +130,28 @@ public class CreateJEI implements IModPlugin { packingCategory.getUid()); registration.addRecipes(findRecipes(AllRecipes.SANDPAPER_POLISHING), polishingCategory.getUid()); registration.addRecipes(MysteriousItemConversionCategory.getRecipes(), mysteryConversionCategory.getUid()); - - registration.addRecipes(findRecipes( - r -> (r instanceof MechanicalCraftingRecipe) && MechanicalCraftingCategory.isSmall((ShapedRecipe) r)), - smallMechanicalCraftingCategory.getUid()); - registration.addRecipes( - findRecipes( - r -> (r.getType() == IRecipeType.CRAFTING || r.getType() == AllRecipes.MECHANICAL_CRAFTING.type) - && (r instanceof ShapedRecipe) && !(r instanceof MechanicalCraftingRecipe) - && MechanicalCraftingCategory.isSmall((ShapedRecipe) r)), - smallMechanicalCraftingCategory.getUid()); - registration.addRecipes(findRecipes( - r -> (r.getType() == IRecipeType.CRAFTING || r.getType() == AllRecipes.MECHANICAL_CRAFTING.type) - && (r instanceof ShapedRecipe) && !MechanicalCraftingCategory.isSmall((ShapedRecipe) r)), - largeMechanicalCraftingCategory.getUid()); - + registration.addRecipes(findRecipes(r -> (r.getType() == AllRecipes.MECHANICAL_CRAFTING.type)), + mechanicalCraftingCategory.getUid()); + registration.addRecipes(findRecipes(r -> (r.getType() == IRecipeType.CRAFTING + && r.getType() != AllRecipes.MECHANICAL_CRAFTING.type) && (r instanceof ShapedRecipe)), + mechanicalCraftingCategory.getUid()); } @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { ItemStack fan = new ItemStack(AllBlocks.ENCASED_FAN.get()); - ItemStack splashingFan = fan.copy() + ItemStack splashingFan = fan + .copy() .setDisplayName(new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.splashing.fan"))); - ItemStack smokingFan = fan.copy().setDisplayName( - new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.smokingViaFan.fan"))); - ItemStack blastingFan = fan.copy().setDisplayName( - new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.blastingViaFan.fan"))); + ItemStack smokingFan = fan + .copy() + .setDisplayName( + new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.smokingViaFan.fan"))); + ItemStack blastingFan = fan + .copy() + .setDisplayName( + new StringTextComponent(TextFormatting.RESET + Lang.translate("recipe.blastingViaFan.fan"))); registration.addRecipeCatalyst(new ItemStack(AllBlocks.MILLSTONE.get()), millingCategory.getUid()); registration.addRecipeCatalyst(new ItemStack(AllBlocks.CRUSHING_WHEEL.get()), crushingCategory.getUid()); @@ -176,10 +169,9 @@ public class CreateJEI implements IModPlugin { registration.addRecipeCatalyst(new ItemStack(AllBlocks.BASIN.get()), packingCategory.getUid()); registration.addRecipeCatalyst(AllItems.SAND_PAPER.asStack(), polishingCategory.getUid()); registration.addRecipeCatalyst(AllItems.RED_SAND_PAPER.asStack(), polishingCategory.getUid()); - registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), - smallMechanicalCraftingCategory.getUid()); - registration.addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), - largeMechanicalCraftingCategory.getUid()); + registration + .addRecipeCatalyst(new ItemStack(AllBlocks.MECHANICAL_CRAFTER.get()), + mechanicalCraftingCategory.getUid()); } @Override @@ -193,18 +185,30 @@ public class CreateJEI implements IModPlugin { } private static List> findRecipes(Predicate> pred) { - return Minecraft.getInstance().world.getRecipeManager().getRecipes().stream().filter(pred) + return Minecraft.getInstance().world + .getRecipeManager() + .getRecipes() + .stream() + .filter(pred) .collect(Collectors.toList()); } private static List> findRecipesByType(IRecipeType type) { - return Minecraft.getInstance().world.getRecipeManager().getRecipes().stream().filter(r -> r.getType() == type) + return Minecraft.getInstance().world + .getRecipeManager() + .getRecipes() + .stream() + .filter(r -> r.getType() == type) .collect(Collectors.toList()); } private static List> findRecipesById(ResourceLocation id) { - return Minecraft.getInstance().world.getRecipeManager().getRecipes().stream() - .filter(r -> r.getSerializer().getRegistryName().equals(id)).collect(Collectors.toList()); + return Minecraft.getInstance().world + .getRecipeManager() + .getRecipes() + .stream() + .filter(r -> r.getSerializer().getRegistryName().equals(id)) + .collect(Collectors.toList()); } private static List> findRecipesByTypeExcluding(IRecipeType type, IRecipeType excludingType) { diff --git a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java index 9d6406833..7cc21a0ea 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java @@ -1,39 +1,103 @@ package com.simibubi.create.compat.jei.category; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import com.mojang.blaze3d.platform.GlStateManager; import com.simibubi.create.AllBlocks; import com.simibubi.create.ScreenResources; import com.simibubi.create.compat.jei.category.animations.AnimatedCrafter; -import com.simibubi.create.foundation.utility.Lang; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; +import mezz.jei.api.ingredients.IIngredientRenderer; import mezz.jei.api.ingredients.IIngredients; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Rarity; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.ShapedRecipe; import net.minecraft.util.NonNullList; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; public class MechanicalCraftingCategory extends CreateRecipeCategory { - private AnimatedCrafter crafter; - private boolean large; + private final class CrafterIngredientRenderer implements IIngredientRenderer { - public MechanicalCraftingCategory(boolean large) { - super("mechanical_crafting" + (large ? "_large" : ""), itemIcon(AllBlocks.MECHANICAL_CRAFTER.get()), - emptyBackground(large ? 177 : 177, large ? 235 : 81)); - this.large = large; - crafter = new AnimatedCrafter(large); + private ShapedRecipe recipe; + + public CrafterIngredientRenderer(ShapedRecipe recipe) { + this.recipe = recipe; + } + + @Override + public void render(int xPosition, int yPosition, ItemStack ingredient) { + GlStateManager.pushMatrix(); + GlStateManager.translated(xPosition, yPosition, 0); + float scale = getScale(recipe); + GlStateManager.scaled(scale, scale, scale); + + if (ingredient != null) { + GlStateManager.enableDepthTest(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft minecraft = Minecraft.getInstance(); + FontRenderer font = getFontRenderer(minecraft, ingredient); + ItemRenderer itemRenderer = minecraft.getItemRenderer(); + itemRenderer.renderItemAndEffectIntoGUI(null, ingredient, 0, 0); + itemRenderer.renderItemOverlayIntoGUI(font, ingredient, 0, 0, null); + GlStateManager.disableBlend(); + RenderHelper.disableStandardItemLighting(); + } + GlStateManager.popMatrix(); + } + + @Override + public List getTooltip(ItemStack ingredient, ITooltipFlag tooltipFlag) { + Minecraft minecraft = Minecraft.getInstance(); + PlayerEntity player = minecraft.player; + List list; + try { + list = ingredient + .getTooltip(player, tooltipFlag) + .stream() + .map(ITextComponent::getFormattedText) + .collect(Collectors.toList()); + } catch (RuntimeException | LinkageError e) { + return new ArrayList<>(); + } + + Rarity rarity; + try { + rarity = ingredient.getRarity(); + } catch (RuntimeException | LinkageError e) { + rarity = Rarity.COMMON; + } + + for (int k = 0; k < list.size(); ++k) { + if (k == 0) { + list.set(k, rarity.color + list.get(k)); + } else { + list.set(k, TextFormatting.GRAY + list.get(k)); + } + } + + return list; + } } - public static boolean isSmall(ShapedRecipe recipe) { - return Math.max((recipe).getWidth(), (recipe).getHeight()) <= 4; - } + private AnimatedCrafter crafter = new AnimatedCrafter(); - @Override - public String getTitle() { - return Lang.translate("recipe.mechanical_crafting"); + public MechanicalCraftingCategory() { + super("mechanical_crafting", itemIcon(AllBlocks.MECHANICAL_CRAFTER.get()), emptyBackground(177, 107)); } @Override @@ -47,45 +111,79 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory recipeIngredients = recipe.getIngredients(); - itemStacks.init(0, false, large ? 136 : 141, large ? 196 : 50); + itemStacks.init(0, false, 133, 80); itemStacks.set(0, recipe.getRecipeOutput().getStack()); - int x = getGridX(recipe); - int y = getGridY(recipe); + int x = getXPadding(recipe); + int y = getYPadding(recipe); + float scale = getScale(recipe); int size = recipeIngredients.size(); + IIngredientRenderer renderer = new CrafterIngredientRenderer(recipe); + for (int i = 0; i < size; i++) { - itemStacks.init(i + 1, true, x + (i % recipe.getWidth()) * 19, y + (i / recipe.getWidth()) * 19); + float f = 19 * scale; + int slotSize = (int) (16 * scale); + int xPosition = (int) (x + 1 + (i % recipe.getWidth()) * f); + int yPosition = (int) (y + 1 + (i / recipe.getWidth()) * f); + itemStacks.init(i + 1, true, renderer, xPosition, yPosition, slotSize, slotSize, 0, 0); itemStacks.set(i + 1, Arrays.asList(recipeIngredients.get(i).getMatchingStacks())); } } - public int getGridY(ShapedRecipe recipe) { - return 3 + (int) (((large ? 9 : 4) - recipe.getRecipeHeight()) * 19 / 2f); + static int maxSize = 100; + + public static float getScale(ShapedRecipe recipe) { + int w = recipe.getWidth(); + int h = recipe.getHeight(); + return Math.min(1, maxSize / (19f * Math.max(w, h))); } - public int getGridX(ShapedRecipe recipe) { - return 3 + (int) (((large ? 9 : 4) - recipe.getRecipeWidth()) * 19 / 2f); + public static int getYPadding(ShapedRecipe recipe) { + return 3 + 50 - (int) (getScale(recipe) * recipe.getHeight() * 19 * .5); + } + + public static int getXPadding(ShapedRecipe recipe) { + return 3 + 50 - (int) (getScale(recipe) * recipe.getWidth() * 19 * .5); } @Override public void draw(ShapedRecipe recipe, double mouseX, double mouseY) { - int x = getGridX(recipe); - int y = getGridY(recipe); + GlStateManager.pushMatrix(); + float scale = getScale(recipe); + GlStateManager.translated(getXPadding(recipe), getYPadding(recipe), 0); for (int row = 0; row < recipe.getHeight(); row++) for (int col = 0; col < recipe.getWidth(); col++) - if (!recipe.getIngredients().get(row * recipe.getWidth() + col).hasNoMatchingItems()) - ScreenResources.JEI_SLOT.draw(x + col * 19, y + row * 19); + if (!recipe.getIngredients().get(row * recipe.getWidth() + col).hasNoMatchingItems()) { + GlStateManager.pushMatrix(); + GlStateManager.translated((int) col * 19 * scale, (int) row * 19 * scale, 0); + GlStateManager.scaled(scale, scale, scale); + ScreenResources.JEI_SLOT.draw(0, 0); + GlStateManager.popMatrix(); + } - ScreenResources.JEI_SLOT.draw(large ? 136 : 141, large ? 196 : 50); - if (large) - ScreenResources.JEI_ARROW.draw(86, 200); - else - ScreenResources.JEI_DOWN_ARROW.draw(136, 32); + GlStateManager.popMatrix(); - ScreenResources.JEI_SHADOW.draw(large ? 20 : 84, large ? 223 : 68); - crafter.draw(large ? 105 : 185, large ? 189 : -1); + ScreenResources.JEI_SLOT.draw(133, 80); + ScreenResources.JEI_DOWN_ARROW.draw(128, 59); + ScreenResources.JEI_SHADOW.draw(116, 36); + crafter.draw(219, 8); + + GlStateManager.pushMatrix(); + GlStateManager.translated(0, 0, 200); + + RenderHelper.disableStandardItemLighting(); + int amount = 0; + for (Ingredient ingredient : recipe.getIngredients()) { + if (Ingredient.EMPTY == ingredient) + continue; + amount++; + } + Minecraft.getInstance().fontRenderer + .drawStringWithShadow(amount + "", 142, 39, 0xFFFFFF); + RenderHelper.enableStandardItemLighting(); + GlStateManager.popMatrix(); } @Override diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java index 89fd71bf6..a82103447 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java @@ -12,12 +12,6 @@ import net.minecraft.util.Direction; public class AnimatedCrafter extends AnimatedKinetics { - boolean four; - - public AnimatedCrafter(boolean four) { - this.four = four; - } - @Override public int getWidth() { return 50; @@ -40,23 +34,7 @@ public class AnimatedCrafter extends AnimatedKinetics { ScreenElementRenderer.renderModel(() -> cogwheel(true)); ScreenElementRenderer.renderBlock(this::body); - GlStateManager.translatef(0, 50, 0); - ScreenElementRenderer.renderModel(() -> cogwheel(false)); - ScreenElementRenderer.renderBlock(this::body); - - if (four) { - GlStateManager.translatef(50, -50, 0); - ScreenElementRenderer.renderModel(() -> cogwheel(false)); - ScreenElementRenderer.renderBlock(this::body); - GlStateManager.translatef(0, 50, 0); - ScreenElementRenderer.renderModel(() -> cogwheel(true)); - ScreenElementRenderer.renderBlock(this::body); - - } else { - GlStateManager.translatef(0, 50, 0); - ScreenElementRenderer.renderModel(() -> cogwheel(true)); - ScreenElementRenderer.renderBlock(this::body); - } + GlStateManager.translatef(50, 0, 0); GlStateManager.popMatrix(); } @@ -71,8 +49,10 @@ public class AnimatedCrafter extends AnimatedKinetics { } private BlockState body() { - return AllBlocks.MECHANICAL_CRAFTER.get().getDefaultState().with(MechanicalCrafterBlock.HORIZONTAL_FACING, - Direction.WEST); + return AllBlocks.MECHANICAL_CRAFTER + .get() + .getDefaultState() + .with(MechanicalCrafterBlock.HORIZONTAL_FACING, Direction.WEST); } } diff --git a/src/main/java/com/simibubi/create/data/CreateAdvancements.java b/src/main/java/com/simibubi/create/data/CreateAdvancements.java index 4c1599ffd..41efa9741 100644 --- a/src/main/java/com/simibubi/create/data/CreateAdvancements.java +++ b/src/main/java/com/simibubi/create/data/CreateAdvancements.java @@ -251,11 +251,6 @@ public class CreateAdvancements implements IDataProvider { private void andesiteExpertLane(Consumer t, Advancement root) { String id = Create.ID; - - Advancement expert_lane_1 = advancement("expert_lane_1", Blocks.ANDESITE, TaskType.SILENT_GATE) - .withParent(root) - .withCriterion("0", itemGathered(AllBlocks.ANDESITE_CASING.get())) - .register(t, id + ":expert_lane_1"); } // Datagen diff --git a/src/main/java/com/simibubi/create/modules/contraptions/RotationPropagator.java b/src/main/java/com/simibubi/create/modules/contraptions/RotationPropagator.java index 55f24ce90..a3eab379b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/RotationPropagator.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/RotationPropagator.java @@ -248,7 +248,8 @@ public class RotationPropagator { // Do not overpower you own network -> cycle if (!currentTE.hasNetwork() || currentTE.network.equals(neighbourTE.network)) { - if (Math.abs(newSpeed) > Math.abs(speedOfNeighbour)) + float epsilon = Math.abs(speedOfNeighbour) / 256f / 256f; + if (Math.abs(newSpeed) > Math.abs(speedOfNeighbour) + epsilon) world.destroyBlock(pos, true); continue; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/PloughMovementBehaviour.java b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/PloughMovementBehaviour.java index 12fd4ea93..81fd2b07d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/PloughMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/PloughMovementBehaviour.java @@ -7,6 +7,7 @@ import com.simibubi.create.modules.contraptions.components.actors.PloughBlock.Pl import com.simibubi.create.modules.contraptions.components.contraptions.MovementContext; import net.minecraft.block.BlockState; +import net.minecraft.block.FlowingFluidBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.item.Items; @@ -25,8 +26,8 @@ public class PloughMovementBehaviour extends BlockBreakingMovementBehaviour { @Override public boolean isActive(MovementContext context) { - return !VecHelper.isVecPointingTowards(context.relativeMotion, - context.state.get(HORIZONTAL_FACING).getOpposite()); + return !VecHelper + .isVecPointingTowards(context.relativeMotion, context.state.get(HORIZONTAL_FACING).getOpposite()); } @Override @@ -66,7 +67,8 @@ public class PloughMovementBehaviour extends BlockBreakingMovementBehaviour { @Override public boolean canBreak(World world, BlockPos breakingPos, BlockState state) { - return state.getCollisionShape(world, breakingPos).isEmpty(); + return state.getCollisionShape(world, breakingPos).isEmpty() + && !(state.getBlock() instanceof FlowingFluidBlock); } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionEntity.java index 2cb92b8c7..56c7623f6 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionEntity.java @@ -298,11 +298,14 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD BearingContraption bc = (BearingContraption) getContraption(); Direction facing = bc.getFacing(); Vec3d activeAreaOffset = actor.getActiveAreaOffset(context); - if (activeAreaOffset.mul(VecHelper.planeByNormal(new Vec3d(facing.getDirectionVec()))) + if (activeAreaOffset + .mul(VecHelper.planeByNormal(new Vec3d(facing.getDirectionVec()))) .equals(Vec3d.ZERO)) { if (VecHelper.onSameAxis(blockInfo.pos, BlockPos.ZERO, facing.getAxis())) { - context.motion = new Vec3d(facing.getDirectionVec()).scale( - facing.getAxis().getCoordinate(roll - prevRoll, yaw - prevYaw, pitch - prevPitch)); + context.motion = new Vec3d(facing.getDirectionVec()) + .scale(facing + .getAxis() + .getCoordinate(roll - prevRoll, yaw - prevYaw, pitch - prevPitch)); context.relativeMotion = context.motion; int timer = context.data.getInt("StationaryTimer"); if (timer > 0) { @@ -333,8 +336,9 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD setMotion(Vec3d.ZERO); if (getController() != null) getController().onStall(); - AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), - new ContraptionStallPacket(getEntityId(), posX, posY, posZ, yaw, pitch, roll)); + AllPackets.channel + .send(PacketDistributor.TRACKING_ENTITY.with(() -> this), + new ContraptionStallPacket(getEntityId(), posX, posY, posZ, yaw, pitch, roll)); } dataManager.set(STALLED, contraption.stalled); } else { @@ -463,8 +467,9 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (contraption != null) compound.put("Contraption", contraption.writeNBT()); if (!stationary && motionBeforeStall != null) - compound.put("CachedMotion", - newDoubleNBTList(motionBeforeStall.x, motionBeforeStall.y, motionBeforeStall.z)); + compound + .put("CachedMotion", + newDoubleNBTList(motionBeforeStall.x, motionBeforeStall.y, motionBeforeStall.z)); if (controllerPos != null) compound.put("Controller", NBTUtil.writeBlockPos(controllerPos)); if (forcedAngle != -1) @@ -542,8 +547,9 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD } if (horizontalMag(vec3d1) > horizontalMag(vec3d)) { - vec3d = vec3d1.add(collideBoundingBoxHeuristically(e, new Vec3d(0.0D, -vec3d1.y + vec.y, 0.0D), - axisalignedbb.offset(vec3d1), e.world, iselectioncontext, reuseablestream)); + vec3d = vec3d1 + .add(collideBoundingBoxHeuristically(e, new Vec3d(0.0D, -vec3d1.y + vec.y, 0.0D), + axisalignedbb.offset(vec3d1), e.world, iselectioncontext, reuseablestream)); } } @@ -593,6 +599,12 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD // Make sure nothing can move contraptions out of the way public void setMotion(Vec3d motionIn) {} + @Override + public void setPositionAndUpdate(double x, double y, double z) { + if (!stationary) + super.setPositionAndUpdate(x, y, z); + } + @Override public PushReaction getPushReaction() { return PushReaction.IGNORE; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/MountedStorage.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/MountedStorage.java index e2056fba1..3a1eccd0f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/MountedStorage.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/MountedStorage.java @@ -9,6 +9,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.ChestType; import net.minecraft.tileentity.BarrelTileEntity; import net.minecraft.tileentity.ChestTileEntity; +import net.minecraft.tileentity.ShulkerBoxTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.items.CapabilityItemHandler; @@ -107,6 +108,8 @@ public class MountedStorage { TileEntityType type = te.getType(); if (type == AllTileEntities.FLEXCRATE.type) return true; + if (te instanceof ShulkerBoxTileEntity) + return true; if (te instanceof ChestTileEntity) return true; if (te instanceof BarrelTileEntity) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java index 3277964a8..1b3109e36 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/StructureTransform.java @@ -1,7 +1,9 @@ package com.simibubi.create.modules.contraptions.components.contraptions; +import static net.minecraft.block.HorizontalFaceBlock.FACE; import static net.minecraft.state.properties.BlockStateProperties.AXIS; import static net.minecraft.state.properties.BlockStateProperties.FACING; +import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.utility.VecHelper; @@ -10,10 +12,13 @@ import com.simibubi.create.modules.contraptions.components.contraptions.chassis. import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.HorizontalFaceBlock; import net.minecraft.block.SlabBlock; import net.minecraft.block.StairsBlock; import net.minecraft.state.BooleanProperty; +import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.Half; import net.minecraft.state.properties.SlabType; import net.minecraft.util.Direction; @@ -73,90 +78,133 @@ public class StructureTransform { * horizontal axes */ public BlockState apply(BlockState state) { - if (rotationAxis == Axis.Y) - state = state.rotate(rotation); - else { - if (state.getBlock() instanceof AbstractChassisBlock) - return rotateChassis(state); + return state.rotate(rotation); - if (state.getBlock() instanceof StairsBlock) { - if (state.get(StairsBlock.FACING).getAxis() != rotationAxis) { - for (int i = 0; i < rotation.ordinal(); i++) { - Direction direction = state.get(StairsBlock.FACING); - Half half = state.get(StairsBlock.HALF); - if (direction.getAxisDirection() == AxisDirection.POSITIVE ^ half == Half.BOTTOM - ^ direction.getAxis() == Axis.Z) - state = state.cycle(StairsBlock.HALF); - else - state = state.with(StairsBlock.FACING, direction.getOpposite()); - } - } else { - if (rotation == Rotation.CLOCKWISE_180) { - state = state.cycle(StairsBlock.HALF); - } - } + Block block = state.getBlock(); + + if (block instanceof AbstractChassisBlock) + return rotateChassis(state); + + if (block instanceof HorizontalFaceBlock) { + Direction stateFacing = state.get(HorizontalFaceBlock.HORIZONTAL_FACING); + AttachFace stateFace = state.get(FACE); + Direction forcedAxis = rotationAxis == Axis.Z ? Direction.EAST : Direction.SOUTH; + + if (stateFacing.getAxis() == rotationAxis && stateFace == AttachFace.WALL) return state; + + for (int i = 0; i < rotation.ordinal(); i++) { + stateFace = state.get(FACE); + stateFacing = state.get(HorizontalFaceBlock.HORIZONTAL_FACING); + + boolean b = state.get(FACE) == AttachFace.CEILING; + state = state.with(HORIZONTAL_FACING, b ? forcedAxis : forcedAxis.getOpposite()); + + if (stateFace != AttachFace.WALL) { + state = state.with(FACE, AttachFace.WALL); + continue; + } + + if (stateFacing.getAxisDirection() == AxisDirection.POSITIVE) { + state = state.with(FACE, AttachFace.FLOOR); + continue; + } + state = state.with(FACE, AttachFace.CEILING); } - if (AllBlocks.BELT.typeOf(state)) { - if (state.get(BeltBlock.HORIZONTAL_FACING).getAxis() != rotationAxis) { - for (int i = 0; i < rotation.ordinal(); i++) { - Slope slope = state.get(BeltBlock.SLOPE); - Direction direction = state.get(BeltBlock.HORIZONTAL_FACING); + return state; + } - // Rotate diagonal - if (slope != Slope.HORIZONTAL && slope != Slope.VERTICAL) { - if (direction.getAxisDirection() == AxisDirection.POSITIVE ^ slope == Slope.DOWNWARD - ^ direction.getAxis() == Axis.Z) { - state = - state.with(BeltBlock.SLOPE, slope == Slope.UPWARD ? Slope.DOWNWARD : Slope.UPWARD); - } else { - state = state.with(BeltBlock.HORIZONTAL_FACING, direction.getOpposite()); - } + if (block instanceof StairsBlock) { + if (state.get(StairsBlock.FACING).getAxis() != rotationAxis) { + for (int i = 0; i < rotation.ordinal(); i++) { + Direction direction = state.get(StairsBlock.FACING); + Half half = state.get(StairsBlock.HALF); + if (direction.getAxisDirection() == AxisDirection.POSITIVE ^ half == Half.BOTTOM + ^ direction.getAxis() == Axis.Z) + state = state.cycle(StairsBlock.HALF); + else + state = state.with(StairsBlock.FACING, direction.getOpposite()); + } + } else { + if (rotation == Rotation.CLOCKWISE_180) { + state = state.cycle(StairsBlock.HALF); + } + } + return state; + } - // Rotate horizontal/vertical + if (AllBlocks.BELT.typeOf(state)) { + if (state.get(BeltBlock.HORIZONTAL_FACING).getAxis() != rotationAxis) { + for (int i = 0; i < rotation.ordinal(); i++) { + Slope slope = state.get(BeltBlock.SLOPE); + Direction direction = state.get(BeltBlock.HORIZONTAL_FACING); + + // Rotate diagonal + if (slope != Slope.HORIZONTAL && slope != Slope.VERTICAL) { + if (direction.getAxisDirection() == AxisDirection.POSITIVE ^ slope == Slope.DOWNWARD + ^ direction.getAxis() == Axis.Z) { + state = state.with(BeltBlock.SLOPE, slope == Slope.UPWARD ? Slope.DOWNWARD : Slope.UPWARD); } else { - if (slope == Slope.HORIZONTAL ^ direction.getAxis() == Axis.Z) { - state = state.with(BeltBlock.HORIZONTAL_FACING, direction.getOpposite()); - } - state = state.with(BeltBlock.SLOPE, - slope == Slope.HORIZONTAL ? Slope.VERTICAL : Slope.HORIZONTAL); - } - } - } else { - if (rotation == Rotation.CLOCKWISE_180) { - Slope slope = state.get(BeltBlock.SLOPE); - Direction direction = state.get(BeltBlock.HORIZONTAL_FACING); - if (slope == Slope.UPWARD || slope == Slope.DOWNWARD) { - state = state.with(BeltBlock.SLOPE, slope == Slope.UPWARD ? Slope.DOWNWARD - : slope == Slope.DOWNWARD ? Slope.UPWARD : slope); - } else if (slope == Slope.VERTICAL) { state = state.with(BeltBlock.HORIZONTAL_FACING, direction.getOpposite()); } + + // Rotate horizontal/vertical + } else { + if (slope == Slope.HORIZONTAL ^ direction.getAxis() == Axis.Z) { + state = state.with(BeltBlock.HORIZONTAL_FACING, direction.getOpposite()); + } + state = + state.with(BeltBlock.SLOPE, slope == Slope.HORIZONTAL ? Slope.VERTICAL : Slope.HORIZONTAL); + } + } + } else { + if (rotation == Rotation.CLOCKWISE_180) { + Slope slope = state.get(BeltBlock.SLOPE); + Direction direction = state.get(BeltBlock.HORIZONTAL_FACING); + if (slope == Slope.UPWARD || slope == Slope.DOWNWARD) { + state = state + .with(BeltBlock.SLOPE, slope == Slope.UPWARD ? Slope.DOWNWARD + : slope == Slope.DOWNWARD ? Slope.UPWARD : slope); + } else if (slope == Slope.VERTICAL) { + state = state.with(BeltBlock.HORIZONTAL_FACING, direction.getOpposite()); } } - return state; } + return state; + } + + if (state.has(FACING)) { + Direction newFacing = transformFacing(state.get(FACING)); + if (state.has(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE)) { + if (rotationAxis == newFacing.getAxis() && rotation.ordinal() % 2 == 1) + state = state.cycle(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE); + } + state = state.with(FACING, newFacing); + + } else if (state.has(AXIS)) { + state = state.with(AXIS, transformAxis(state.get(AXIS))); + + } else if (rotation == Rotation.CLOCKWISE_180) { if (state.has(FACING)) { - Direction newFacing = transformFacing(state.get(FACING)); - if (state.has(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE)) { - if (rotationAxis == newFacing.getAxis() && rotation.ordinal() % 2 == 1) - state = state.cycle(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE); - } - state = state.with(FACING, newFacing); - - } else if (state.has(AXIS)) { - state = state.with(AXIS, transformAxis(state.get(AXIS))); - - } else if (rotation == Rotation.CLOCKWISE_180) { - state = state.rotate(rotation); - if (state.has(SlabBlock.TYPE) && state.get(SlabBlock.TYPE) != SlabType.DOUBLE) - state = state.with(SlabBlock.TYPE, - state.get(SlabBlock.TYPE) == SlabType.BOTTOM ? SlabType.TOP : SlabType.BOTTOM); + Direction stateFacing = state.get(FACING); + if (stateFacing.getAxis() == rotationAxis) + return state; } + if (state.has(HORIZONTAL_FACING)) { + Direction stateFacing = state.get(HORIZONTAL_FACING); + if (stateFacing.getAxis() == rotationAxis) + return state; + } + + state = state.rotate(rotation); + if (state.has(SlabBlock.TYPE) && state.get(SlabBlock.TYPE) != SlabType.DOUBLE) + state = state + .with(SlabBlock.TYPE, + state.get(SlabBlock.TYPE) == SlabType.BOTTOM ? SlabType.TOP : SlabType.BOTTOM); } return state; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java index 0087f8eda..58fe235c0 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java @@ -51,8 +51,11 @@ import net.minecraftforge.items.ItemHandlerHelper; public class DeployerTileEntity extends KineticTileEntity { - private static final List> EXTRACTING_LOCATIONS = Arrays.asList(Direction.values()) - .stream().map(d -> Pair.of(BlockPos.ZERO.offset(d), d.getOpposite())).collect(Collectors.toList()); + private static final List> EXTRACTING_LOCATIONS = Arrays + .asList(Direction.values()) + .stream() + .map(d -> Pair.of(BlockPos.ZERO.offset(d), d.getOpposite())) + .collect(Collectors.toList()); private FilteringBehaviour filtering; private ExtractingBehaviour extracting; @@ -373,8 +376,9 @@ public class DeployerTileEntity extends KineticTileEntity { reach = tag.getFloat("Reach"); if (tag.contains("Particle")) { ItemStack particleStack = ItemStack.read(tag.getCompound("Particle")); - SandPaperItem.spawnParticles(VecHelper.getCenterOf(pos).add(getMovementVector().scale(2f)), particleStack, - this.world); + SandPaperItem + .spawnParticles(VecHelper.getCenterOf(pos).add(getMovementVector().scale(2f)), particleStack, + this.world); } super.readClientUpdate(tag); @@ -402,7 +406,8 @@ public class DeployerTileEntity extends KineticTileEntity { @Override public void remove() { super.remove(); - invHandler.invalidate(); + if (invHandler != null) + invHandler.invalidate(); } public void changeMode() { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index 7c1ae4708..8f274e8f9 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -50,6 +50,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Hand; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; @@ -59,6 +60,7 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; +import net.minecraft.world.WorldType; import net.minecraft.world.storage.loot.LootParameters; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -342,10 +344,11 @@ public class BeltBlock extends HorizontalKineticBlock double d7 = d4 * d1 + x1; double d8 = d5 * d2 + y1; double d9 = d6 * d3 + z1; - manager.addEffect( - (new DiggingParticle(world, (double) pos.getX() + d7, (double) pos.getY() + d8, - (double) pos.getZ() + d9, d4 - 0.5D, d5 - 0.5D, d6 - 0.5D, state)) - .setBlockPos(pos)); + manager + .addEffect( + (new DiggingParticle(world, (double) pos.getX() + d7, (double) pos.getY() + d8, + (double) pos.getZ() + d9, d4 - 0.5D, d5 - 0.5D, d6 - 0.5D, state)) + .setBlockPos(pos)); } } } @@ -397,7 +400,7 @@ public class BeltBlock extends HorizontalKineticBlock } public static void initBelt(World world, BlockPos pos) { - if (world.isRemote) + if (world.isRemote || world.getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) return; BlockState state = world.getBlockState(pos); @@ -430,7 +433,9 @@ public class BeltBlock extends HorizontalKineticBlock for (BlockPos beltPos : beltChain) { TileEntity tileEntity = world.getTileEntity(beltPos); - if (tileEntity instanceof BeltTileEntity) { + BlockState currentState = world.getBlockState(beltPos); + + if (tileEntity instanceof BeltTileEntity && AllBlocks.BELT.typeOf(currentState)) { BeltTileEntity te = (BeltTileEntity) tileEntity; te.setController(currentPos); te.beltLength = beltChain.size(); @@ -439,7 +444,6 @@ public class BeltBlock extends HorizontalKineticBlock te.markDirty(); te.sendData(); - BlockState currentState = world.getBlockState(beltPos); boolean isVertical = currentState.get(BeltBlock.SLOPE) == Slope.VERTICAL; if (currentState.get(CASING) && isVertical) { @@ -540,10 +544,10 @@ public class BeltBlock extends HorizontalKineticBlock int limit = 1000; BlockPos current = controllerPos; while (limit-- > 0 && current != null) { - positions.add(current); BlockState state = world.getBlockState(current); if (!AllBlocks.BELT.typeOf(state)) break; + positions.add(current); current = nextSegmentPosition(state, current, true); } @@ -607,7 +611,7 @@ public class BeltBlock extends HorizontalKineticBlock public Class getTileEntityClass() { return BeltTileEntity.class; } - + @Override public ItemRequirement getRequiredItems(BlockState state) { List required = new ArrayList<>(); @@ -622,4 +626,20 @@ public class BeltBlock extends HorizontalKineticBlock return new ItemRequirement(ItemUseType.CONSUME, required); } + @Override + public BlockState rotate(BlockState state, Rotation rot) { + BlockState rotate = super.rotate(state, rot); + + if (state.get(SLOPE) != Slope.VERTICAL) + return rotate; + if (state.get(HORIZONTAL_FACING).getAxisDirection() != rotate.get(HORIZONTAL_FACING).getAxisDirection()) { + if (state.get(PART) == Part.START) + return rotate.with(PART, Part.END); + if (state.get(PART) == Part.END) + return rotate.with(PART, Part.START); + } + + return rotate; + } + } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java index 18b546483..6cc9fda13 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java @@ -73,6 +73,8 @@ public class BeltTileEntity extends KineticTileEntity { // Init belt if (beltLength == 0) BeltBlock.initBelt(world, pos); + if (!AllBlocks.BELT.typeOf(world.getBlockState(pos))) + return; // Initialize Belt Attachments if (world != null && trackerUpdateTag != null) { @@ -306,8 +308,8 @@ public class BeltTileEntity extends KineticTileEntity { public Direction getMovementFacing() { Axis axis = getBeltFacing().getAxis(); - return Direction.getFacingFromAxisDirection(axis, - getBeltMovementSpeed() < 0 ^ axis == Axis.X ? NEGATIVE : POSITIVE); + return Direction + .getFacingFromAxisDirection(axis, getBeltMovementSpeed() < 0 ^ axis == Axis.X ? NEGATIVE : POSITIVE); } protected Direction getBeltFacing() { @@ -344,7 +346,7 @@ public class BeltTileEntity extends KineticTileEntity { if (simulate) return true; - transportedStack.beltPosition = index + .5f - Math.signum(getSpeed()) / 16f; + transportedStack.beltPosition = index + .5f - Math.signum(getDirectionAwareBeltMovementSpeed()) / 16f; Direction movementFacing = getMovementFacing(); if (!side.getAxis().isVertical()) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java index 92f64ae5f..fd53a3ede 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/item/BeltConnectorItem.java @@ -92,15 +92,16 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther { return ActionResultType.SUCCESS; } - private void createBelts(World world, BlockPos start, BlockPos end) { + public static void createBelts(World world, BlockPos start, BlockPos end) { BeltBlock.Slope slope = getSlopeBetween(start, end); Direction facing = getFacingFromTo(start, end); BlockPos diff = end.subtract(start); if (diff.getX() == diff.getZ()) - facing = Direction.getFacingFromAxis(facing.getAxisDirection(), - world.getBlockState(start).get(BlockStateProperties.AXIS) == Axis.X ? Axis.Z : Axis.X); + facing = Direction + .getFacingFromAxis(facing.getAxisDirection(), + world.getBlockState(start).get(BlockStateProperties.AXIS) == Axis.X ? Axis.Z : Axis.X); List beltsToCreate = getBeltChainBetween(start, end, slope, facing); BlockState beltBlock = AllBlocks.BELT.get().getDefaultState(); @@ -110,12 +111,17 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther { boolean pulley = AllBlocks.SHAFT.typeOf(world.getBlockState(pos)); if (part == Part.MIDDLE && pulley) part = Part.PULLEY; - world.setBlockState(pos, beltBlock.with(BeltBlock.SLOPE, slope).with(BeltBlock.PART, part) - .with(BeltBlock.HORIZONTAL_FACING, facing), 3); + world + .setBlockState(pos, + beltBlock + .with(BeltBlock.SLOPE, slope) + .with(BeltBlock.PART, part) + .with(BeltBlock.HORIZONTAL_FACING, facing), + 3); } } - private Direction getFacingFromTo(BlockPos start, BlockPos end) { + private static Direction getFacingFromTo(BlockPos start, BlockPos end) { Axis beltAxis = start.getX() == end.getX() ? Axis.Z : Axis.X; BlockPos diff = end.subtract(start); AxisDirection axisDirection = AxisDirection.POSITIVE; @@ -129,7 +135,7 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther { return Direction.getFacingFromAxis(axisDirection, beltAxis); } - private Slope getSlopeBetween(BlockPos start, BlockPos end) { + private static Slope getSlopeBetween(BlockPos start, BlockPos end) { BlockPos diff = end.subtract(start); if (diff.getY() != 0) { @@ -140,7 +146,7 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther { return Slope.HORIZONTAL; } - private List getBeltChainBetween(BlockPos start, BlockPos end, Slope slope, Direction direction) { + private static List getBeltChainBetween(BlockPos start, BlockPos end, Slope slope, Direction direction) { List positions = new LinkedList<>(); int limit = 1000; BlockPos current = start; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/transport/BeltInventory.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/transport/BeltInventory.java index abf85f488..41196d14b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/transport/BeltInventory.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/transport/BeltInventory.java @@ -118,18 +118,18 @@ public class BeltInventory { float diffToEnd = beltMovementPositive ? belt.beltLength - currentPos : -currentPos; float limitedMovement = beltMovementPositive ? Math.min(movement, diffToEnd) : Math.max(movement, diffToEnd); - float nextOffset = current.beltPosition + limitedMovement; - if (!onClient) { + + if (!onClient && segmentBefore != -1) { // Don't move if belt attachments want to continue processing - if (segmentBefore != -1 && current.locked) { + if (current.locked) { BeltTileEntity beltSegment = BeltHelper.getBeltAtSegment(belt, segmentBefore); if (beltSegment != null) { - + // wait in case belt isnt initialized yet if (current.locked && beltSegment.trackerUpdateTag != null) continue; - + current.locked = false; List attachments = beltSegment.attachmentTracker.attachments; for (BeltAttachmentState attachmentState : attachments) { @@ -146,22 +146,24 @@ public class BeltInventory { } // See if any new belt processing catches the item - int upcomingSegment = (int) (current.beltPosition + (beltMovementPositive ? .5f : -.5f)); - for (int segment = upcomingSegment; beltMovementPositive ? segment + .5f <= nextOffset - : segment + .5f >= nextOffset; segment += beltMovementPositive ? 1 : -1) { - BeltTileEntity beltSegment = BeltHelper.getBeltAtSegment(belt, segmentBefore); - if (beltSegment == null) - break; - for (BeltAttachmentState attachmentState : beltSegment.attachmentTracker.attachments) { - ItemStack stackBefore = current.stack.copy(); - if (attachmentState.attachment.startProcessingItem(beltSegment, current, attachmentState)) { - current.beltPosition = segment + .5f + (beltMovementPositive ? 1 / 64f : -1 / 64f); - current.locked = true; - belt.sendData(); - continue Items; + if (current.beltPosition > .5f || beltMovementPositive) { + int firstUpcomingSegment = (int) (current.beltPosition + (beltMovementPositive ? .5f : -.5f)); + for (int segment = firstUpcomingSegment; beltMovementPositive ? segment + .5f <= nextOffset + : segment + .5f >= nextOffset; segment += beltMovementPositive ? 1 : -1) { + BeltTileEntity beltSegment = BeltHelper.getBeltAtSegment(belt, segment); + if (beltSegment == null) + break; + for (BeltAttachmentState attachmentState : beltSegment.attachmentTracker.attachments) { + ItemStack stackBefore = current.stack.copy(); + if (attachmentState.attachment.startProcessingItem(beltSegment, current, attachmentState)) { + current.beltPosition = segment + .5f + (beltMovementPositive ? 1 / 64f : -1 / 64f); + current.locked = true; + belt.sendData(); + continue Items; + } + if (!stackBefore.equals(current.stack, true)) + belt.sendData(); } - if (!stackBefore.equals(current.stack, true)) - belt.sendData(); } } } @@ -202,8 +204,9 @@ public class BeltInventory { if (segment == -1) continue; if (!world.isRemote) - world.updateComparatorOutputLevel(BeltHelper.getPositionForOffset(belt, segment), - belt.getBlockState().getBlock()); + world + .updateComparatorOutputLevel(BeltHelper.getPositionForOffset(belt, segment), + belt.getBlockState().getBlock()); } } @@ -392,7 +395,8 @@ public class BeltInventory { public void read(CompoundNBT nbt) { getItems().clear(); - nbt.getList("Items", NBT.TAG_COMPOUND) + nbt + .getList("Items", NBT.TAG_COMPOUND) .forEach(inbt -> getItems().add(TransportedItemStack.read((CompoundNBT) inbt))); beltMovementPositive = nbt.getBoolean("PositiveOrder"); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/AdjustablePulleyTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/AdjustablePulleyTileEntity.java index 1deacba3e..755894047 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/AdjustablePulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/AdjustablePulleyTileEntity.java @@ -33,6 +33,8 @@ public class AdjustablePulleyTileEntity extends KineticTileEntity { } public void neighborChanged() { + if (!hasWorld()) + return; int power = world.getRedstonePowerFromNeighbors(pos); if (power != signal) signalChanged = true; diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java index 3922b79c1..c4b51bdb6 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java @@ -117,7 +117,9 @@ public class StockswitchTileEntity extends SyncedTileEntity { if (!invState.hasTileEntity()) return false; TileEntity invTE = world.getTileEntity(invPos); - + if (invTE == null) + return false; + observedInventory = invTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); if (observedInventory.isPresent()) { updateCurrentLevel(); diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java index 241e68a62..67caa78ea 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java @@ -4,6 +4,8 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.RedstoneWireBlock; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.util.Direction; @@ -28,13 +30,9 @@ public class LatchBlock extends ToggleLatchBlock { @Override protected void updateState(World worldIn, BlockPos pos, BlockState state) { boolean back = state.get(POWERED); - boolean shouldBack = this.shouldBePowered(worldIn, pos, state); + boolean shouldBack = shouldBePowered(worldIn, pos, state); boolean side = state.get(POWERED_SIDE); - - Direction direction = state.get(HORIZONTAL_FACING); - Direction left = direction.rotateY(); - Direction right = direction.rotateYCCW(); - boolean shouldSide = worldIn.isSidePowered(pos, left) || worldIn.isSidePowered(pos, right); + boolean shouldSide = isPoweredOnSides(worldIn, pos, state); TickPriority tickpriority = TickPriority.HIGH; if (this.isFacingTowardsRepeater(worldIn, pos, state)) @@ -48,16 +46,28 @@ public class LatchBlock extends ToggleLatchBlock { worldIn.getPendingBlockTicks().scheduleTick(pos, this, this.getDelay(state), tickpriority); } + protected boolean isPoweredOnSides(World worldIn, BlockPos pos, BlockState state) { + Direction direction = state.get(HORIZONTAL_FACING); + Direction left = direction.rotateY(); + Direction right = direction.rotateYCCW(); + + for (Direction d : new Direction[] { left, right }) { + BlockPos blockpos = pos.offset(d); + int i = worldIn.getRedstonePower(blockpos, d); + if (i > 0) + return true; + BlockState blockstate = worldIn.getBlockState(blockpos); + return blockstate.getBlock() == Blocks.REDSTONE_WIRE ? blockstate.get(RedstoneWireBlock.POWER) > 0 : false; + } + return false; + } + @Override public void tick(BlockState state, World worldIn, BlockPos pos, Random random) { boolean back = state.get(POWERED); boolean shouldBack = this.shouldBePowered(worldIn, pos, state); boolean side = state.get(POWERED_SIDE); - - Direction direction = state.get(HORIZONTAL_FACING); - Direction left = direction.rotateY(); - Direction right = direction.rotateYCCW(); - boolean shouldSide = worldIn.isBlockPowered(pos.offset(left)) || worldIn.isBlockPowered(pos.offset(right)); + boolean shouldSide = isPoweredOnSides(worldIn, pos, state); BlockState stateIn = state; if (back != shouldBack) { diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java index 234d63c48..665971392 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateTileEntity.java @@ -93,7 +93,7 @@ public class FlexcrateTileEntity extends CrateTileEntity implements INamedContai return getOtherCrate(); return this; } - + public void onSplit() { FlexcrateTileEntity other = getOtherCrate(); if (other == null) @@ -181,7 +181,7 @@ public class FlexcrateTileEntity extends CrateTileEntity implements INamedContai public LazyOptional getCapability(Capability capability, Direction facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { FlexcrateTileEntity mainCrate = getMainCrate(); - if (mainCrate != null && mainCrate.invHandler.isPresent()) + if (mainCrate != null && mainCrate.invHandler != null && mainCrate.invHandler.isPresent()) return mainCrate.invHandler.cast(); } return super.getCapability(capability, facing); diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java b/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java index 629c02af0..f283eb3fe 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/LaunchedItem.java @@ -2,6 +2,12 @@ package com.simibubi.create.modules.schematics.block; import java.util.Optional; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Part; +import com.simibubi.create.modules.contraptions.relays.belt.item.BeltConnectorItem; +import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock; + import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; @@ -9,6 +15,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; @@ -28,8 +35,7 @@ public abstract class LaunchedItem { return (int) (Math.max(10, MathHelper.sqrt(MathHelper.sqrt(target.distanceSq(start))) * 4f)); } - LaunchedItem() { - } + LaunchedItem() {} private LaunchedItem(BlockPos target, ItemStack stack, int ticksLeft, int total) { this.target = target; @@ -60,8 +66,8 @@ public abstract class LaunchedItem { } public static LaunchedItem fromNBT(CompoundNBT c) { - LaunchedItem launched = - c.contains("BlockState") ? new LaunchedItem.ForBlockState() : new LaunchedItem.ForEntity(); + LaunchedItem launched = c.contains("Length") ? new LaunchedItem.ForBelt() + : c.contains("BlockState") ? new LaunchedItem.ForBlockState() : new LaunchedItem.ForEntity(); launched.readNBT(c); return launched; } @@ -78,8 +84,7 @@ public abstract class LaunchedItem { public static class ForBlockState extends LaunchedItem { public BlockState state; - ForBlockState() { - } + ForBlockState() {} public ForBlockState(BlockPos start, BlockPos target, ItemStack stack, BlockState state) { super(start, target, stack); @@ -105,18 +110,59 @@ public abstract class LaunchedItem { if (state.has(BlockStateProperties.EXTENDED)) state = state.with(BlockStateProperties.EXTENDED, false); + if (AllBlocks.BELT.typeOf(state)) { + world.setBlockState(target, state, 2); + return; + } + world.setBlockState(target, state, 18); state.getBlock().onBlockPlacedBy(world, target, state, null, stack); } } + public static class ForBelt extends ForBlockState { + public int length; + + public ForBelt() {} + + @Override + public CompoundNBT serializeNBT() { + CompoundNBT serializeNBT = super.serializeNBT(); + serializeNBT.putInt("Length", length); + return serializeNBT; + } + + @Override + void readNBT(CompoundNBT nbt) { + length = nbt.getInt("Length"); + super.readNBT(nbt); + } + + public ForBelt(BlockPos start, BlockPos target, ItemStack stack, BlockState state, int length) { + super(start, target, stack, state); + this.length = length; + } + + @Override + void place(World world) { + // todo place belt + boolean isStart = state.get(BeltBlock.PART) == Part.START; + BlockPos offset = BeltBlock.nextSegmentPosition(state, BlockPos.ZERO, isStart); + int i = length - 1; + Axis axis = state.get(BeltBlock.HORIZONTAL_FACING).rotateY().getAxis(); + world.setBlockState(target, AllBlocks.SHAFT.getDefault().with(ShaftBlock.AXIS, axis)); + BeltConnectorItem + .createBelts(world, target, target.add(offset.getX() * i, offset.getY() * i, offset.getZ() * i)); + } + + } + public static class ForEntity extends LaunchedItem { public Entity entity; private CompoundNBT deferredTag; - ForEntity() { - } + ForEntity() {} public ForEntity(BlockPos start, BlockPos target, ItemStack stack, Entity entity) { super(start, target, stack); diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java index 3ebed6948..e67d8b78f 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonTileEntity.java @@ -13,6 +13,11 @@ import com.simibubi.create.foundation.behaviour.base.SmartTileEntity; import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.item.ItemHelper.ExtractionCountMode; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Part; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope; +import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity; +import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock; import com.simibubi.create.modules.schematics.ItemRequirement; import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType; import com.simibubi.create.modules.schematics.MaterialChecklist; @@ -41,11 +46,13 @@ import net.minecraft.state.properties.DoubleBlockHalf; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; +import net.minecraft.world.gen.feature.template.PlacementSettings; import net.minecraft.world.gen.feature.template.Template; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -456,7 +463,14 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC ItemStack icon = requirement.isEmpty() || requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0); if (entityMode) launchEntity(target, icon, blockReader.getEntities().get(printingEntityIndex)); - else + else if (AllBlocks.BELT.typeOf(blockState)) { + TileEntity te = blockReader.getTileEntity(currentPos.add(schematicAnchor)); + blockState = stripBeltIfNotLast(blockState); + if (te instanceof BeltTileEntity && AllBlocks.BELT.typeOf(blockState)) + launchBelt(target, blockState, ((BeltTileEntity) te).beltLength); + else + launchBlock(target, icon, blockState); + } else launchBlock(target, icon, blockState); printerCooldown = config().schematicannonDelay.get(); @@ -465,6 +479,33 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC missingItem = null; } + public BlockState stripBeltIfNotLast(BlockState blockState) { + // is highest belt? + boolean isLastSegment = false; + Direction facing = blockState.get(BeltBlock.HORIZONTAL_FACING); + Slope slope = blockState.get(BeltBlock.SLOPE); + boolean positive = facing.getAxisDirection() == AxisDirection.POSITIVE; + boolean start = blockState.get(BeltBlock.PART) == Part.START; + boolean end = blockState.get(BeltBlock.PART) == Part.END; + + switch (slope) { + case DOWNWARD: + isLastSegment = start; + break; + case UPWARD: + isLastSegment = end; + break; + case HORIZONTAL: + case VERTICAL: + default: + isLastSegment = positive && end || !positive && start; + } + if (!isLastSegment) + blockState = (blockState.get(BeltBlock.PART) == Part.MIDDLE) ? Blocks.AIR.getDefaultState() + : AllBlocks.SHAFT.getDefault().with(ShaftBlock.AXIS, facing.rotateY().getAxis()); + return blockState; + } + public double getFuelUsageRate() { return hasCreativeCrate ? 0 : config().schematicannonFuelUsage.get() / 100f; } @@ -504,7 +545,8 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC schematicAnchor = anchor; blockReader = new SchematicWorld(schematicAnchor, world); - activeTemplate.addBlocksToWorld(blockReader, schematicAnchor, SchematicItem.getSettings(blueprint)); + PlacementSettings settings = SchematicItem.getSettings(blueprint); + activeTemplate.addBlocksToWorld(blockReader, schematicAnchor, settings); schematicLoaded = true; state = State.PAUSED; statusMsg = "ready"; @@ -766,6 +808,13 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC sendUpdate = true; } + protected void launchBelt(BlockPos target, BlockState state, int length) { + blocksPlaced++; + ItemStack connector = AllItems.BELT_CONNECTOR.asStack(); + flyingBlocks.add(new LaunchedItem.ForBelt(this.getPos(), target, connector, state, length)); + playFiringSound(); + } + protected void launchBlock(BlockPos target, ItemStack stack, BlockState state) { if (state.getBlock() != Blocks.AIR) blocksPlaced++; diff --git a/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java b/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java index c53bc74fa..a7f42a22f 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java +++ b/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java @@ -17,6 +17,7 @@ import com.simibubi.create.modules.schematics.client.SchematicEditScreen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.nbt.CompoundNBT; @@ -26,6 +27,7 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.Mirror; +import net.minecraft.util.NonNullList; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; @@ -61,6 +63,9 @@ public class SchematicItem extends Item { return blueprint; } + @Override + public void fillItemGroup(ItemGroup group, NonNullList items) {} + @Override @OnlyIn(value = Dist.CLIENT) public void addInformation(ItemStack stack, World worldIn, List tooltip, ITooltipFlag flagIn) { diff --git a/src/main/resources/data/create/advancements/expert_lane_1.json b/src/main/resources/data/create/advancements/expert_lane_1.json deleted file mode 100644 index aeca3d781..000000000 --- a/src/main/resources/data/create/advancements/expert_lane_1.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "create:andesite_casing", - "display": { - "icon": { - "item": "minecraft:andesite" - }, - "title": { - "translate": "advancement.create.expert_lane_1" - }, - "description": { - "translate": "advancement.create.expert_lane_1.desc" - }, - "frame": "challenge", - "show_toast": false, - "announce_to_chat": false, - "hidden": false - }, - "criteria": { - "0": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:andesite_casing" - } - ] - } - } - }, - "requirements": [ - [ - "0" - ] - ] -} \ No newline at end of file From 0bd3a8d880c9915140efd04437b4bc7498dfcb3c Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 9 May 2020 12:14:26 +0200 Subject: [PATCH 10/13] More portable blocks - Fixed latch hotfix still not making it work properly - Cocoa pods can now be harvested by harvesters - Fans, RSCs, basins, stockpile switches, gauges, engines, cranks and other blocks can now be moved in a contraption - Most of creates technical blocks can now be picked up using a wrench - Fixed Stockpile switch not reacting to movement. - Fixed Stockpile switch not reacting to changes to a double container - Chassis range display no longer shows the overlay for non-sticky directions --- .../modules/contraptions/CasingBlock.java | 9 +++++- .../modules/contraptions/IWrenchable.java | 2 ++ .../contraptions/base/KineticBlock.java | 6 ---- .../contraptions/base/KineticTileEntity.java | 6 +++- .../components/actors/AttachedActorBlock.java | 10 ++++++- .../actors/HarvesterMovementBehaviour.java | 9 +++--- .../contraptions/BlockMovementTraits.java | 15 ++++++++++ .../contraptions/ContraptionCollider.java | 4 ++- .../contraptions/bearing/BearingBlock.java | 2 +- .../chassis/AbstractChassisBlock.java | 3 +- .../chassis/ChassisTileEntity.java | 7 +++-- .../mounted/CartAssemblerBlock.java | 3 +- .../contraptions/piston/PistonPoleBlock.java | 3 +- .../components/fan/NozzleBlock.java | 10 ++++++- .../flywheel/engine/EngineBlock.java | 12 ++++---- .../contraptions/processing/BasinBlock.java | 12 ++++---- .../contraptions/redstone/ContactBlock.java | 3 +- .../contraptions/relays/gauge/GaugeBlock.java | 28 ++++++++++++------- .../block/AttachedLogisticalBlock.java | 10 ++++++- .../logistics/block/StockswitchBlock.java | 12 ++++---- .../block/StockswitchTileEntity.java | 27 +++++++++++++++--- .../block/diodes/AbstractDiodeBlock.java | 13 +++++++++ .../block/diodes/FlexpeaterBlock.java | 3 +- .../logistics/block/diodes/LatchBlock.java | 3 +- .../block/diodes/PulseRepeaterBlock.java | 3 +- .../block/diodes/ToggleLatchBlock.java | 15 ++++++---- .../block/inventories/CrateBlock.java | 3 +- .../block/transposer/TransposerBlock.java | 3 +- 28 files changed, 167 insertions(+), 69 deletions(-) create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/diodes/AbstractDiodeBlock.java diff --git a/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java index a67ba3f12..938b56b2c 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java @@ -10,11 +10,13 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemUseContext; +import net.minecraft.util.ActionResultType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraftforge.common.ToolType; -public class CasingBlock extends Block implements IHaveConnectedTextures { +public class CasingBlock extends Block implements IHaveConnectedTextures, IWrenchable { String textureFrom; @@ -22,6 +24,11 @@ public class CasingBlock extends Block implements IHaveConnectedTextures { super(Properties.from(Blocks.ANDESITE)); this.textureFrom = textureFrom; } + + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; + } @Override public ToolType getHarvestTool(BlockState state) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java b/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java index 667c32468..ff4068f0a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java @@ -27,6 +27,8 @@ public interface IWrenchable { KineticTileEntity.switchToBlockState(world, context.getPos(), updateAfterWrenched(rotated, context)); TileEntity te = context.getWorld().getTileEntity(context.getPos()); + if (te != null) + te.updateContainingBlockInfo(); if (te instanceof GeneratingKineticTileEntity) { ((GeneratingKineticTileEntity) te).updateGeneratedRotation(); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java index d70185a9a..cafd39009 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java @@ -4,7 +4,6 @@ import com.simibubi.create.foundation.item.ItemDescription.Palette; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.material.PushReaction; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -71,11 +70,6 @@ public abstract class KineticBlock extends Block implements IRotate { return true; } - @Override - public PushReaction getPushReaction(BlockState state) { - return PushReaction.BLOCK; - } - @Override public abstract TileEntity createTileEntity(BlockState state, IBlockReader world); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java index f0804b5e4..ebcb384df 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticTileEntity.java @@ -359,8 +359,12 @@ public abstract class KineticTileEntity extends SmartTileEntity return; TileEntity tileEntityIn = world.getTileEntity(pos); - if (!(tileEntityIn instanceof KineticTileEntity)) + boolean isKinetic = tileEntityIn instanceof KineticTileEntity; + + if (!isKinetic) { + world.setBlockState(pos, state, 3); return; + } KineticTileEntity tileEntity = (KineticTileEntity) tileEntityIn; if (tileEntity.hasNetwork()) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/AttachedActorBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/AttachedActorBlock.java index c738f69b1..d1b882be7 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/AttachedActorBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/AttachedActorBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.modules.contraptions.components.actors; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.contraptions.components.contraptions.IPortableBlock; import net.minecraft.block.Block; @@ -8,7 +9,9 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalBlock; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; import net.minecraft.state.StateContainer.Builder; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; @@ -16,11 +19,16 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; -public abstract class AttachedActorBlock extends HorizontalBlock implements IPortableBlock { +public abstract class AttachedActorBlock extends HorizontalBlock implements IPortableBlock, IWrenchable { public AttachedActorBlock() { super(Properties.from(Blocks.IRON_BLOCK)); } + + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; + } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/HarvesterMovementBehaviour.java index 83a8548b4..c18a8e0a5 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/actors/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/actors/HarvesterMovementBehaviour.java @@ -12,6 +12,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.Movement import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.CocoaBlock; import net.minecraft.block.CropsBlock; import net.minecraft.block.KelpBlock; import net.minecraft.block.SugarCaneBlock; @@ -81,7 +82,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return false; return true; } - if (state.getCollisionShape(world, pos).isEmpty()) { + if (state.getCollisionShape(world, pos).isEmpty() || state.getBlock() instanceof CocoaBlock) { for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; @@ -96,14 +97,14 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return false; } - + private boolean isValidOther(World world, BlockPos pos, BlockState state) { if (state.getBlock() instanceof CropsBlock) return false; if (state.getBlock() instanceof SugarCaneBlock) return true; - if (state.getCollisionShape(world, pos).isEmpty()) { + if (state.getCollisionShape(world, pos).isEmpty() || state.getBlock() instanceof CocoaBlock) { for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; @@ -131,7 +132,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return Blocks.AIR.getDefaultState(); return state.getFluidState().getBlockState(); } - if (state.getCollisionShape(world, pos).isEmpty()) { + if (state.getCollisionShape(world, pos).isEmpty() || state.getBlock() instanceof CocoaBlock) { for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java index 96e7419cb..af70da30a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java @@ -13,6 +13,9 @@ import com.simibubi.create.modules.contraptions.components.contraptions.piston.M import com.simibubi.create.modules.contraptions.components.contraptions.piston.MechanicalPistonBlock.PistonState; import com.simibubi.create.modules.contraptions.components.contraptions.pulley.PulleyBlock; import com.simibubi.create.modules.contraptions.components.contraptions.pulley.PulleyTileEntity; +import com.simibubi.create.modules.contraptions.components.crank.HandCrankBlock; +import com.simibubi.create.modules.contraptions.components.fan.NozzleBlock; +import com.simibubi.create.modules.contraptions.components.flywheel.engine.EngineBlock; import com.simibubi.create.modules.contraptions.components.contraptions.pulley.PulleyBlock.MagnetBlock; import com.simibubi.create.modules.contraptions.components.contraptions.pulley.PulleyBlock.RopeBlock; import com.simibubi.create.modules.logistics.block.AttachedLogisticalBlock; @@ -105,6 +108,8 @@ public class BlockMovementTraits { Block block = state.getBlock(); if (state.has(BlockStateProperties.HANGING)) return true; + if (block instanceof HandCrankBlock) + return true; if (block instanceof LadderBlock) return true; if (block instanceof ExtractorBlock) @@ -131,8 +136,12 @@ public class BlockMovementTraits { return true; if (block instanceof RopeBlock) return true; + if (block instanceof NozzleBlock) + return true; if (block instanceof MagnetBlock) return true; + if (block instanceof EngineBlock) + return true; return false; } @@ -178,6 +187,12 @@ public class BlockMovementTraits { return direction == Direction.DOWN; if (block instanceof AttachedActorBlock) return direction == state.get(HarvesterBlock.HORIZONTAL_FACING).getOpposite(); + if (block instanceof HandCrankBlock) + return direction == state.get(HandCrankBlock.FACING).getOpposite(); + if (block instanceof NozzleBlock) + return direction == state.get(NozzleBlock.FACING).getOpposite(); + if (block instanceof EngineBlock) + return direction == state.get(EngineBlock.HORIZONTAL_FACING).getOpposite(); return false; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionCollider.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionCollider.java index 42d73959d..f3a900949 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionCollider.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionCollider.java @@ -7,6 +7,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.modules.contraptions.components.actors.BlockBreakingMovementBehaviour; import net.minecraft.block.BlockState; +import net.minecraft.block.CocoaBlock; import net.minecraft.block.material.PushReaction; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -272,7 +273,8 @@ public class ContraptionCollider { if (AllBlocks.PULLEY_MAGNET.typeOf(collidedState) && pos.equals(BlockPos.ZERO) && movementDirection == Direction.UP) continue; - + if (collidedState.getBlock() instanceof CocoaBlock) + continue; if (!collidedState.getMaterial().isReplaceable() && !collidedState.getCollisionShape(world, colliderPos).isEmpty()) { return true; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java index d0b630bd4..3d2490654 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java @@ -24,7 +24,7 @@ public abstract class BearingBlock extends DirectionalKineticBlock { protected boolean hasStaticPart() { return true; } - + @Override public Axis getRotationAxis(BlockState state) { return state.get(FACING).getAxis(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java index e11ca9928..a4f269a9b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.modules.contraptions.components.contraptions.chassis; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.BlockState; import net.minecraft.block.RotatedPillarBlock; @@ -21,7 +22,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.Tags; -public abstract class AbstractChassisBlock extends RotatedPillarBlock { +public abstract class AbstractChassisBlock extends RotatedPillarBlock implements IWrenchable { public AbstractChassisBlock(Properties properties) { super(properties); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/ChassisTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/ChassisTileEntity.java index 2cf714806..3a2e58f89 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/ChassisTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/ChassisTileEntity.java @@ -46,8 +46,9 @@ public class ChassisTileEntity extends SmartTileEntity { te -> ((ChassisTileEntity) te).collectChassisGroup()); range.requiresWrench(); range.between(1, max); - range.withClientCallback( - i -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> ChassisRangeDisplay.display(this))); + range + .withClientCallback( + i -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> ChassisRangeDisplay.display(this))); range.value = max / 2; behaviours.add(range); } @@ -161,7 +162,7 @@ public class ChassisTileEntity extends SmartTileEntity { BlockPos current = pos.offset(facing, i); BlockState currentState = world.getBlockState(current); - if (forcedMovement != facing && !visualize && !sticky) + if (forcedMovement != facing && !sticky) break; // Ignore replaceable Blocks and Air-like diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/mounted/CartAssemblerBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/mounted/CartAssemblerBlock.java index 3475d35d4..8efab9d2d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/mounted/CartAssemblerBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/mounted/CartAssemblerBlock.java @@ -4,6 +4,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.block.RenderUtilityBlock; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionEntity; import com.simibubi.create.modules.contraptions.components.contraptions.mounted.CartAssemblerTileEntity.CartMovementMode; @@ -32,7 +33,7 @@ import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -public class CartAssemblerBlock extends AbstractRailBlock implements ITE { +public class CartAssemblerBlock extends AbstractRailBlock implements ITE, IWrenchable { public static IProperty RAIL_SHAPE = EnumProperty.create("shape", RailShape.class, RailShape.EAST_WEST, RailShape.NORTH_SOUTH); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonPoleBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonPoleBlock.java index efa1100db..2b7e2256a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonPoleBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonPoleBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.modules.contraptions.components.contraptions.piston; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.contraptions.components.contraptions.piston.MechanicalPistonBlock.PistonState; import net.minecraft.block.BlockState; @@ -20,7 +21,7 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -public class PistonPoleBlock extends ProperDirectionalBlock { +public class PistonPoleBlock extends ProperDirectionalBlock implements IWrenchable { public PistonPoleBlock() { super(Properties.from(Blocks.PISTON_HEAD)); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java index 2e5e91fa3..d5694aaeb 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java @@ -3,11 +3,14 @@ package com.simibubi.create.modules.contraptions.components.fan; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; @@ -17,7 +20,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public class NozzleBlock extends ProperDirectionalBlock { +public class NozzleBlock extends ProperDirectionalBlock implements IWrenchable { public NozzleBlock() { super(Properties.from(AllBlocks.ENCASED_FAN.get())); @@ -28,6 +31,11 @@ public class NozzleBlock extends ProperDirectionalBlock { return true; } + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; + } + @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new NozzleTileEntity(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineBlock.java index e73876769..688705df4 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineBlock.java @@ -3,14 +3,16 @@ package com.simibubi.create.modules.contraptions.components.flywheel.engine; import javax.annotation.Nullable; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; -import net.minecraft.block.material.PushReaction; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; @@ -19,7 +21,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public abstract class EngineBlock extends HorizontalBlock { +public abstract class EngineBlock extends HorizontalBlock implements IWrenchable { protected EngineBlock(Properties builder) { super(builder); @@ -36,10 +38,10 @@ public abstract class EngineBlock extends HorizontalBlock { } @Override - public PushReaction getPushReaction(BlockState state) { - return PushReaction.BLOCK; + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; } - + @Override public abstract TileEntity createTileEntity(BlockState state, IBlockReader world); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java index 1a8ab2aa4..2e9451342 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java @@ -5,16 +5,18 @@ import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.material.PushReaction; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUseContext; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; @@ -26,7 +28,7 @@ import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; -public class BasinBlock extends Block implements ITE { +public class BasinBlock extends Block implements ITE, IWrenchable { public BasinBlock() { super(Properties.from(Blocks.ANDESITE)); @@ -41,10 +43,10 @@ public class BasinBlock extends Block implements ITE { public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new BasinTileEntity(); } - + @Override - public PushReaction getPushReaction(BlockState state) { - return PushReaction.BLOCK; + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/redstone/ContactBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/redstone/ContactBlock.java index 48eba0ce9..53d554a40 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/redstone/ContactBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/redstone/ContactBlock.java @@ -4,6 +4,7 @@ import java.util.Random; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.ProperDirectionalBlock; +import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.contraptions.components.contraptions.IPortableBlock; import com.simibubi.create.modules.contraptions.components.contraptions.MovementBehaviour; @@ -20,7 +21,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; -public class ContactBlock extends ProperDirectionalBlock implements IPortableBlock { +public class ContactBlock extends ProperDirectionalBlock implements IPortableBlock, IWrenchable { public static final BooleanProperty POWERED = BlockStateProperties.POWERED; public static MovementBehaviour MOVEMENT = new ContactMovementBehaviour(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/GaugeBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/GaugeBlock.java index bcd1f077b..1f2897f4b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/GaugeBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/GaugeBlock.java @@ -5,6 +5,7 @@ import java.util.Random; import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.foundation.utility.WrappedWorld; import com.simibubi.create.modules.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.modules.contraptions.base.IRotate; @@ -79,13 +80,16 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { Direction nearestLookingDirection = context.getNearestLookingDirection(); boolean lookPositive = nearestLookingDirection.getAxisDirection() == AxisDirection.POSITIVE; if (face.getAxis() == Axis.X) { - toPlace = toPlace.with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH) + toPlace = toPlace + .with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH) .with(AXIS_ALONG_FIRST_COORDINATE, true); } else if (face.getAxis() == Axis.Y) { - toPlace = toPlace.with(FACING, horizontalFacing.getOpposite()).with(AXIS_ALONG_FIRST_COORDINATE, - horizontalFacing.getAxis() == Axis.X); + toPlace = toPlace + .with(FACING, horizontalFacing.getOpposite()) + .with(AXIS_ALONG_FIRST_COORDINATE, horizontalFacing.getAxis() == Axis.X); } else { - toPlace = toPlace.with(FACING, lookPositive ? Direction.WEST : Direction.EAST) + toPlace = toPlace + .with(FACING, lookPositive ? Direction.WEST : Direction.EAST) .with(AXIS_ALONG_FIRST_COORDINATE, false); } @@ -119,8 +123,8 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { if (getRotationAxis(state) == Axis.Y && face != state.get(FACING)) return false; BlockState blockState = world.getBlockState(pos.offset(face)); - if (Block.hasSolidSide(blockState, world, pos, face.getOpposite()) - && blockState.getMaterial() != Material.GLASS) + if (Block.hasSolidSide(blockState, world, pos, face.getOpposite()) && blockState.getMaterial() != Material.GLASS + && !(world instanceof WrappedWorld)) return false; return true; } @@ -149,11 +153,15 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { continue; for (int i = 0; i < particleCount; i++) { - Vec3d mul = VecHelper.offsetRandomly(Vec3d.ZERO, rand, .25f) - .mul(new Vec3d(1, 1, 1).subtract(positiveFaceVec)).normalize().scale(.3f); + Vec3d mul = VecHelper + .offsetRandomly(Vec3d.ZERO, rand, .25f) + .mul(new Vec3d(1, 1, 1).subtract(positiveFaceVec)) + .normalize() + .scale(.3f); Vec3d offset = VecHelper.getCenterOf(pos).add(faceVec.scale(.55)).add(mul); - worldIn.addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, - offset.y, offset.z, mul.x, mul.y, mul.z); + worldIn + .addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, + offset.y, offset.z, mul.x, mul.y, mul.z); } } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/AttachedLogisticalBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/AttachedLogisticalBlock.java index a15cacd5d..353e8644a 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/AttachedLogisticalBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/AttachedLogisticalBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.modules.logistics.block; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.IHaveNoBlockItem; +import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; import com.simibubi.create.modules.logistics.block.transposer.TransposerBlock; @@ -13,8 +14,10 @@ import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUseContext; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; @@ -23,7 +26,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public abstract class AttachedLogisticalBlock extends HorizontalBlock implements IHaveNoBlockItem { +public abstract class AttachedLogisticalBlock extends HorizontalBlock implements IHaveNoBlockItem, IWrenchable { public static final BooleanProperty UPWARD = BooleanProperty.create("upward"); @@ -36,6 +39,11 @@ public abstract class AttachedLogisticalBlock extends HorizontalBlock implements return !isVertical(); } + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + return ActionResultType.FAIL; + } + protected abstract boolean isVertical(); protected abstract BlockState getVerticalDefaultState(); diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchBlock.java index 97f3172a1..348d04738 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchBlock.java @@ -1,13 +1,14 @@ package com.simibubi.create.modules.logistics.block; +import com.simibubi.create.AllItems; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalBlock; -import net.minecraft.block.material.PushReaction; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; @@ -26,7 +27,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.items.CapabilityItemHandler; -public class StockswitchBlock extends HorizontalBlock implements ITE { +public class StockswitchBlock extends HorizontalBlock implements ITE, IWrenchable { public static final IntegerProperty INDICATOR = IntegerProperty.create("indicator", 0, 6); @@ -88,6 +89,8 @@ public class StockswitchBlock extends HorizontalBlock implements ITE () -> withTileEntityDo(worldIn, pos, te -> this.displayScreen(te, player))); return true; @@ -139,11 +142,6 @@ public class StockswitchBlock extends HorizontalBlock implements ITE getTileEntityClass() { return StockswitchTileEntity.class; diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java index c4b51bdb6..90c69cd51 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/StockswitchTileEntity.java @@ -1,7 +1,10 @@ package com.simibubi.create.modules.logistics.block; +import java.util.List; + import com.simibubi.create.AllTileEntities; -import com.simibubi.create.foundation.block.SyncedTileEntity; +import com.simibubi.create.foundation.behaviour.base.SmartTileEntity; +import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour; import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; @@ -15,7 +18,7 @@ import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -public class StockswitchTileEntity extends SyncedTileEntity { +public class StockswitchTileEntity extends SmartTileEntity { public float onWhenAbove; public float offWhenBelow; @@ -34,6 +37,7 @@ public class StockswitchTileEntity extends SyncedTileEntity { currentLevel = -1; powered = false; observedInventory = LazyOptional.empty(); + setLazyTickRate(10); } @Override @@ -107,7 +111,17 @@ public class StockswitchTileEntity extends SyncedTileEntity { world.notifyNeighbors(pos, getBlockState().getBlock()); } + @Override + public void lazyTick() { + super.lazyTick(); + if (world.isRemote) + return; + findNewInventory(); + updateCurrentLevel(); + } + private boolean findNewInventory() { + observedInventory = LazyOptional.empty(); BlockPos invPos = getPos().offset(getBlockState().get(BlockStateProperties.HORIZONTAL_FACING)); if (!world.isBlockPresent(invPos)) @@ -119,14 +133,19 @@ public class StockswitchTileEntity extends SyncedTileEntity { TileEntity invTE = world.getTileEntity(invPos); if (invTE == null) return false; - + observedInventory = invTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); if (observedInventory.isPresent()) { updateCurrentLevel(); return true; } - + return false; } + @Override + public void addBehaviours(List behaviours) { + + } + } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/AbstractDiodeBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/AbstractDiodeBlock.java new file mode 100644 index 000000000..04ad51126 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/AbstractDiodeBlock.java @@ -0,0 +1,13 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import com.simibubi.create.modules.contraptions.IWrenchable; + +import net.minecraft.block.RedstoneDiodeBlock; + +public abstract class AbstractDiodeBlock extends RedstoneDiodeBlock implements IWrenchable { + + public AbstractDiodeBlock(Properties builder) { + super(builder); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java index dc2d0ca72..5865771eb 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java @@ -5,7 +5,6 @@ import com.simibubi.create.AllBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; @@ -13,7 +12,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; -public class FlexpeaterBlock extends RedstoneDiodeBlock { +public class FlexpeaterBlock extends AbstractDiodeBlock { public static BooleanProperty POWERING = BooleanProperty.create("powering"); diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java index 67caa78ea..c559a35f2 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java @@ -57,7 +57,8 @@ public class LatchBlock extends ToggleLatchBlock { if (i > 0) return true; BlockState blockstate = worldIn.getBlockState(blockpos); - return blockstate.getBlock() == Blocks.REDSTONE_WIRE ? blockstate.get(RedstoneWireBlock.POWER) > 0 : false; + if (blockstate.getBlock() == Blocks.REDSTONE_WIRE && blockstate.get(RedstoneWireBlock.POWER) > 0) + return true; } return false; } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java index bb7531914..58fbf4d7e 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java @@ -5,7 +5,6 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.util.Direction; @@ -14,7 +13,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.TickPriority; import net.minecraft.world.World; -public class PulseRepeaterBlock extends RedstoneDiodeBlock { +public class PulseRepeaterBlock extends AbstractDiodeBlock { public static BooleanProperty PULSING = BooleanProperty.create("pulsing"); diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java index 20b238593..f4098e4b1 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java @@ -2,10 +2,11 @@ package com.simibubi.create.modules.logistics.block.diodes; import java.util.Random; +import com.simibubi.create.AllItems; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; @@ -16,10 +17,10 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -public class ToggleLatchBlock extends RedstoneDiodeBlock { +public class ToggleLatchBlock extends AbstractDiodeBlock { public static BooleanProperty POWERING = BooleanProperty.create("powering"); - + public ToggleLatchBlock() { super(Properties.from(Blocks.REPEATER)); setDefaultState(getDefaultState().with(POWERING, false).with(POWERED, false)); @@ -29,17 +30,17 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock { protected void fillStateContainer(Builder builder) { builder.add(POWERED, POWERING, HORIZONTAL_FACING); } - + @Override public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) { return blockState.get(HORIZONTAL_FACING) == side ? this.getActiveSignal(blockAccess, pos, blockState) : 0; } - + @Override protected int getDelay(BlockState state) { return 1; } - + @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { @@ -47,6 +48,8 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock { return false; if (player.isSneaking()) return false; + if (AllItems.WRENCH.typeOf(player.getHeldItem(handIn))) + return false; return activated(worldIn, pos, state); } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java index bb355a6c4..b72733e50 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/CrateBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.modules.logistics.block.inventories; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.utility.AllShapes; +import com.simibubi.create.modules.contraptions.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -16,7 +17,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; -public class CrateBlock extends ProperDirectionalBlock { +public class CrateBlock extends ProperDirectionalBlock implements IWrenchable { public static final BooleanProperty DOUBLE = BooleanProperty.create("double"); diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/transposer/TransposerBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/transposer/TransposerBlock.java index 172541992..d4e9069dc 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/transposer/TransposerBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/transposer/TransposerBlock.java @@ -2,7 +2,6 @@ package com.simibubi.create.modules.logistics.block.transposer; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.utility.AllShapes; -import com.simibubi.create.modules.contraptions.IWrenchable; import com.simibubi.create.modules.logistics.block.belts.BeltAttachableLogisticalBlock; import net.minecraft.block.Block; @@ -23,7 +22,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public class TransposerBlock extends BeltAttachableLogisticalBlock implements IWrenchable { +public class TransposerBlock extends BeltAttachableLogisticalBlock { public static BooleanProperty POWERED = BlockStateProperties.POWERED; From 0a869190b267bc0a56f6a9088a51199484813067 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 9 May 2020 14:27:09 +0200 Subject: [PATCH 11/13] Deployer dupes - Fixed blazing sword taking damage in the nether - Fixed blazing sword not igniting entities - More safety checks - Fixed stack overflow when overpowering a RSC from both inputs - Fixed outrageous duplication glitch in deployer item handler - Fixed crafters not able to return multiple buckets - Super glue can now be used to make chassis sticky --- .../java/com/simibubi/create/AllItems.java | 3 ++- .../foundation/gui/ScreenElementRenderer.java | 15 ++++++----- .../contraptions/BlockMovementTraits.java | 5 ++++ .../chassis/AbstractChassisBlock.java | 3 ++- .../crafter/MechanicalCrafterTileEntity.java | 8 +++--- .../deployer/DeployerItemHandler.java | 5 ++-- .../advanced/SpeedControllerTileEntity.java | 19 ++++++++++++-- .../contraptions/relays/belt/BeltBlock.java | 10 ++++--- .../relays/belt/BeltTileEntity.java | 5 +++- .../curiosities/tools/BlazingSwordItem.java | 26 +++++++++++++++++++ .../curiosities/tools/BlazingToolItem.java | 2 +- .../modules/logistics/InWorldProcessing.java | 3 +++ 12 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingSwordItem.java diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 8c6f1c348..2604f2829 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -26,6 +26,7 @@ import com.simibubi.create.modules.curiosities.ShadowSteelItem; import com.simibubi.create.modules.curiosities.deforester.DeforesterItem; import com.simibubi.create.modules.curiosities.symmetry.SymmetryWandItem; import com.simibubi.create.modules.curiosities.tools.AllToolTiers; +import com.simibubi.create.modules.curiosities.tools.BlazingSwordItem; import com.simibubi.create.modules.curiosities.tools.BlazingToolItem; import com.simibubi.create.modules.curiosities.tools.RoseQuartzToolItem; import com.simibubi.create.modules.curiosities.tools.SandPaperItem; @@ -119,7 +120,7 @@ public enum AllItems { BLAZING_PICKAXE(p -> new BlazingToolItem(1, -2.8F, p, PICKAXE)), BLAZING_SHOVEL(p -> new BlazingToolItem(1.5F, -3.0F, p, SHOVEL)), BLAZING_AXE(p -> new BlazingToolItem(5.0F, -3.0F, p, AXE)), - BLAZING_SWORD(p -> new SwordItem(AllToolTiers.BLAZING, 3, -2.4F, p)), + BLAZING_SWORD(p -> new BlazingSwordItem(AllToolTiers.BLAZING, 3, -2.4F, p)), ROSE_QUARTZ_PICKAXE(p -> new RoseQuartzToolItem(1, -2.8F, p, PICKAXE)), ROSE_QUARTZ_SHOVEL(p -> new RoseQuartzToolItem(1.5F, -3.0F, p, SHOVEL)), diff --git a/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java b/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java index d6c11bc94..f71fbff42 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java @@ -85,12 +85,15 @@ public class ScreenElementRenderer { blockRenderer.renderBlockBrightness(blockToRender, 1); } else { GlStateManager.rotated(90, 0, 1, 0); - if (color == -1) { - blockRenderer.getBlockModelRenderer().renderModelBrightnessColor(modelToRender, 1, 1, 1, 1); - } else { - Vec3d rgb = ColorHelper.getRGB(color); - blockRenderer.getBlockModelRenderer().renderModelBrightnessColor(modelToRender, 1, (float) rgb.x, - (float) rgb.y, (float) rgb.z); + if (modelToRender != null) { + if (color == -1) { + blockRenderer.getBlockModelRenderer().renderModelBrightnessColor(modelToRender, 1, 1, 1, 1); + } else { + Vec3d rgb = ColorHelper.getRGB(color); + blockRenderer + .getBlockModelRenderer() + .renderModelBrightnessColor(modelToRender, 1, (float) rgb.x, (float) rgb.y, (float) rgb.z); + } } } GlStateManager.popMatrix(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java index af70da30a..3063b4f00 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java @@ -29,6 +29,7 @@ import net.minecraft.block.AbstractRailBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.CarpetBlock; import net.minecraft.block.DoorBlock; import net.minecraft.block.FenceGateBlock; import net.minecraft.block.FlowerPotBlock; @@ -142,6 +143,8 @@ public class BlockMovementTraits { return true; if (block instanceof EngineBlock) return true; + if (block instanceof CarpetBlock) + return true; return false; } @@ -168,6 +171,8 @@ public class BlockMovementTraits { return direction == Direction.DOWN; if (block instanceof RedstoneWireBlock) return direction == Direction.DOWN; + if (block instanceof CarpetBlock) + return direction == Direction.DOWN; if (block instanceof RedstoneWallTorchBlock) return state.get(RedstoneWallTorchBlock.FACING) == direction.getOpposite(); if (block instanceof TorchBlock) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java index a4f269a9b..64bebbe05 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.modules.contraptions.components.contraptions.chassis; +import com.simibubi.create.AllItems; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.modules.contraptions.IWrenchable; @@ -45,7 +46,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock implements return false; ItemStack heldItem = player.getHeldItem(handIn); - boolean isSlimeBall = heldItem.getItem().isIn(Tags.Items.SLIMEBALLS); + boolean isSlimeBall = heldItem.getItem().isIn(Tags.Items.SLIMEBALLS) || AllItems.SUPER_GLUE.typeOf(heldItem); BooleanProperty affectedSide = getGlueableSide(state, hit.getFace()); if (affectedSide == null) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntity.java index f9be57d87..02f0b6902 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntity.java @@ -217,10 +217,12 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { }); groupedItems = new GroupedItems(result); - containers.forEach(stack -> { - GroupedItems container = new GroupedItems(stack); + for (int i = 0; i < containers.size(); i++) { + ItemStack stack = containers.get(i); + GroupedItems container = new GroupedItems(); + container.grid.put(Pair.of(i, 0), stack); container.mergeOnto(groupedItems, Pointing.LEFT); - }); + } phase = Phase.CRAFTING; countDown = 2000; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerItemHandler.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerItemHandler.java index b598ff183..cd507742b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerItemHandler.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerItemHandler.java @@ -58,7 +58,8 @@ public class DeployerItemHandler implements IItemHandlerModifiable { return stack; int space = held.getMaxStackSize() - held.getCount(); - ItemStack split = stack.copy().split(space); + ItemStack remainder = stack.copy(); + ItemStack split = remainder.split(space); if (space == 0) return stack; @@ -68,7 +69,7 @@ public class DeployerItemHandler implements IItemHandlerModifiable { set(held); } - return split; + return remainder; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/SpeedControllerTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/SpeedControllerTileEntity.java index d90c58efe..fbccb83d3 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/SpeedControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/SpeedControllerTileEntity.java @@ -59,10 +59,25 @@ public class SpeedControllerTileEntity extends KineticTileEntity { boolean targetingController) { if (!(speedControllerIn instanceof SpeedControllerTileEntity)) return 0; - SpeedControllerTileEntity speedController = (SpeedControllerTileEntity) speedControllerIn; + float speed = speedControllerIn.getTheoreticalSpeed(); + float wheelSpeed = cogWheel.getTheoreticalSpeed(); + float desiredOutputSpeed = getDesiredOutputSpeed(cogWheel, speedControllerIn, targetingController); + + float compareSpeed = targetingController ? speed : wheelSpeed; + if (desiredOutputSpeed >= 0 && compareSpeed >= 0) + return Math.max(desiredOutputSpeed, compareSpeed); + if (desiredOutputSpeed < 0 && compareSpeed < 0) + return Math.min(desiredOutputSpeed, compareSpeed); + + return desiredOutputSpeed; + } + + public static float getDesiredOutputSpeed(KineticTileEntity cogWheel, KineticTileEntity speedControllerIn, + boolean targetingController) { + SpeedControllerTileEntity speedController = (SpeedControllerTileEntity) speedControllerIn; float targetSpeed = speedController.targetSpeed.getValue(); - float speed = speedControllerIn.getSpeed(); + float speed = speedControllerIn.getTheoreticalSpeed(); float wheelSpeed = cogWheel.getTheoreticalSpeed(); if (targetSpeed == 0) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index 8f274e8f9..7bf57c436 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -57,6 +57,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; @@ -365,6 +366,9 @@ public class BeltBlock extends HorizontalKineticBlock @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + if (state.getBlock() != this) + return VoxelShapes.empty(); + VoxelShape shape = getShape(state, worldIn, pos, context); try { if (context.getEntity() == null) @@ -629,7 +633,7 @@ public class BeltBlock extends HorizontalKineticBlock @Override public BlockState rotate(BlockState state, Rotation rot) { BlockState rotate = super.rotate(state, rot); - + if (state.get(SLOPE) != Slope.VERTICAL) return rotate; if (state.get(HORIZONTAL_FACING).getAxisDirection() != rotate.get(HORIZONTAL_FACING).getAxisDirection()) { @@ -638,8 +642,8 @@ public class BeltBlock extends HorizontalKineticBlock if (state.get(PART) == Part.END) return rotate.with(PART, Part.START); } - + return rotate; } - + } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java index 6cc9fda13..6aa355884 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java @@ -133,7 +133,10 @@ public class BeltTileEntity extends KineticTileEntity { TileEntity te = world.getTileEntity(controller); if (te == null || !(te instanceof BeltTileEntity)) return; - IItemHandler handler = ((BeltTileEntity) te).getInventory().createHandlerForSegment(index); + BeltInventory inventory = ((BeltTileEntity) te).getInventory(); + if (inventory == null) + return; + IItemHandler handler = inventory.createHandlerForSegment(index); itemHandler = LazyOptional.of(() -> handler); } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingSwordItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingSwordItem.java new file mode 100644 index 000000000..36ec39727 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingSwordItem.java @@ -0,0 +1,26 @@ +package com.simibubi.create.modules.curiosities.tools; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.IItemTier; +import net.minecraft.item.ItemStack; +import net.minecraft.item.SwordItem; + +public class BlazingSwordItem extends SwordItem { + + public BlazingSwordItem(IItemTier tier, int attackDamageIn, float attackSpeedIn, Properties builder) { + super(tier, attackDamageIn, attackSpeedIn, builder); + } + + @Override + public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.setFire(2); + return BlazingToolItem.shouldTakeDamage(attacker.world, stack) ? super.hitEntity(stack, target, attacker) + : true; + } + + @Override + public int getBurnTime(ItemStack itemStack) { + return itemStack.getMaxDamage() - itemStack.getDamage() + 1; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java index 7c24a302f..b97990f33 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java @@ -54,7 +54,7 @@ public class BlazingToolItem extends AbstractToolItem { return shouldTakeDamage(attacker.world, stack) ? super.hitEntity(stack, target, attacker) : true; } - protected boolean shouldTakeDamage(World world, ItemStack stack) { + static boolean shouldTakeDamage(World world, ItemStack stack) { return world.getDimension().getType() != DimensionType.THE_NETHER; } diff --git a/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java b/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java index 6dd533f39..3fc370dca 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java @@ -152,6 +152,9 @@ public class InWorldProcessing { return null; List stacks = process(transported.stack, type, belt.getWorld()); + if (stacks == null) + return null; + List transportedStacks = new ArrayList<>(); for (ItemStack additional : stacks) { TransportedItemStack newTransported = transported.getSimilar(); From 32cce4e9b9afa0728b4958f005be72902f60ac02 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 9 May 2020 18:32:47 +0200 Subject: [PATCH 12/13] Bug-fixes - Reduced tracking range of mounted contraptions - Fixed carpets not able to be pushed directly - Fixed Water Wheels and Belt Tunnels crashing when rendered in a schematic preview --- .../java/com/simibubi/create/AllEntities.java | 16 ++++++++-------- .../contraptions/BlockMovementTraits.java | 2 ++ .../contraptions/piston/PistonContraption.java | 3 ++- .../components/waterwheel/WaterWheelBlock.java | 3 ++- .../block/belts/tunnel/BeltTunnelBlock.java | 12 +++++++----- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllEntities.java b/src/main/java/com/simibubi/create/AllEntities.java index aa9af81f1..4e9c6bfcb 100644 --- a/src/main/java/com/simibubi/create/AllEntities.java +++ b/src/main/java/com/simibubi/create/AllEntities.java @@ -21,12 +21,10 @@ import net.minecraftforge.fml.client.registry.RenderingRegistry; public enum AllEntities { - CONTRAPTION(ContraptionEntity::new, EntityClassification.MISC, 30, 3, true, - ContraptionEntity::build), - STATIONARY_CONTRAPTION(ContraptionEntity::new, EntityClassification.MISC, 30, 40, - false, ContraptionEntity::build), - SUPER_GLUE(SuperGlueEntity::new, EntityClassification.MISC, 30, Integer.MAX_VALUE, false, SuperGlueEntity::build), - + CONTRAPTION(ContraptionEntity::new, EntityClassification.MISC, 5, 3, true, ContraptionEntity::build), + STATIONARY_CONTRAPTION(ContraptionEntity::new, EntityClassification.MISC, 20, 40, false, ContraptionEntity::build), + SUPER_GLUE(SuperGlueEntity::new, EntityClassification.MISC, 10, Integer.MAX_VALUE, false, SuperGlueEntity::build), + ; private IFactory factory; @@ -53,8 +51,10 @@ public enum AllEntities { for (AllEntities entity : values()) { String id = Lang.asId(entity.name()); ResourceLocation resourceLocation = new ResourceLocation(Create.ID, id); - Builder builder = EntityType.Builder.create(entity.factory, entity.group) - .setTrackingRange(entity.range).setUpdateInterval(entity.updateFrequency) + Builder builder = EntityType.Builder + .create(entity.factory, entity.group) + .setTrackingRange(entity.range) + .setUpdateInterval(entity.updateFrequency) .setShouldReceiveVelocityUpdates(entity.sendVelocity); if (entity.propertyBuilder != null) builder = entity.propertyBuilder.apply(builder); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java index 3063b4f00..55d86719c 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/BlockMovementTraits.java @@ -216,6 +216,8 @@ public class BlockMovementTraits { return state.get(BlockStateProperties.HORIZONTAL_FACING) == facing; if (AllBlocks.ROPE_PULLEY.typeOf(state)) return facing == Direction.DOWN; + if (state.getBlock() instanceof CarpetBlock) + return facing == Direction.UP; return isBrittle(state); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonContraption.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonContraption.java index 947321a0d..a8bc914df 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/PistonContraption.java @@ -21,6 +21,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.glue.Sup import com.simibubi.create.modules.contraptions.components.contraptions.piston.MechanicalPistonBlock.PistonState; import net.minecraft.block.BlockState; +import net.minecraft.block.CarpetBlock; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.state.properties.BlockStateProperties; @@ -152,7 +153,7 @@ public class PistonContraption extends Contraption { if (!BlockMovementTraits.movementNecessary(world, currentPos)) return true; BlockState state = world.getBlockState(currentPos); - if (BlockMovementTraits.isBrittle(state)) + if (BlockMovementTraits.isBrittle(state) && !(state.getBlock() instanceof CarpetBlock)) return true; if (AllBlocks.MECHANICAL_PISTON_HEAD.typeOf(state) && state.get(FACING) == direction.getOpposite()) return true; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java index 09800ca42..33c98c89d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java @@ -4,6 +4,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.config.AllConfigs; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.utility.WrappedWorld; import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; import net.minecraft.block.BlockState; @@ -63,7 +64,7 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE, @Override public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { - withTileEntityDo(worldIn, currentPos, BeltTunnelTileEntity::initFlaps); + if (!(worldIn instanceof WrappedWorld)) + withTileEntityDo(worldIn, currentPos, BeltTunnelTileEntity::initFlaps); BlockState tunnelState = getTunnelState(worldIn, currentPos); if (tunnelState.get(HORIZONTAL_AXIS) == state.get(HORIZONTAL_AXIS)) { @@ -166,11 +168,11 @@ public class BeltTunnelBlock extends Block implements ITE, // T and Cross Direction left = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis).rotateY(); BlockState leftState = reader.getBlockState(pos.offset(left).down()); - boolean onLeft = AllBlocks.BELT.typeOf(leftState) - && leftState.get(BeltBlock.HORIZONTAL_FACING).getAxis() != axis; + boolean onLeft = + AllBlocks.BELT.typeOf(leftState) && leftState.get(BeltBlock.HORIZONTAL_FACING).getAxis() != axis; BlockState rightState = reader.getBlockState(pos.offset(left.getOpposite()).down()); - boolean onRight = AllBlocks.BELT.typeOf(rightState) - && rightState.get(BeltBlock.HORIZONTAL_FACING).getAxis() != axis; + boolean onRight = + AllBlocks.BELT.typeOf(rightState) && rightState.get(BeltBlock.HORIZONTAL_FACING).getAxis() != axis; if (onLeft && onRight) state = state.with(SHAPE, Shape.CROSS); From 1fe647b16ef9203c40ba0a62920de693c2918a47 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 9 May 2020 19:17:51 +0200 Subject: [PATCH 13/13] Place & Crash - Fixed some incompatibilities between kinetic blocks and schematic tools --- .../contraptions/bearing/MechanicalBearingBlock.java | 10 +++++++--- .../bearing/MechanicalBearingTileEntity.java | 3 +++ .../contraptions/components/fan/EncasedFanBlock.java | 3 +++ .../components/flywheel/engine/FurnaceEngineBlock.java | 3 +++ .../schematics/block/SchematicannonTileEntity.java | 5 +++-- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/MechanicalBearingBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/MechanicalBearingBlock.java index 7fe9b061c..915f45e11 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/MechanicalBearingBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/MechanicalBearingBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.modules.contraptions.components.contraptions.bearing; import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.utility.WrappedWorld; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -18,7 +19,7 @@ public class MechanicalBearingBlock extends BearingBlock implements ITE