Stonehedge

- Fixed Harvesters hard-colliding with leaves when used with pistons, pulleys or a gantry carriage
- Fixed kinetic tiles not marking chunks for saving when speed or stress changes
- Dedicated Servers no longer create a resourcepack folder
This commit is contained in:
simibubi 2021-12-28 13:04:22 +01:00
parent ffeecfdce0
commit 8e4dcb958d
8 changed files with 52 additions and 29 deletions

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false org.gradle.daemon = false
# mod version info # mod version info
mod_version = 0.4a mod_version = 0.4b
minecraft_version = 1.18.1 minecraft_version = 1.18.1
forge_version = 39.0.8 forge_version = 39.0.8

View file

@ -58,7 +58,7 @@ public class Create {
public static final String ID = "create"; public static final String ID = "create";
public static final String NAME = "Create"; public static final String NAME = "Create";
public static final String VERSION = "0.4a"; public static final String VERSION = "0.4b";
public static final Logger LOGGER = LogManager.getLogger(); public static final Logger LOGGER = LogManager.getLogger();
@ -125,8 +125,6 @@ public class Create {
SchematicInstances.register(); SchematicInstances.register();
BuiltinPotatoProjectileTypes.register(); BuiltinPotatoProjectileTypes.register();
ShippedResourcePacks.extractFiles("Copper Legacy Pack");
event.enqueueWork(() -> { event.enqueueWork(() -> {
AllTriggers.register(); AllTriggers.register();
SchematicProcessor.register(); SchematicProcessor.register();

View file

@ -25,6 +25,7 @@ import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CreateContexts; import com.simibubi.create.foundation.render.CreateContexts;
import com.simibubi.create.foundation.render.SuperByteBufferCache; import com.simibubi.create.foundation.render.SuperByteBufferCache;
import com.simibubi.create.foundation.utility.ModelSwapper; import com.simibubi.create.foundation.utility.ModelSwapper;
import com.simibubi.create.foundation.utility.ShippedResourcePacks;
import com.simibubi.create.foundation.utility.ghost.GhostBlocks; import com.simibubi.create.foundation.utility.ghost.GhostBlocks;
import com.simibubi.create.foundation.utility.outliner.Outliner; import com.simibubi.create.foundation.utility.outliner.Outliner;
@ -81,6 +82,8 @@ public class CreateClient {
BUFFER_CACHE.registerCompartment(SBBContraptionManager.CONTRAPTION, 20); BUFFER_CACHE.registerCompartment(SBBContraptionManager.CONTRAPTION, 20);
BUFFER_CACHE.registerCompartment(WorldSectionElement.DOC_WORLD_SECTION, 20); BUFFER_CACHE.registerCompartment(WorldSectionElement.DOC_WORLD_SECTION, 20);
ShippedResourcePacks.extractFiles("Copper Legacy Pack");
AllKeys.register(); AllKeys.register();
// AllFluids.assignRenderLayers(); // AllFluids.assignRenderLayers();
AllBlockPartials.init(); AllBlockPartials.init();

View file

@ -151,6 +151,7 @@ public class KineticTileEntity extends SmartTileEntity
this.stress = currentStress; this.stress = currentStress;
this.networkSize = networkSize; this.networkSize = networkSize;
boolean overStressed = maxStress < currentStress && StressImpact.isEnabled(); boolean overStressed = maxStress < currentStress && StressImpact.isEnabled();
setChanged();
if (overStressed != this.overStressed) { if (overStressed != this.overStressed) {
float prevSpeed = getSpeed(); float prevSpeed = getSpeed();
@ -181,6 +182,7 @@ public class KineticTileEntity extends SmartTileEntity
boolean directionSwap = !fromOrToZero && Math.signum(previousSpeed) != Math.signum(getSpeed()); boolean directionSwap = !fromOrToZero && Math.signum(previousSpeed) != Math.signum(getSpeed());
if (fromOrToZero || directionSwap) if (fromOrToZero || directionSwap)
flickerTally = getFlickerScore() + 5; flickerTally = getFlickerScore() + 5;
setChanged();
} }
@Override @Override
@ -324,6 +326,7 @@ public class KineticTileEntity extends SmartTileEntity
getOrCreateNetwork().remove(this); getOrCreateNetwork().remove(this);
network = networkIn; network = networkIn;
setChanged();
if (networkIn == null) if (networkIn == null)
return; return;

View file

@ -107,7 +107,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
world.setBlockAndUpdate(pos, cutCrop(world, pos, stateVisited)); world.setBlockAndUpdate(pos, cutCrop(world, pos, stateVisited));
} }
private boolean isValidCrop(Level world, BlockPos pos, BlockState state) { public boolean isValidCrop(Level world, BlockPos pos, BlockState state) {
boolean harvestPartial = AllConfigs.SERVER.kinetics.harvestPartiallyGrown.get(); boolean harvestPartial = AllConfigs.SERVER.kinetics.harvestPartiallyGrown.get();
boolean replant = AllConfigs.SERVER.kinetics.harvesterReplants.get(); boolean replant = AllConfigs.SERVER.kinetics.harvesterReplants.get();
@ -141,7 +141,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
return false; return false;
} }
private boolean isValidOther(Level world, BlockPos pos, BlockState state) { public boolean isValidOther(Level world, BlockPos pos, BlockState state) {
if (state.getBlock() instanceof CropBlock) if (state.getBlock() instanceof CropBlock)
return false; return false;
if (state.getBlock() instanceof SugarCaneBlock) if (state.getBlock() instanceof SugarCaneBlock)

View file

@ -8,6 +8,7 @@ import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.components.actors.AttachedActorBlock; import com.simibubi.create.content.contraptions.components.actors.AttachedActorBlock;
import com.simibubi.create.content.contraptions.components.actors.HarvesterBlock; import com.simibubi.create.content.contraptions.components.actors.HarvesterBlock;
import com.simibubi.create.content.contraptions.components.actors.PloughBlock;
import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceBlock; import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceBlock;
import com.simibubi.create.content.contraptions.components.crank.HandCrankBlock; import com.simibubi.create.content.contraptions.components.crank.HandCrankBlock;
import com.simibubi.create.content.contraptions.components.fan.NozzleBlock; import com.simibubi.create.content.contraptions.components.fan.NozzleBlock;
@ -347,6 +348,11 @@ public class BlockMovementChecks {
return state.getValue(BlockStateProperties.FACING) == facing; return state.getValue(BlockStateProperties.FACING) == facing;
if (AllBlocks.MECHANICAL_BEARING.has(state)) if (AllBlocks.MECHANICAL_BEARING.has(state))
return state.getValue(BlockStateProperties.FACING) == facing; return state.getValue(BlockStateProperties.FACING) == facing;
if (AllBlocks.MECHANICAL_HARVESTER.has(state))
return state.getValue(HarvesterBlock.FACING) == facing;
if (AllBlocks.MECHANICAL_PLOUGH.has(state))
return state.getValue(PloughBlock.FACING) == facing;
if (AllBlocks.CART_ASSEMBLER.has(state)) if (AllBlocks.CART_ASSEMBLER.has(state))
return Direction.DOWN == facing; return Direction.DOWN == facing;
if (AllBlocks.MECHANICAL_SAW.has(state)) if (AllBlocks.MECHANICAL_SAW.has(state))

View file

@ -14,6 +14,7 @@ import com.google.common.base.Predicates;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllMovementBehaviours; import com.simibubi.create.AllMovementBehaviours;
import com.simibubi.create.content.contraptions.components.actors.BlockBreakingMovementBehaviour; import com.simibubi.create.content.contraptions.components.actors.BlockBreakingMovementBehaviour;
import com.simibubi.create.content.contraptions.components.actors.HarvesterMovementBehaviour;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity.ContraptionRotationState; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity.ContraptionRotationState;
import com.simibubi.create.content.contraptions.components.structureMovement.sync.ClientMotionPacket; import com.simibubi.create.content.contraptions.components.structureMovement.sync.ClientMotionPacket;
import com.simibubi.create.foundation.collision.ContinuousOBBCollider.ContinuousSeparationManifold; import com.simibubi.create.foundation.collision.ContinuousOBBCollider.ContinuousSeparationManifold;
@ -242,10 +243,10 @@ public class ContraptionCollider {
boolean hasNormal = !collisionNormal.equals(Vec3.ZERO); boolean hasNormal = !collisionNormal.equals(Vec3.ZERO);
boolean anyCollision = hardCollision || temporalCollision; boolean anyCollision = hardCollision || temporalCollision;
if (bounce > 0 && hasNormal && anyCollision && bounceEntity(entity, collisionNormal, contraptionEntity, bounce)) { if (bounce > 0 && hasNormal && anyCollision
entity.level.playSound(playerType == PlayerType.CLIENT ? (Player) entity : null, && bounceEntity(entity, collisionNormal, contraptionEntity, bounce)) {
entity.getX(), entity.getY(), entity.getZ(), SoundEvents.SLIME_BLOCK_FALL, entity.level.playSound(playerType == PlayerType.CLIENT ? (Player) entity : null, entity.getX(),
SoundSource.BLOCKS, .5f, 1); entity.getY(), entity.getZ(), SoundEvents.SLIME_BLOCK_FALL, SoundSource.BLOCKS, .5f, 1);
continue; continue;
} }
@ -339,25 +340,30 @@ public class ContraptionCollider {
return false; return false;
Vec3 contactPointMotion = contraption.getContactPointMotion(entity.position()); Vec3 contactPointMotion = contraption.getContactPointMotion(entity.position());
Vec3 motion = entity.getDeltaMovement().subtract(contactPointMotion); Vec3 motion = entity.getDeltaMovement()
Vec3 deltav = normal.scale(factor*2*motion.dot(normal)); .subtract(contactPointMotion);
Vec3 deltav = normal.scale(factor * 2 * motion.dot(normal));
if (deltav.dot(deltav) < 0.1f) if (deltav.dot(deltav) < 0.1f)
return false; return false;
entity.setDeltaMovement(entity.getDeltaMovement().subtract(deltav)); entity.setDeltaMovement(entity.getDeltaMovement()
.subtract(deltav));
return true; return true;
} }
public static Vec3 getWorldToLocalTranslation(Entity entity, AbstractContraptionEntity contraptionEntity) { public static Vec3 getWorldToLocalTranslation(Entity entity, AbstractContraptionEntity contraptionEntity) {
return getWorldToLocalTranslation(entity, contraptionEntity.getAnchorVec(), contraptionEntity.getRotationState()); return getWorldToLocalTranslation(entity, contraptionEntity.getAnchorVec(),
contraptionEntity.getRotationState());
} }
public static Vec3 getWorldToLocalTranslation(Entity entity, Vec3 anchorVec, ContraptionRotationState rotation) { public static Vec3 getWorldToLocalTranslation(Entity entity, Vec3 anchorVec, ContraptionRotationState rotation) {
return getWorldToLocalTranslation(entity, anchorVec, rotation.asMatrix(), rotation.getYawOffset()); return getWorldToLocalTranslation(entity, anchorVec, rotation.asMatrix(), rotation.getYawOffset());
} }
public static Vec3 getWorldToLocalTranslation(Entity entity, Vec3 anchorVec, Matrix3d rotationMatrix, float yawOffset) { public static Vec3 getWorldToLocalTranslation(Entity entity, Vec3 anchorVec, Matrix3d rotationMatrix,
float yawOffset) {
Vec3 entityPosition = entity.position(); Vec3 entityPosition = entity.position();
Vec3 centerY = new Vec3(0, entity.getBoundingBox().getYsize() / 2, 0); Vec3 centerY = new Vec3(0, entity.getBoundingBox()
.getYsize() / 2, 0);
Vec3 position = entityPosition; Vec3 position = entityPosition;
position = position.add(centerY); position = position.add(centerY);
position = position.subtract(VecHelper.CENTER_OF_ORIGIN); position = position.subtract(VecHelper.CENTER_OF_ORIGIN);
@ -371,14 +377,16 @@ public class ContraptionCollider {
} }
public static Vec3 getWorldToLocalTranslation(Vec3 entity, AbstractContraptionEntity contraptionEntity) { public static Vec3 getWorldToLocalTranslation(Vec3 entity, AbstractContraptionEntity contraptionEntity) {
return getWorldToLocalTranslation(entity, contraptionEntity.getAnchorVec(), contraptionEntity.getRotationState()); return getWorldToLocalTranslation(entity, contraptionEntity.getAnchorVec(),
contraptionEntity.getRotationState());
} }
public static Vec3 getWorldToLocalTranslation(Vec3 inPos, Vec3 anchorVec, ContraptionRotationState rotation) { public static Vec3 getWorldToLocalTranslation(Vec3 inPos, Vec3 anchorVec, ContraptionRotationState rotation) {
return getWorldToLocalTranslation(inPos, anchorVec, rotation.asMatrix(), rotation.getYawOffset()); return getWorldToLocalTranslation(inPos, anchorVec, rotation.asMatrix(), rotation.getYawOffset());
} }
public static Vec3 getWorldToLocalTranslation(Vec3 inPos, Vec3 anchorVec, Matrix3d rotationMatrix, float yawOffset) { public static Vec3 getWorldToLocalTranslation(Vec3 inPos, Vec3 anchorVec, Matrix3d rotationMatrix,
float yawOffset) {
Vec3 position = inPos; Vec3 position = inPos;
position = position.subtract(VecHelper.CENTER_OF_ORIGIN); position = position.subtract(VecHelper.CENTER_OF_ORIGIN);
position = position.subtract(anchorVec); position = position.subtract(anchorVec);
@ -436,8 +444,7 @@ public class ContraptionCollider {
return entity instanceof LocalPlayer; return entity instanceof LocalPlayer;
} }
private static List<VoxelShape> getPotentiallyCollidedShapes(Level world, Contraption contraption, private static List<VoxelShape> getPotentiallyCollidedShapes(Level world, Contraption contraption, AABB localBB) {
AABB localBB) {
double height = localBB.getYsize(); double height = localBB.getYsize();
double width = localBB.getXsize(); double width = localBB.getXsize();
@ -536,16 +543,24 @@ public class ContraptionCollider {
BlockState collidedState = world.getBlockState(colliderPos); BlockState collidedState = world.getBlockState(colliderPos);
StructureBlockInfo blockInfo = contraption.getBlocks() StructureBlockInfo blockInfo = contraption.getBlocks()
.get(pos); .get(pos);
boolean emptyCollider = collidedState.getCollisionShape(world, pos)
.isEmpty();
if (AllMovementBehaviours.contains(blockInfo.state.getBlock())) { if (AllMovementBehaviours.contains(blockInfo.state.getBlock())) {
MovementBehaviour movementBehaviour = AllMovementBehaviours.of(blockInfo.state.getBlock()); MovementBehaviour movementBehaviour = AllMovementBehaviours.of(blockInfo.state.getBlock());
if (movementBehaviour instanceof BlockBreakingMovementBehaviour) { if (movementBehaviour instanceof BlockBreakingMovementBehaviour) {
BlockBreakingMovementBehaviour behaviour = (BlockBreakingMovementBehaviour) movementBehaviour; BlockBreakingMovementBehaviour behaviour = (BlockBreakingMovementBehaviour) movementBehaviour;
if (!behaviour.canBreak(world, colliderPos, collidedState) if (!behaviour.canBreak(world, colliderPos, collidedState) && !emptyCollider)
&& !collidedState.getCollisionShape(world, pos) return true;
.isEmpty()) { continue;
}
if (movementBehaviour instanceof HarvesterMovementBehaviour) {
HarvesterMovementBehaviour harvesterMovementBehaviour =
(HarvesterMovementBehaviour) movementBehaviour;
if (!harvesterMovementBehaviour.isValidCrop(world, colliderPos, collidedState)
&& !harvesterMovementBehaviour.isValidOther(world, colliderPos, collidedState)
&& !emptyCollider)
return true; return true;
}
continue; continue;
} }
} }
@ -556,9 +571,7 @@ public class ContraptionCollider {
if (collidedState.getBlock() instanceof CocoaBlock) if (collidedState.getBlock() instanceof CocoaBlock)
continue; continue;
if (!collidedState.getMaterial() if (!collidedState.getMaterial()
.isReplaceable() .isReplaceable() && !emptyCollider) {
&& !collidedState.getCollisionShape(world, colliderPos)
.isEmpty()) {
return true; return true;
} }

View file

@ -5,7 +5,7 @@ license="MIT"
[[mods]] [[mods]]
modId="create" modId="create"
version="0.4a" version="0.4b"
displayName="Create" displayName="Create"
#updateJSONURL="" #updateJSONURL=""
displayURL="https://www.curseforge.com/minecraft/mc-mods/create" displayURL="https://www.curseforge.com/minecraft/mc-mods/create"