mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
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:
parent
8cb5dac2c9
commit
73f41ccce8
9 changed files with 38 additions and 39 deletions
|
@ -55,7 +55,7 @@ public class CTModel extends BakedModelWrapper<IBakedModel> {
|
||||||
CTData data = new CTData();
|
CTData data = new CTData();
|
||||||
|
|
||||||
for (Direction face : Direction.values()) {
|
for (Direction face : Direction.values()) {
|
||||||
if (state.isNormalCube(world, pos) && !Block.shouldSideBeRendered(state, world, pos, face))
|
if (!Block.shouldSideBeRendered(state, world, pos, face))
|
||||||
continue;
|
continue;
|
||||||
CTSpriteShiftEntry spriteShift = behaviour.get(state, face);
|
CTSpriteShiftEntry spriteShift = behaviour.get(state, face);
|
||||||
if (spriteShift == null)
|
if (spriteShift == null)
|
||||||
|
@ -88,9 +88,9 @@ public class CTModel extends BakedModelWrapper<IBakedModel> {
|
||||||
float uShift = spriteShift.getUShift(index);
|
float uShift = spriteShift.getUShift(index);
|
||||||
float vShift = spriteShift.getVShift(index);
|
float vShift = spriteShift.getVShift(index);
|
||||||
|
|
||||||
BakedQuad newQuad = new BakedQuad(Arrays.copyOf(quad.getVertexData(), quad.getVertexData().length),
|
BakedQuad newQuad =
|
||||||
quad.getTintIndex(), quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(),
|
new BakedQuad(Arrays.copyOf(quad.getVertexData(), quad.getVertexData().length), quad.getTintIndex(),
|
||||||
quad.getFormat());
|
quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat());
|
||||||
VertexFormat format = quad.getFormat();
|
VertexFormat format = quad.getFormat();
|
||||||
int[] vertexData = newQuad.getVertexData();
|
int[] vertexData = newQuad.getVertexData();
|
||||||
|
|
||||||
|
|
|
@ -66,10 +66,9 @@ public abstract class RotatedPillarKineticBlock extends KineticBlock {
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||||
Axis preferredAxis = getPreferredAxis(context);
|
Axis preferredAxis = getPreferredAxis(context);
|
||||||
if (preferredAxis != null)
|
if (preferredAxis != null && !context.isPlacerSneaking())
|
||||||
return this.getDefaultState().with(AXIS, preferredAxis);
|
return this.getDefaultState().with(AXIS, preferredAxis);
|
||||||
return this.getDefaultState().with(AXIS, context.isPlacerSneaking() ? context.getFace().getAxis()
|
return this.getDefaultState().with(AXIS, context.getNearestLookingDirection().getAxis());
|
||||||
: context.getNearestLookingDirection().getAxis());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.Movement
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.nbt.NBTUtil;
|
import net.minecraft.nbt.NBTUtil;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
@ -36,6 +37,8 @@ public class BlockBreakingMovementBehaviour extends MovementBehaviour {
|
||||||
if (damageSource == null)
|
if (damageSource == null)
|
||||||
return;
|
return;
|
||||||
for (Entity entity : world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos))) {
|
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);
|
float damage = (float) MathHelper.clamp(Math.abs(context.relativeMotion.length() * 10) + 1, 5, 20);
|
||||||
entity.attackEntityFrom(damageSource, damage);
|
entity.attackEntityFrom(damageSource, damage);
|
||||||
entity.setMotion(entity.getMotion().add(context.relativeMotion.scale(3)));
|
entity.setMotion(entity.getMotion().add(context.relativeMotion.scale(3)));
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.simibubi.create.modules.contraptions.components.contraptions.piston;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllTileEntities;
|
import com.simibubi.create.AllTileEntities;
|
||||||
import com.simibubi.create.foundation.behaviour.ValueBoxTransform;
|
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.foundation.utility.ServerSpeedProvider;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate;
|
import com.simibubi.create.modules.contraptions.base.IRotate;
|
||||||
import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionCollider;
|
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.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Direction.Axis;
|
import net.minecraft.util.Direction.Axis;
|
||||||
|
import net.minecraft.util.Direction.AxisDirection;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
@ -45,7 +47,9 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
|
||||||
|
|
||||||
// Collect Construct
|
// Collect Construct
|
||||||
PistonContraption contraption = PistonContraption.movePistonAt(world, pos, direction, getMovementSpeed() < 0);
|
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) {
|
if (contraption != null) {
|
||||||
BlockPos anchor = contraption.getAnchor().offset(direction, contraption.initialExtensionProgress);
|
BlockPos anchor = contraption.getAnchor().offset(direction, contraption.initialExtensionProgress);
|
||||||
|
@ -99,7 +103,7 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
|
||||||
@Override
|
@Override
|
||||||
public void collided() {
|
public void collided() {
|
||||||
super.collided();
|
super.collided();
|
||||||
if (!running && getSpeed() > 0)
|
if (!running && getMovementSpeed() > 0)
|
||||||
assembleNextTick = true;
|
assembleNextTick = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.simibubi.create.modules.contraptions.relays.advanced.sequencer;
|
package com.simibubi.create.modules.contraptions.relays.advanced.sequencer;
|
||||||
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;
|
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;
|
||||||
|
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
|
@ -14,9 +12,9 @@ public class ConfigureSequencedGearshiftPacket extends TileEntityConfigurationPa
|
||||||
|
|
||||||
private ListNBT instructions;
|
private ListNBT instructions;
|
||||||
|
|
||||||
public ConfigureSequencedGearshiftPacket(BlockPos pos, Vector<Instruction> instructions) {
|
public ConfigureSequencedGearshiftPacket(BlockPos pos, ListNBT instructions) {
|
||||||
super(pos);
|
super(pos);
|
||||||
this.instructions = Instruction.serializeAll(instructions);
|
this.instructions = instructions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigureSequencedGearshiftPacket(PacketBuffer buffer) {
|
public ConfigureSequencedGearshiftPacket(PacketBuffer buffer) {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.ListNBT;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
||||||
|
@ -21,7 +22,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
||||||
private static final ScreenResources background = ScreenResources.SEQUENCER;
|
private static final ScreenResources background = ScreenResources.SEQUENCER;
|
||||||
|
|
||||||
private final String title = Lang.translate("gui.sequenced_gearshift.title");
|
private final String title = Lang.translate("gui.sequenced_gearshift.title");
|
||||||
private int lastModification;
|
private ListNBT compareTag;
|
||||||
private Vector<Instruction> instructions;
|
private Vector<Instruction> instructions;
|
||||||
private BlockPos pos;
|
private BlockPos pos;
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
||||||
public SequencedGearshiftScreen(SequencedGearshiftTileEntity te) {
|
public SequencedGearshiftScreen(SequencedGearshiftTileEntity te) {
|
||||||
this.instructions = te.instructions;
|
this.instructions = te.instructions;
|
||||||
this.pos = te.getPos();
|
this.pos = te.getPos();
|
||||||
lastModification = -1;
|
compareTag = Instruction.serializeAll(instructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -145,21 +146,11 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
||||||
font.drawStringWithShadow(text, guiLeft + x, guiTop + 26 + y, 0xFFFFEE);
|
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() {
|
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
|
@Override
|
||||||
|
@ -176,6 +167,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
|
||||||
private void instructionUpdated(int index, int state) {
|
private void instructionUpdated(int index, int state) {
|
||||||
SequencerInstructions newValue = SequencerInstructions.values()[state];
|
SequencerInstructions newValue = SequencerInstructions.values()[state];
|
||||||
instructions.get(index).instruction = newValue;
|
instructions.get(index).instruction = newValue;
|
||||||
|
instructions.get(index).value = newValue.defaultValue;
|
||||||
updateParamsOfRow(index);
|
updateParamsOfRow(index);
|
||||||
if (newValue == SequencerInstructions.END) {
|
if (newValue == SequencerInstructions.END) {
|
||||||
for (int i = instructions.size() - 1; i > index; i--) {
|
for (int i = instructions.size() - 1; i > index; i--) {
|
||||||
|
|
|
@ -8,9 +8,9 @@ import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
public enum SequencerInstructions {
|
public enum SequencerInstructions {
|
||||||
|
|
||||||
TURN_ANGLE("angle", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 360, 45),
|
TURN_ANGLE("angle", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 360, 45, 90),
|
||||||
TURN_DISTANCE("distance", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 50, 5),
|
TURN_DISTANCE("distance", ScreenResources.SEQUENCER_INSTRUCTION, true, true, 50, 5, 5),
|
||||||
WAIT("duration", ScreenResources.SEQUENCER_WAIT, true, false, 600, 20),
|
WAIT("duration", ScreenResources.SEQUENCER_WAIT, true, false, 600, 20, 10),
|
||||||
END("", ScreenResources.SEQUENCER_END),
|
END("", ScreenResources.SEQUENCER_END),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
@ -22,18 +22,20 @@ public enum SequencerInstructions {
|
||||||
ScreenResources background;
|
ScreenResources background;
|
||||||
int maxValue;
|
int maxValue;
|
||||||
int shiftStep;
|
int shiftStep;
|
||||||
|
int defaultValue;
|
||||||
|
|
||||||
private SequencerInstructions(String parameterName, ScreenResources background) {
|
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,
|
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.hasValueParameter = hasValueParameter;
|
||||||
this.hasSpeedParameter = hasSpeedParameter;
|
this.hasSpeedParameter = hasSpeedParameter;
|
||||||
this.background = background;
|
this.background = background;
|
||||||
this.maxValue = maxValue;
|
this.maxValue = maxValue;
|
||||||
this.shiftStep = shiftStep;
|
this.shiftStep = shiftStep;
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
translationKey = "gui.sequenced_gearshift.instruction." + Lang.asId(name());
|
translationKey = "gui.sequenced_gearshift.instruction." + Lang.asId(name());
|
||||||
parameterKey = translationKey + "." + parameterName;
|
parameterKey = translationKey + "." + parameterName;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +49,7 @@ public enum SequencerInstructions {
|
||||||
|
|
||||||
String formatValue(int value) {
|
String formatValue(int value) {
|
||||||
if (this == TURN_ANGLE)
|
if (this == TURN_ANGLE)
|
||||||
return value + "°";
|
return value + Lang.translate("generic.unit.degrees");
|
||||||
if (this == TURN_DISTANCE)
|
if (this == TURN_DISTANCE)
|
||||||
return value + "m";
|
return value + "m";
|
||||||
if (this == WAIT) {
|
if (this == WAIT) {
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class TreeFertilizerItem extends Item {
|
||||||
if (context.getWorld().getBlockState(actualPos).getBlockHardness(context.getWorld(), actualPos) == -1)
|
if (context.getWorld().getBlockState(actualPos).getBlockHardness(context.getWorld(), actualPos) == -1)
|
||||||
continue;
|
continue;
|
||||||
// Don't replace solid blocks with leaves
|
// Don't replace solid blocks with leaves
|
||||||
if (!world.getBlockState(pos).isNormalCube(world, pos)
|
if (!world.getBlockState(pos).isNormalCube(world, pos) && !context.getWorld().getBlockState(actualPos)
|
||||||
&& context.getWorld().getBlockState(actualPos).isNormalCube(context.getWorld(), actualPos))
|
.getCollisionShape(context.getWorld(), actualPos).isEmpty())
|
||||||
continue;
|
continue;
|
||||||
if (world.getBlockState(pos).getBlock() == Blocks.GRASS_BLOCK
|
if (world.getBlockState(pos).getBlock() == Blocks.GRASS_BLOCK
|
||||||
|| world.getBlockState(pos).getBlock() == Blocks.PODZOL)
|
|| world.getBlockState(pos).getBlock() == Blocks.PODZOL)
|
||||||
|
|
|
@ -312,6 +312,7 @@
|
||||||
"create.generic.unit.minutes": "Minutes",
|
"create.generic.unit.minutes": "Minutes",
|
||||||
"create.generic.unit.rpm": "rpm",
|
"create.generic.unit.rpm": "rpm",
|
||||||
"create.generic.unit.stress": "su",
|
"create.generic.unit.stress": "su",
|
||||||
|
"create.generic.unit.degrees": "°",
|
||||||
|
|
||||||
"create.action.scroll": "Scroll",
|
"create.action.scroll": "Scroll",
|
||||||
"create.action.confirm": "Confirm",
|
"create.action.confirm": "Confirm",
|
||||||
|
|
Loading…
Reference in a new issue