Playtest Issues

- Connected texture contexts are no longer queried for invisible faces
- Shafts and cogs now place inpendent of the preffered orientation when sneaking
- Moving block breakers no longer apply damage to itementities
- Fixed inconsistent block collision prediction for pistons when assembling
- Sequenced Gearshift no longer resets when UI closed without changes
- Minor Improvements to Seq. Gearshift UI usablilty
- Fixed encoding issues with degree symbol
- Fertilized Trees no longer replace semi-solid/collideable blocks with their leaves
This commit is contained in:
simibubi 2020-03-13 20:33:25 +01:00
parent 8cb5dac2c9
commit 73f41ccce8
9 changed files with 38 additions and 39 deletions

View file

@ -55,7 +55,7 @@ public class CTModel extends BakedModelWrapper<IBakedModel> {
CTData data = new CTData();
for (Direction face : Direction.values()) {
if (state.isNormalCube(world, pos) && !Block.shouldSideBeRendered(state, world, pos, face))
if (!Block.shouldSideBeRendered(state, world, pos, face))
continue;
CTSpriteShiftEntry spriteShift = behaviour.get(state, face);
if (spriteShift == null)
@ -88,9 +88,9 @@ public class CTModel extends BakedModelWrapper<IBakedModel> {
float uShift = spriteShift.getUShift(index);
float vShift = spriteShift.getVShift(index);
BakedQuad newQuad = new BakedQuad(Arrays.copyOf(quad.getVertexData(), quad.getVertexData().length),
quad.getTintIndex(), quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(),
quad.getFormat());
BakedQuad newQuad =
new BakedQuad(Arrays.copyOf(quad.getVertexData(), quad.getVertexData().length), quad.getTintIndex(),
quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat());
VertexFormat format = quad.getFormat();
int[] vertexData = newQuad.getVertexData();

View file

@ -66,10 +66,9 @@ public abstract class RotatedPillarKineticBlock extends KineticBlock {
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
Axis preferredAxis = getPreferredAxis(context);
if (preferredAxis != null)
if (preferredAxis != null && !context.isPlacerSneaking())
return this.getDefaultState().with(AXIS, preferredAxis);
return this.getDefaultState().with(AXIS, context.isPlacerSneaking() ? context.getFace().getAxis()
: context.getNearestLookingDirection().getAxis());
return this.getDefaultState().with(AXIS, context.getNearestLookingDirection().getAxis());
}
@Override

View file

@ -6,6 +6,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.Movement
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.DamageSource;
@ -36,6 +37,8 @@ public class BlockBreakingMovementBehaviour extends MovementBehaviour {
if (damageSource == null)
return;
for (Entity entity : world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos))) {
if (entity instanceof ItemEntity)
return;
float damage = (float) MathHelper.clamp(Math.abs(context.relativeMotion.length() * 10) + 1, 5, 20);
entity.attackEntityFrom(damageSource, damage);
entity.setMotion(entity.getMotion().add(context.relativeMotion.scale(3)));

View file

@ -3,6 +3,7 @@ package com.simibubi.create.modules.contraptions.components.contraptions.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.Debug;
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionCollider;
@ -14,6 +15,7 @@ import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
@ -45,7 +47,9 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
// Collect Construct
PistonContraption contraption = PistonContraption.movePistonAt(world, pos, direction, getMovementSpeed() < 0);
Direction movementDirection = getSpeed() > 0 ? direction : direction.getOpposite();
Direction positive = Direction.getFacingFromAxis(AxisDirection.POSITIVE, direction.getAxis());
Direction movementDirection =
getSpeed() > 0 ^ direction.getAxis() != Axis.Z ? positive : positive.getOpposite();
if (contraption != null) {
BlockPos anchor = contraption.getAnchor().offset(direction, contraption.initialExtensionProgress);
@ -99,7 +103,7 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
@Override
public void collided() {
super.collided();
if (!running && getSpeed() > 0)
if (!running && getMovementSpeed() > 0)
assembleNextTick = true;
}

View file

@ -1,7 +1,5 @@
package com.simibubi.create.modules.contraptions.relays.advanced.sequencer;
import java.util.Vector;
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;
import net.minecraft.nbt.CompoundNBT;
@ -14,9 +12,9 @@ public class ConfigureSequencedGearshiftPacket extends TileEntityConfigurationPa
private ListNBT instructions;
public ConfigureSequencedGearshiftPacket(BlockPos pos, Vector<Instruction> instructions) {
public ConfigureSequencedGearshiftPacket(BlockPos pos, ListNBT instructions) {
super(pos);
this.instructions = Instruction.serializeAll(instructions);
this.instructions = instructions;
}
public ConfigureSequencedGearshiftPacket(PacketBuffer buffer) {

View file

@ -13,6 +13,7 @@ import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.math.BlockPos;
public class SequencedGearshiftScreen extends AbstractSimiScreen {
@ -21,7 +22,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
private static final ScreenResources background = ScreenResources.SEQUENCER;
private final String title = Lang.translate("gui.sequenced_gearshift.title");
private int lastModification;
private ListNBT compareTag;
private Vector<Instruction> instructions;
private BlockPos pos;
@ -30,7 +31,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
public SequencedGearshiftScreen(SequencedGearshiftTileEntity te) {
this.instructions = te.instructions;
this.pos = te.getPos();
lastModification = -1;
compareTag = Instruction.serializeAll(instructions);
}
@Override
@ -145,21 +146,11 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
font.drawStringWithShadow(text, guiLeft + x, guiTop + 26 + y, 0xFFFFEE);
}
@Override
public void tick() {
super.tick();
if (lastModification >= 0)
lastModification++;
if (lastModification >= 20) {
lastModification = -1;
sendPacket();
}
}
public void sendPacket() {
AllPackets.channel.sendToServer(new ConfigureSequencedGearshiftPacket(pos, instructions));
ListNBT serialized = Instruction.serializeAll(instructions);
if (serialized.equals(compareTag))
return;
AllPackets.channel.sendToServer(new ConfigureSequencedGearshiftPacket(pos, serialized));
}
@Override
@ -176,6 +167,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
private void instructionUpdated(int index, int state) {
SequencerInstructions newValue = SequencerInstructions.values()[state];
instructions.get(index).instruction = newValue;
instructions.get(index).value = newValue.defaultValue;
updateParamsOfRow(index);
if (newValue == SequencerInstructions.END) {
for (int i = instructions.size() - 1; i > index; i--) {

View file

@ -8,9 +8,9 @@ import com.simibubi.create.foundation.utility.Lang;
public enum SequencerInstructions {
TURN_ANGLE("angle", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 360, 45),
TURN_DISTANCE("distance", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 50, 5),
WAIT("duration", ScreenResources.SEQUENCER_WAIT, true, false, 600, 20),
TURN_ANGLE("angle", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 360, 45, 90),
TURN_DISTANCE("distance", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 50, 5, 5),
WAIT("duration", ScreenResources.SEQUENCER_WAIT, true, false, 600, 20, 10),
END("", ScreenResources.SEQUENCER_END),
;
@ -22,18 +22,20 @@ public enum SequencerInstructions {
ScreenResources background;
int maxValue;
int shiftStep;
int defaultValue;
private SequencerInstructions(String parameterName, ScreenResources background) {
this(parameterName, background, false, false, -1, -1);
this(parameterName, background, false, false, -1, -1, -1);
}
private SequencerInstructions(String parameterName, ScreenResources background, boolean hasValueParameter,
boolean hasSpeedParameter, int maxValue, int shiftStep) {
boolean hasSpeedParameter, int maxValue, int shiftStep, int defaultValue) {
this.hasValueParameter = hasValueParameter;
this.hasSpeedParameter = hasSpeedParameter;
this.background = background;
this.maxValue = maxValue;
this.shiftStep = shiftStep;
this.defaultValue = defaultValue;
translationKey = "gui.sequenced_gearshift.instruction." + Lang.asId(name());
parameterKey = translationKey + "." + parameterName;
}
@ -44,15 +46,15 @@ public enum SequencerInstructions {
options.add(Lang.translate(entry.translationKey));
return options;
}
String formatValue(int value) {
if (this == TURN_ANGLE)
return value + "°";
return value + Lang.translate("generic.unit.degrees");
if (this == TURN_DISTANCE)
return value + "m";
if (this == WAIT) {
if (value >= 20)
return (value / 20) + "s";
return (value / 20) + "s";
return value + "t";
}
return "" + value;

View file

@ -49,8 +49,8 @@ public class TreeFertilizerItem extends Item {
if (context.getWorld().getBlockState(actualPos).getBlockHardness(context.getWorld(), actualPos) == -1)
continue;
// Don't replace solid blocks with leaves
if (!world.getBlockState(pos).isNormalCube(world, pos)
&& context.getWorld().getBlockState(actualPos).isNormalCube(context.getWorld(), actualPos))
if (!world.getBlockState(pos).isNormalCube(world, pos) && !context.getWorld().getBlockState(actualPos)
.getCollisionShape(context.getWorld(), actualPos).isEmpty())
continue;
if (world.getBlockState(pos).getBlock() == Blocks.GRASS_BLOCK
|| world.getBlockState(pos).getBlock() == Blocks.PODZOL)

View file

@ -312,6 +312,7 @@
"create.generic.unit.minutes": "Minutes",
"create.generic.unit.rpm": "rpm",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.action.scroll": "Scroll",
"create.action.confirm": "Confirm",