Merge branch 'mc1.15/dev' into mc1.16/dev

# Conflicts:
#	src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java
This commit is contained in:
grimmauld 2020-10-10 19:45:52 +02:00
commit 88b8e7744f
5 changed files with 28 additions and 16 deletions

View file

@ -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)

View file

@ -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<HandC
return ActionResultType.PASS;
withTileEntityDo(worldIn, pos, te -> te.turn(player.isSneaking()));
player.addExhaustion(getRotationSpeed()/100.f);
player.addExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF());
return ActionResultType.SUCCESS;
}

View file

@ -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() {

View file

@ -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<DepotTileEntity> {
public DepotBlock(Properties p_i48440_1_) {
@ -130,4 +136,18 @@ public class DepotBlock extends Block implements ITE<DepotTileEntity> {
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;
}
}

View file

@ -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.";