diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index be6c88795..aaab21e19 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -361,16 +361,16 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 1fe3d6fb515b8951750daf6ff274006e14c96b32 assets/create/lang/en_ud.json -ba81a0874d90e126eb6b5e6edf22d69176888ae3 assets/create/lang/en_us.json -69ebd4797f76f54483912b0c57fd061b73c732b2 assets/create/lang/unfinished/de_de.json -fb1b725ce25e90e95615e6829f3a570c35e84f2d assets/create/lang/unfinished/fr_fr.json -3cf685c54663480dc3208b3d9ba8cc1638ebbe62 assets/create/lang/unfinished/it_it.json -8c844b9777baad14984784ff957cff2e241f4d07 assets/create/lang/unfinished/ja_jp.json -f351bafc438dcde67979a51753da16f75a9e1a34 assets/create/lang/unfinished/ko_kr.json -3c143d2b067e5443b1724d1ddb478f3abbf1f9a1 assets/create/lang/unfinished/nl_nl.json -e8dff25d88cdbabe91ae784d05e0a5c87fd9b948 assets/create/lang/unfinished/pt_br.json -411119247ce1bcc941bd3f49fb3a18eac687d65d assets/create/lang/unfinished/ru_ru.json -a94df56a2bc8f04661f0b3616963b84046ea4cbb assets/create/lang/unfinished/zh_cn.json +e4c4fa83b8549dec363bbda95fa9fda7b285de5c assets/create/lang/en_us.json +e1a6b606458028f5c3b4afdc0a9e0cbd22d9e779 assets/create/lang/unfinished/de_de.json +46c139da98fdee00d70a5fd893fc3eb4f03b8a0d assets/create/lang/unfinished/fr_fr.json +ac0103512dff6e125cfa0df5c9a55cceef33a1f9 assets/create/lang/unfinished/it_it.json +b22f04831c88799fcb69857ba16dbfa9df74aded assets/create/lang/unfinished/ja_jp.json +8f72c330dbb5eb2b4631ffdb169e2b4a5bd98695 assets/create/lang/unfinished/ko_kr.json +f7a3b075daf79ae600435c779a91c91a182771cd assets/create/lang/unfinished/nl_nl.json +e65a45f531b6ae7a0818503c335366abb7a9ce20 assets/create/lang/unfinished/pt_br.json +4251b8d5c5c45a162148776ccada3d7abeeb5bf1 assets/create/lang/unfinished/ru_ru.json +c8c10a94bca76ee411246e29dbebba530a7f995c assets/create/lang/unfinished/zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 3613adb1c..467c86719 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -652,6 +652,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "Lock rotation", "create.logistics.filter": "Filter", + "create.logistics.recipe_filter": "Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 7c69cda93..b3d5fae4c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 820", + "_": "Missing Localizations: 821", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Filter", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index fe64a53bd..175c5d00c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 424", + "_": "Missing Localizations: 425", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Filtre", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 21fa71cf9..330839e3b 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 408", + "_": "Missing Localizations: 409", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Filtro", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 131b29a6b..957580a80 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 403", + "_": "Missing Localizations: 404", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "フィルタ", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index bf2b8eaaf..490b07b7a 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 408", + "_": "Missing Localizations: 409", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "필터", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "주파수. #1", "create.logistics.secondFrequency": "주파수. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index d252923d3..aaa58801e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 758", + "_": "Missing Localizations: 759", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Filter", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 0504e2b4f..8c7ddbb86 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 827", + "_": "Missing Localizations: 828", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Filtros", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "UNLOCALIZED: Freq. #1", "create.logistics.secondFrequency": "UNLOCALIZED: Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index a71fcbd63..d19ffd7fb 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 821", + "_": "Missing Localizations: 822", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "UNLOCALIZED: Lock rotation", "create.logistics.filter": "Фильтр", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "Част. #1", "create.logistics.secondFrequency": "Част. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 02a0ba70a..cc4c5f364 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 84", + "_": "Missing Localizations: 85", "_": "->------------------------] Game Elements [------------------------<-", @@ -653,6 +653,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "结构方向保持不变", "create.logistics.filter": "过滤器", + "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", "create.logistics.firstFrequency": "频道. #1", "create.logistics.secondFrequency": "频道. #2", diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index 788218617..15692364e 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -116,7 +116,7 @@ public class AllShapes { BASIN_BLOCK_SHAPE = shape(0, 2, 0, 16, 16, 16).erase(2, 2, 2, 14, 16, 14) .add(2, 0, 2, 14, 2, 14) .build(), BASIN_COLLISION_SHAPE = - shape(0, 2, 0, 16, 16, 16).erase(2, 5, 2, 14, 16, 14) + shape(0, 2, 0, 16, 13, 16).erase(2, 5, 2, 14, 16, 14) .add(2, 0, 2, 14, 2, 14) .build(), HEATER_BLOCK_SHAPE = shape(2, 0, 2, 14, 14, 14).add(0, 0, 0, 16, 4, 16) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index 5a0b1e36e..1aa72e89b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -173,13 +173,10 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { @Override protected boolean matchBasinRecipe(IRecipe recipe) { - if (recipe == null) + if (!super.matchBasinRecipe(recipe)) return false; + NonNullList ingredients = recipe.getIngredients(); - if (!ingredients.stream() - .allMatch(ingredient -> (ingredient.isSimple() || ingredient.getMatchingStacks().length == 1))) - return false; - List remainingItems = new ArrayList<>(); itemInputs.forEach(stack -> remainingItems.add(stack.copy())); List remainingFluids = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index 7e7970af9..315349f9b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -282,14 +282,10 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { @Override protected boolean matchBasinRecipe(IRecipe recipe) { - if (recipe == null) + if (!super.matchBasinRecipe(recipe)) return false; NonNullList ingredients = recipe.getIngredients(); - if (!ingredients.stream() - .allMatch(Ingredient::isSimple)) - return false; - List remainingItems = new ArrayList<>(); itemInputs.forEach(stack -> remainingItems.add(stack.copy())); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index e9def2ec8..3512c1ce8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -74,7 +74,7 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { @Override public void addBehaviours(List behaviours) { super.addBehaviours(behaviours); - filtering = new FilteringBehaviour(this, new SawFilterSlot()); + filtering = new FilteringBehaviour(this, new SawFilterSlot()).forRecipes(); behaviours.add(filtering); behaviours.add(new DirectBeltInputBehaviour(this)); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java index 3b0430bb6..d4d581a36 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java @@ -7,6 +7,8 @@ import com.simibubi.create.content.contraptions.wrench.IWrenchable; 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.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -101,15 +103,17 @@ public class BasinBlock extends Block implements ITE, IWrenchab } @Override - public VoxelShape getCollisionShape(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, - ISelectionContext p_220071_4_) { - return AllShapes.BASIN_COLLISION_SHAPE; + public VoxelShape getCollisionShape(BlockState state, IBlockReader reader, BlockPos pos, ISelectionContext ctx) { + if (ctx.getEntity() instanceof ItemEntity) + return AllShapes.BASIN_COLLISION_SHAPE; + return getShape(state, reader, pos, ctx); } @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.hasTileEntity() || state.getBlock() == newState.getBlock()) + if (!state.hasTileEntity() || state.getBlock() == newState.getBlock()) return; + TileEntityBehaviour.destroy(worldIn, pos, FilteringBehaviour.TYPE); withTileEntityDo(worldIn, pos, te -> { ItemHelper.dropContents(worldIn, pos, te.inputItemInventory); ItemHelper.dropContents(worldIn, pos, te.outputItemInventory); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java index 4c63f4f75..84ae8dcfb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java @@ -210,7 +210,24 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity { protected abstract boolean matchStaticFilters(IRecipe recipe); - protected abstract boolean matchBasinRecipe(IRecipe recipe); + protected boolean matchBasinRecipe(IRecipe recipe) { + if (recipe == null) + return false; + + Optional basin = getBasin(); + if (!basin.isPresent()) + return false; + BasinTileEntity basinTileEntity = basin.get(); + if (!basinTileEntity.getFilter() + .test(recipe.getRecipeOutput())) + return false; + + NonNullList ingredients = recipe.getIngredients(); + if (!ingredients.stream() + .allMatch(ingredient -> (ingredient.isSimple() || ingredient.getMatchingStacks().length == 1))) + return false; + return true; + } protected abstract Object getRecipeCacheKey(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java index 899b3e7d7..c429249e3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.processing; import java.util.Random; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; +import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.client.Minecraft; @@ -17,7 +17,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; -public class BasinRenderer extends SafeTileEntityRenderer { +public class BasinRenderer extends SmartTileEntityRenderer { public BasinRenderer(TileEntityRendererDispatcher dispatcher) { super(dispatcher); @@ -25,7 +25,9 @@ public class BasinRenderer extends SafeTileEntityRenderer { @Override protected void renderSafe(BasinTileEntity basin, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, - int light, int overlay) { + int light, int overlay) { + super.renderSafe(basin, partialTicks, ms, buffer, light, overlay); + ms.push(); BlockPos pos = basin.getPos(); ms.translate(.5, .2f, .5); @@ -44,7 +46,9 @@ public class BasinRenderer extends SafeTileEntityRenderer { ms.translate(vec.x, vec.y, vec.z); ms.multiply(new Vector3f((float) vec2.z, (float) vec2.y, 0).getDegreesQuaternion((float) vec2.x * 180)); - Minecraft.getInstance().getItemRenderer().renderItem(stack, TransformType.GROUND, light, overlay, ms, buffer); + Minecraft.getInstance() + .getItemRenderer() + .renderItem(stack, TransformType.GROUND, light, overlay, ms, buffer); ms.pop(); } ms.translate(0, 1 / 64f, 0); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index f7c36dbba..5b6f95422 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -8,8 +8,12 @@ import javax.annotation.Nonnull; import com.simibubi.create.content.contraptions.fluids.CombinedFluidHandler; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; +import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; @@ -17,6 +21,9 @@ import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -30,6 +37,7 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; public class BasinTileEntity extends SmartTileEntity implements ITickableTileEntity { public boolean contentsChanged; + private FilteringBehaviour filtering; protected ItemStackHandler outputItemInventory = new ItemStackHandler(9) { protected void onContentsChanged(int slot) { @@ -98,6 +106,12 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt } + @Override + @OnlyIn(Dist.CLIENT) + public double getMaxRenderDistanceSquared() { + return 256; + } + protected LazyOptional inventory = LazyOptional.of(() -> new BasinInventory(inputItemInventory, outputItemInventory)); @@ -115,6 +129,10 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt @Override public void addBehaviours(List behaviours) { behaviours.add(new DirectBeltInputBehaviour(this)); + filtering = new FilteringBehaviour(this, new BasinValueBox()).moveText(new Vec3d(2, -8, 0)) + .withCallback(newFilter -> contentsChanged = true) + .forRecipes(); + behaviours.add(filtering); } @Override @@ -177,4 +195,23 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt return Optional.empty(); } + public FilteringBehaviour getFilter() { + return filtering; + } + + class BasinValueBox extends ValueBoxTransform.Sided { + + @Override + protected Vec3d getSouthLocation() { + return VecHelper.voxelSpace(8, 12, 16); + } + + @Override + protected boolean isSideActive(BlockState state, Direction direction) { + return direction.getAxis() + .isHorizontal(); + } + + } + } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java index 79148ad8a..dcd972552 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java @@ -36,6 +36,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { int scrollableValue; int ticksUntilScrollPacket; boolean forceClientState; + boolean recipeFilter; public FilteringBehaviour(SmartTileEntity te, ValueBoxTransform slot) { super(te); @@ -49,13 +50,14 @@ public class FilteringBehaviour extends TileEntityBehaviour { count = 0; ticksUntilScrollPacket = -1; showCountPredicate = () -> showCount; + recipeFilter = false; } @Override public void write(CompoundNBT nbt, boolean clientPacket) { nbt.put("Filter", getFilter().serializeNBT()); nbt.putInt("FilterAmount", count); - + if (clientPacket && forceClientState) { nbt.putBoolean("ForceScrollable", true); forceClientState = false; @@ -96,6 +98,11 @@ public class FilteringBehaviour extends TileEntityBehaviour { return this; } + public FilteringBehaviour forRecipes() { + recipeFilter = true; + return this; + } + public FilteringBehaviour onlyActiveWhen(Supplier condition) { isActive = condition; return this; @@ -125,7 +132,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { public void setFilter(Direction face, ItemStack stack) { setFilter(stack); } - + public void setFilter(ItemStack stack) { filter = stack.copy(); callback.accept(filter); @@ -150,7 +157,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { public ItemStack getFilter(Direction side) { return getFilter(); } - + public ItemStack getFilter() { return filter.copy(); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java index 790e06234..4d547a381 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java @@ -59,7 +59,8 @@ public class FilteringRenderer { ItemStack filter = behaviour.getFilter(); boolean isFilterSlotted = filter.getItem() instanceof FilterItem; boolean showCount = behaviour.isCountVisible(); - String label = isFilterSlotted ? "" : Lang.translate("logistics.filter"); + String label = isFilterSlotted ? "" + : Lang.translate(behaviour.recipeFilter ? "logistics.recipe_filter" : "logistics.filter"); boolean hit = behaviour.slotPositioning.testHit(state, target.getHitVec() .subtract(new Vec3d(pos))); @@ -104,7 +105,7 @@ public class FilteringRenderer { ItemStack filter = behaviour.getFilter(d); if (filter.isEmpty()) continue; - + sided.fromSide(d); if (!slotPositioning.shouldRender(blockState)) continue; diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index aaece43db..94fb3516b 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -135,6 +135,7 @@ "create.contraptions.cart_movement_mode.rotation_locked": "Lock rotation", "create.logistics.filter": "Filter", + "create.logistics.recipe_filter": "Recipe Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/main/resources/assets/create/models/block/mechanical_crafter/block.json b/src/main/resources/assets/create/models/block/mechanical_crafter/block.json index 66e82001a..42aeb0cb3 100644 --- a/src/main/resources/assets/create/models/block/mechanical_crafter/block.json +++ b/src/main/resources/assets/create/models/block/mechanical_crafter/block.json @@ -7,6 +7,7 @@ "5": "create:block/brass_casing", "6": "create:block/crafter_top", "7": "create:block/crafter_topunderside", + "8": "create:block/smooth_dark_log_top", "particle": "create:block/brass_casing" }, "elements": [ @@ -28,7 +29,7 @@ "from": [0, 0, 10], "to": [16, 16, 16], "faces": { - "north": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#5"}, + "north": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#8"}, "east": {"uv": [0, 10, 16, 16], "rotation": 90, "texture": "#4"}, "south": {"uv": [0, 0, 16, 16], "texture": "#6"}, "west": {"uv": [16, 10, 0, 16], "rotation": 270, "texture": "#4"}, diff --git a/src/main/resources/assets/create/models/block/mechanical_crafter/item.json b/src/main/resources/assets/create/models/block/mechanical_crafter/item.json index 96e325927..f0a221f11 100644 --- a/src/main/resources/assets/create/models/block/mechanical_crafter/item.json +++ b/src/main/resources/assets/create/models/block/mechanical_crafter/item.json @@ -7,7 +7,8 @@ "5": "create:block/brass_casing", "6": "create:block/crafter_top", "7": "create:block/crafter_topunderside", - "particle": "create:block/cogwheel", + "8": "create:block/smooth_dark_log_top", + "particle": "create:block/crafter_top", "1_2": "create:block/cogwheel" }, "elements": [ @@ -33,7 +34,7 @@ "east": {"uv": [0, 10, 16, 16], "texture": "#4"}, "south": {"uv": [0, 10, 16, 16], "texture": "#4"}, "west": {"uv": [0, 10, 16, 16], "texture": "#4"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#5"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#8"}, "down": {"uv": [0, 0, 16, 16], "texture": "#6"} } }, @@ -82,11 +83,11 @@ "from": [4, 16, 4], "to": [5, 17, 12], "faces": { - "north": {"uv": [4, 1, 5, 2], "texture": "#5"}, + "north": {"uv": [5, 2, 6, 3], "texture": "#5"}, "east": {"uv": [2, 1, 10, 2], "texture": "#5"}, - "south": {"uv": [3.5, 1, 4.5, 2], "texture": "#5"}, - "west": {"uv": [2, 1, 10, 2], "texture": "#5"}, - "up": {"uv": [1, 2, 2, 10], "texture": "#5"} + "south": {"uv": [3, 2, 4, 3], "texture": "#5"}, + "west": {"uv": [4, 2, 12, 3], "texture": "#5"}, + "up": {"uv": [2, 4, 3, 12], "texture": "#5"} } }, { @@ -94,11 +95,11 @@ "from": [11, 16, 4], "to": [12, 17, 12], "faces": { - "north": {"uv": [4, 1, 5, 2], "texture": "#5"}, - "east": {"uv": [2, 1, 10, 2], "texture": "#5"}, - "south": {"uv": [3.5, 1, 4.5, 2], "texture": "#5"}, + "north": {"uv": [4, 2, 5, 3], "texture": "#5"}, + "east": {"uv": [3, 2, 11, 3], "texture": "#5"}, + "south": {"uv": [5, 2, 6, 3], "texture": "#5"}, "west": {"uv": [2, 1, 10, 2], "texture": "#5"}, - "up": {"uv": [1, 2, 2, 10], "texture": "#5"} + "up": {"uv": [2, 4, 3, 12], "texture": "#5"} } }, { @@ -106,11 +107,11 @@ "from": [5, 16, 4], "to": [11, 17, 5], "faces": { - "north": {"uv": [3, 1, 9, 2], "texture": "#5"}, + "north": {"uv": [5, 2, 11, 3], "texture": "#5"}, "east": {"uv": [1, 2, 2, 3], "texture": "#5"}, "south": {"uv": [2.5, 1, 8.5, 2], "texture": "#5"}, "west": {"uv": [1, 2, 2, 3], "texture": "#5"}, - "up": {"uv": [2.5, 1, 8.5, 2], "texture": "#5"} + "up": {"uv": [4, 2, 10, 3], "texture": "#5"} } }, { @@ -120,9 +121,9 @@ "faces": { "north": {"uv": [3, 1, 9, 2], "texture": "#5"}, "east": {"uv": [1, 2, 2, 3], "texture": "#5"}, - "south": {"uv": [2.5, 1, 8.5, 2], "texture": "#5"}, + "south": {"uv": [2, 2, 8, 3], "texture": "#5"}, "west": {"uv": [1, 2, 2, 3], "texture": "#5"}, - "up": {"uv": [2.5, 1, 8.5, 2], "texture": "#5"} + "up": {"uv": [5, 2, 11, 3], "texture": "#5"} } }, { diff --git a/src/main/resources/assets/create/models/block/mechanical_press/block.json b/src/main/resources/assets/create/models/block/mechanical_press/block.json index 52e0a616d..113f7348d 100644 --- a/src/main/resources/assets/create/models/block/mechanical_press/block.json +++ b/src/main/resources/assets/create/models/block/mechanical_press/block.json @@ -1,59 +1,60 @@ { - "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", - "textures": { - "gearbox_top": "create:block/gearbox_top", - "gearbox": "create:block/gearbox", - "mechanical_press_top": "create:block/mechanical_press_top", - "mechanical_press_bottom": "create:block/mechanical_press_bottom", - "particle": "create:block/gearbox" - }, - "elements": [ - { - "name": "Top", - "from": [ 0, 14, 0 ], - "to": [ 16, 16, 16 ], - "faces": { - "north": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, - "east": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, - "south": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, - "west": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, - "up": { "texture": "#mechanical_press_top", "uv": [ 0, 0, 16, 16 ] }, - "down": { "texture": "#gearbox", "uv": [ 0, 0, 16, 16 ] } - } - }, - { - "name": "Core", - "from": [ 2, 4, 1 ], - "to": [ 14, 14, 15 ], - "faces": { - "north": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, - "south": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, - "down": { "texture": "#mechanical_press_bottom", "uv": [ 2, 1, 14, 15 ] } - } - }, - { - "name": "Side", - "from": [ 0, 2, 0 ], - "to": [ 2, 14, 16 ], - "faces": { - "north": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, - "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, - "south": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, - "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, - "down": { "texture": "#gearbox_top", "uv": [ 0, 0, 2, 16 ] } - } - }, - { - "name": "Side", - "from": [ 14, 2, 0 ], - "to": [ 16, 14, 16 ], - "faces": { - "north": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, - "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, - "south": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, - "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, - "down": { "texture": "#gearbox_top", "uv": [ 14, 0, 16, 16 ] } - } - } - ] + "credit": "Made with Blockbench", + "textures": { + "4": "create:block/mechanical_press_side", + "gearbox_top": "create:block/gearbox_top", + "particle": "create:block/mechanical_press_side", + "gearbox": "create:block/gearbox", + "mechanical_press_top": "create:block/mechanical_press_top", + "mechanical_press_bottom": "create:block/mechanical_press_bottom" + }, + "elements": [ + { + "name": "Top", + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, + "east": {"uv": [0, 0, 16, 2], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, + "west": {"uv": [0, 0, 16, 2], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#mechanical_press_top"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#gearbox"} + } + }, + { + "name": "Core", + "from": [2, 4, 1], + "to": [14, 14, 15], + "faces": { + "north": {"uv": [2, 2, 14, 12], "texture": "#gearbox"}, + "south": {"uv": [2, 2, 14, 12], "texture": "#gearbox"}, + "down": {"uv": [2, 1, 14, 15], "texture": "#mechanical_press_bottom"} + } + }, + { + "name": "Side", + "from": [0, 2, 0], + "to": [2, 14, 16], + "faces": { + "north": {"uv": [14, 2, 16, 14], "texture": "#gearbox_top"}, + "east": {"uv": [0, 2, 16, 14], "texture": "#4"}, + "south": {"uv": [0, 2, 2, 14], "texture": "#gearbox_top"}, + "west": {"uv": [0, 2, 16, 14], "texture": "#4"}, + "down": {"uv": [0, 0, 2, 16], "texture": "#gearbox_top"} + } + }, + { + "name": "Side", + "from": [14, 2, 0], + "to": [16, 14, 16], + "faces": { + "north": {"uv": [0, 2, 2, 14], "texture": "#gearbox_top"}, + "east": {"uv": [0, 2, 16, 14], "texture": "#4"}, + "south": {"uv": [14, 2, 16, 14], "texture": "#gearbox_top"}, + "west": {"uv": [0, 2, 16, 14], "texture": "#4"}, + "down": {"uv": [14, 0, 16, 16], "texture": "#gearbox_top"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_press/item.json b/src/main/resources/assets/create/models/block/mechanical_press/item.json index e0284b15f..28d22b00d 100644 --- a/src/main/resources/assets/create/models/block/mechanical_press/item.json +++ b/src/main/resources/assets/create/models/block/mechanical_press/item.json @@ -4,13 +4,14 @@ "textures": { "0": "create:block/axis", "1": "create:block/axis_top", + "8": "create:block/mechanical_press_side", "mechanical_press_head": "create:block/mechanical_press_head", "gearbox_top": "create:block/gearbox_top", "mechanical_press_pole": "create:block/mechanical_press_pole", "gearbox": "create:block/gearbox", "mechanical_press_top": "create:block/mechanical_press_top", "mechanical_press_bottom": "create:block/mechanical_press_bottom", - "particle": "create:block/axis" + "particle": "create:block/mechanical_press_side" }, "elements": [ { @@ -19,9 +20,9 @@ "to": [16, 20, 16], "faces": { "north": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, - "east": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, + "east": {"uv": [0, 0, 16, 2], "texture": "#8"}, "south": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, - "west": {"uv": [0, 0, 16, 2], "texture": "#gearbox"}, + "west": {"uv": [0, 0, 16, 2], "texture": "#8"}, "up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#mechanical_press_top"}, "down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#gearbox"} } @@ -42,9 +43,9 @@ "to": [16, 18, 16], "faces": { "north": {"uv": [0, 2, 2, 14], "texture": "#gearbox_top"}, - "east": {"uv": [0, 4, 16, 16], "texture": "#gearbox_top"}, + "east": {"uv": [0, 2, 16, 14], "texture": "#8"}, "south": {"uv": [14, 2, 16, 14], "texture": "#gearbox_top"}, - "west": {"uv": [0, 4, 16, 16], "texture": "#gearbox_top"}, + "west": {"uv": [0, 2, 16, 14], "texture": "#8"}, "down": {"uv": [0, 0, 2, 16], "rotation": 180, "texture": "#gearbox_top"} } }, @@ -54,9 +55,9 @@ "to": [2, 18, 16], "faces": { "north": {"uv": [14, 2, 16, 14], "texture": "#gearbox_top"}, - "east": {"uv": [0, 4, 16, 16], "texture": "#gearbox_top"}, + "east": {"uv": [0, 2, 16, 14], "texture": "#8"}, "south": {"uv": [0, 2, 2, 14], "texture": "#gearbox_top"}, - "west": {"uv": [0, 4, 16, 16], "texture": "#gearbox_top"}, + "west": {"uv": [0, 2, 16, 14], "texture": "#8"}, "down": {"uv": [14, 0, 16, 16], "rotation": 180, "texture": "#gearbox_top"} } }, diff --git a/src/main/resources/assets/create/textures/block/crafter_side.png b/src/main/resources/assets/create/textures/block/crafter_side.png index 7d5eb19af..990a7a721 100644 Binary files a/src/main/resources/assets/create/textures/block/crafter_side.png and b/src/main/resources/assets/create/textures/block/crafter_side.png differ diff --git a/src/main/resources/assets/create/textures/block/crafter_side_connected.png b/src/main/resources/assets/create/textures/block/crafter_side_connected.png index 08c6d9c56..fe3b059fc 100644 Binary files a/src/main/resources/assets/create/textures/block/crafter_side_connected.png and b/src/main/resources/assets/create/textures/block/crafter_side_connected.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_head.png b/src/main/resources/assets/create/textures/block/mechanical_press_head.png index b3a85575e..79c3f488b 100644 Binary files a/src/main/resources/assets/create/textures/block/mechanical_press_head.png and b/src/main/resources/assets/create/textures/block/mechanical_press_head.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_side.png b/src/main/resources/assets/create/textures/block/mechanical_press_side.png new file mode 100644 index 000000000..bdcdead8a Binary files /dev/null and b/src/main/resources/assets/create/textures/block/mechanical_press_side.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_top.png b/src/main/resources/assets/create/textures/block/mechanical_press_top.png index 06b9ed01c..0fe60a215 100644 Binary files a/src/main/resources/assets/create/textures/block/mechanical_press_top.png and b/src/main/resources/assets/create/textures/block/mechanical_press_top.png differ diff --git a/src/main/resources/assets/create/textures/block/mixer_base_side.png b/src/main/resources/assets/create/textures/block/mixer_base_side.png index e635c876b..cb4948b02 100644 Binary files a/src/main/resources/assets/create/textures/block/mixer_base_side.png and b/src/main/resources/assets/create/textures/block/mixer_base_side.png differ diff --git a/src/main/resources/assets/create/textures/block/smooth_dark_log_top.png b/src/main/resources/assets/create/textures/block/smooth_dark_log_top.png new file mode 100644 index 000000000..88d809ae0 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/smooth_dark_log_top.png differ