diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index f8b275fe1..232a0e9d6 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -47,8 +47,6 @@ public class AllShapes { .forDirectional(), CRANK = shape(5, 0, 5, 11, 6, 11).add(1, 3, 1, 15, 8, 15) .forDirectional(), - VALVE_HANDLE = shape(1, 0, 1, 15, 5, 15) - .forDirectional(), CART_ASSEMBLER = shape(0, 12, 0, 16, 16, 16).add(-2, 0, 1, 18, 14, 15) .forHorizontalAxis(), STOCKPILE_SWITCH = shape(0, 0, 0, 16, 2, 16).add(1, 0, 1, 15, 16, 15) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java index 7ed95683a..01c590b28 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java @@ -6,6 +6,7 @@ import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.config.AllConfigs; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; @@ -61,7 +62,7 @@ public class HandCrankBlock extends DirectionalKineticBlock implements ITE te.turn(player.isSneaking())); - player.addExhaustion(getRotationSpeed()/100.f); + player.addExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF()); return ActionResultType.SUCCESS; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java index 48cdabe20..2bc864ccc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java @@ -1,21 +1,15 @@ package com.simibubi.create.content.contraptions.components.crank; -import javax.annotation.ParametersAreNonnullByDefault; - import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.AllShapes; -import net.minecraft.block.BlockState; 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; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import javax.annotation.ParametersAreNonnullByDefault; + @ParametersAreNonnullByDefault public class ValveHandleBlock extends HandCrankBlock { private final boolean inCreativeTab; @@ -32,11 +26,6 @@ public class ValveHandleBlock extends HandCrankBlock { super.fillItemGroup(group, p_149666_2_); } - @Override - public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - return AllShapes.VALVE_HANDLE.get(state.get(FACING)); - } - @Override @OnlyIn(Dist.CLIENT) public AllBlockPartials getRenderedHandle() { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java index cce0a0867..43abca968 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; +import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; @@ -28,6 +29,11 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.items.ItemStackHandler; +import javax.annotation.ParametersAreNonnullByDefault; + + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault public class DepotBlock extends Block implements ITE { public DepotBlock(Properties p_i48440_1_) { @@ -130,4 +136,18 @@ public class DepotBlock extends Block implements ITE { itemEntity.remove(); } + @Override + public boolean hasComparatorInputOverride(BlockState state) { + return true; + } + + @Override + public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { + try { + return ItemHelper.calcRedstoneFromInventory(getTileEntity(worldIn, pos).itemHandler); + } catch (TileEntityException ignored) { + } + return 0; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java index 31a728123..fad878c1e 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java @@ -21,6 +21,9 @@ public class CKinetics extends ConfigBase { public ConfigInt generatingFanSpeed = i(16, 0, "generatingFanSpeed", Comments.rpm, Comments.generatingFanSpeed); public ConfigInt inWorldProcessingTime = i(150, 0, "inWorldProcessingTime", Comments.inWorldProcessingTime); + public ConfigGroup crank = group(0, "handCrank", "Hand Crank & Valve Handles"); + public ConfigFloat crankHungerMultiplier = f(.01f, 0, 1, "crankHungerMultiplier", Comments.crankHungerMultiplier); + public ConfigGroup contraptions = group(0, "contraptions", "Moving Contraptions"); public ConfigInt maxBlocksMoved = i(2048, 1, "maxBlocksMoved", Comments.maxBlocksMoved); public ConfigInt maxChassisRange = i(16, 1, "maxChassisRange", Comments.maxChassisRange); @@ -55,6 +58,7 @@ public class CKinetics extends ConfigBase { static String fanRotationArgmax = "Rotation speed at which the maximum stats of fans are reached."; static String generatingFanSpeed = "Rotation speed generated by a vertical fan above fire."; static String inWorldProcessingTime = "Game ticks required for a Fan-based processing recipe to take effect."; + static String crankHungerMultiplier = "multiplier used for calculating exhaustion from speed when a crank is turned."; static String maxBlocksMoved = "Maximum amount of blocks in a structure movable by Pistons, Bearings or other means."; static String maxChassisRange = "Maximum value of a chassis attachment range."; static String maxPistonPoles = "Maximum amount of extension poles behind a Mechanical Piston.";