bug you a pardon?

- Arm Interaction point safety checks
- Trains no longer briefly derail when moving through portals
- Players are now less likely to get stuck in the original dimension when traversing train portals
- Trains no longer track coupling stress between carriages that are currently in different dimensions
- Fixed quark closing double doors when opened (+temporary workaround for 1.18)
- Boilers made of creative fluid tanks now provide a max level water supply
- Crafter ponder scene no longer uses an outdated recipe
- Reduced steam release effect of bogeys that haven't travelled far since the last stop
This commit is contained in:
simibubi 2022-07-11 19:28:25 +02:00
parent f03bf9839c
commit 3153ad2100
17 changed files with 137 additions and 60 deletions

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
# mod version info
mod_version = 0.5.0
mod_version = 0.5.0a
minecraft_version = 1.18.2
forge_version = 40.1.60

View file

@ -5744,3 +5744,4 @@ e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/items/doors.json
bc0917bead5b198feeeaa5c5b92dddae48bbb6f5 data/minecraft/tags/items/stairs.json
d622e97373b1e96632ffb0a312ef04696da0ed4d data/minecraft/tags/items/trapdoors.json
0ec220675cbf8a6eeb47d42b7409395a0cb6ae6e data/minecraft/tags/items/walls.json
e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/quark/tags/blocks/non_double_door.json

View file

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"create:train_door",
"create:framed_glass_door"
]
}

View file

@ -89,7 +89,7 @@ public class AllTags {
public enum NameSpace {
MOD(Create.ID, false, true), FORGE("forge"), TIC("tconstruct")
MOD(Create.ID, false, true), FORGE("forge"), TIC("tconstruct"), QUARK("quark")
;
@ -131,6 +131,7 @@ public class AllTags {
WG_STONE(FORGE),
SLIMY_LOGS(TIC),
NON_DOUBLE_DOOR(NameSpace.QUARK),
;

View file

@ -13,6 +13,7 @@ import com.simibubi.create.compat.curios.Curios;
import com.simibubi.create.content.CreateItemGroup;
import com.simibubi.create.content.contraptions.TorquePropagator;
import com.simibubi.create.content.contraptions.fluids.tank.BoilerHeaters;
import com.simibubi.create.content.curiosities.deco.SlidingDoorBlock;
import com.simibubi.create.content.curiosities.weapons.BuiltinPotatoProjectileTypes;
import com.simibubi.create.content.logistics.RedstoneLinkNetworkHandler;
import com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours;
@ -124,6 +125,8 @@ public class Create {
modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register);
modEventBus.addGenericListener(DataSerializerEntry.class, AllEntityDataSerializers::register);
forgeEventBus.addListener(EventPriority.HIGH, SlidingDoorBlock::stopItQuark);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus));
Mods.CURIOS.executeIfInstalled(() -> Curios::init);

View file

@ -58,6 +58,7 @@ import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.entity.TamableAnimal;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.decoration.HangingEntity;
@ -115,6 +116,17 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
contraption.onEntityCreated(this);
}
@Override
public void move(MoverType pType, Vec3 pPos) {
if (pType == MoverType.SHULKER)
return;
if (pType == MoverType.SHULKER_BOX)
return;
if (pType == MoverType.PISTON)
return;
super.move(pType, pPos);
}
public boolean supportsTerrainCollision() {
return contraption instanceof TranslatingContraption;
}

View file

@ -97,6 +97,9 @@ public class BoilerData {
waterSupply = Math.max(i, waterSupply);
}
if (controller instanceof CreativeFluidTankTileEntity)
waterSupply = waterSupplyPerLevel * 20;
if (getActualHeat(controller.getTotalTankSize()) == 18)
controller.award(AllAdvancements.STEAM_ENGINE_MAXED);

View file

@ -33,6 +33,8 @@ import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.Event.Result;
public class SlidingDoorBlock extends DoorBlock implements IWrenchable, ITE<SlidingDoorTileEntity> {
@ -50,6 +52,24 @@ public class SlidingDoorBlock extends DoorBlock implements IWrenchable, ITE<Slid
public static final BooleanProperty VISIBLE = BooleanProperty.create("visible");
@Deprecated // Remove in 1.19 - Fixes incompatibility with Quarks double door module
public static void stopItQuark(PlayerInteractEvent.RightClickBlock event) {
Player player = event.getPlayer();
Level world = event.getWorld();
if (!world.isClientSide || player.isDiscrete() || event.isCanceled() || event.getResult() == Result.DENY
|| event.getUseBlock() == Result.DENY)
return;
BlockPos pos = event.getPos();
BlockState blockState = world.getBlockState(pos);
if (blockState.getBlock()instanceof SlidingDoorBlock sdb) {
event.setCanceled(true);
event.setCancellationResult(blockState.use(world, player, event.getHand(), event.getHitVec()));
}
}
public SlidingDoorBlock(Properties p_52737_) {
super(p_52737_);
}

View file

@ -85,8 +85,7 @@ public class AllArmInteractionPointTypes {
return type;
}
public static void register() {
}
public static void register() {}
//
@ -229,7 +228,8 @@ public class AllArmInteractionPointTypes {
public boolean canCreatePoint(Level level, BlockPos pos, BlockState state) {
return state.getBlock() instanceof AbstractFunnelBlock
&& !(state.hasProperty(FunnelBlock.EXTRACTING) && state.getValue(FunnelBlock.EXTRACTING))
&& !(state.hasProperty(BeltFunnelBlock.SHAPE) && state.getValue(BeltFunnelBlock.SHAPE) == Shape.PUSHING);
&& !(state.hasProperty(BeltFunnelBlock.SHAPE)
&& state.getValue(BeltFunnelBlock.SHAPE) == Shape.PUSHING);
}
@Override
@ -338,13 +338,13 @@ public class AllArmInteractionPointTypes {
//
public static class DepositOnlyArmInteractionPoint extends ArmInteractionPoint {
public DepositOnlyArmInteractionPoint(ArmInteractionPointType type, Level level, BlockPos pos, BlockState state) {
public DepositOnlyArmInteractionPoint(ArmInteractionPointType type, Level level, BlockPos pos,
BlockState state) {
super(type, level, pos, state);
}
@Override
public void cycleMode() {
}
public void cycleMode() {}
@Override
public ItemStack extract(int slot, int amount, boolean simulate) {
@ -364,7 +364,8 @@ public class AllArmInteractionPointTypes {
@Override
protected Vec3 getInteractionPositionVector() {
return Vec3.atLowerCornerOf(pos).add(.5f, 1, .5f);
return Vec3.atLowerCornerOf(pos)
.add(.5f, 1, .5f);
}
}
@ -402,7 +403,8 @@ public class AllArmInteractionPointTypes {
@Override
public ItemStack insert(ItemStack stack, boolean simulate) {
ItemStack input = stack.copy();
InteractionResultHolder<ItemStack> res = BlazeBurnerBlock.tryInsert(cachedState, level, pos, input, false, false, simulate);
InteractionResultHolder<ItemStack> res =
BlazeBurnerBlock.tryInsert(cachedState, level, pos, input, false, false, simulate);
ItemStack remainder = res.getObject();
if (input.isEmpty()) {
return remainder;
@ -421,14 +423,15 @@ public class AllArmInteractionPointTypes {
@Override
protected Direction getInteractionDirection() {
return cachedState.getValue(MechanicalCrafterBlock.HORIZONTAL_FACING)
return cachedState.getOptionalValue(MechanicalCrafterBlock.HORIZONTAL_FACING)
.orElse(Direction.SOUTH)
.getOpposite();
}
@Override
protected Vec3 getInteractionPositionVector() {
return super.getInteractionPositionVector()
.add(Vec3.atLowerCornerOf(getInteractionDirection().getNormal()).scale(.5f));
return super.getInteractionPositionVector().add(Vec3.atLowerCornerOf(getInteractionDirection().getNormal())
.scale(.5f));
}
@Override
@ -460,14 +463,15 @@ public class AllArmInteractionPointTypes {
@Override
protected Direction getInteractionDirection() {
return cachedState.getValue(DeployerBlock.FACING)
return cachedState.getOptionalValue(DeployerBlock.FACING)
.orElse(Direction.UP)
.getOpposite();
}
@Override
protected Vec3 getInteractionPositionVector() {
return super.getInteractionPositionVector()
.add(Vec3.atLowerCornerOf(getInteractionDirection().getNormal()).scale(.65f));
return super.getInteractionPositionVector().add(Vec3.atLowerCornerOf(getInteractionDirection().getNormal())
.scale(.65f));
}
@Override
@ -486,7 +490,8 @@ public class AllArmInteractionPointTypes {
@Override
protected Vec3 getInteractionPositionVector() {
return Vec3.atLowerCornerOf(pos).add(.5f, 14 / 16f, .5f);
return Vec3.atLowerCornerOf(pos)
.add(.5f, 14 / 16f, .5f);
}
}
@ -499,7 +504,8 @@ public class AllArmInteractionPointTypes {
protected Vec3 getInteractionPositionVector() {
return VecHelper.getCenterOf(pos)
.add(Vec3.atLowerCornerOf(FunnelBlock.getFunnelFacing(cachedState)
.getNormal()).scale(-.15f));
.getNormal())
.scale(-.15f));
}
@Override
@ -520,7 +526,8 @@ public class AllArmInteractionPointTypes {
public ItemStack insert(ItemStack stack, boolean simulate) {
FilteringBehaviour filtering = TileEntityBehaviour.get(level, pos, FilteringBehaviour.TYPE);
InvManipulationBehaviour inserter = TileEntityBehaviour.get(level, pos, InvManipulationBehaviour.TYPE);
if (cachedState.getOptionalValue(BlockStateProperties.POWERED).orElse(false))
if (cachedState.getOptionalValue(BlockStateProperties.POWERED)
.orElse(false))
return stack;
if (inserter == null)
return stack;
@ -570,7 +577,8 @@ public class AllArmInteractionPointTypes {
return remainder;
}
ItemStack remainder = stack.copy();
campfireBE.placeFood(remainder, recipe.get().getCookingTime());
campfireBE.placeFood(remainder, recipe.get()
.getCookingTime());
return remainder;
}
}
@ -582,7 +590,8 @@ public class AllArmInteractionPointTypes {
@Override
protected Vec3 getInteractionPositionVector() {
return Vec3.atLowerCornerOf(pos).add(.5f, 13 / 16f, .5f);
return Vec3.atLowerCornerOf(pos)
.add(.5f, 13 / 16f, .5f);
}
@Override
@ -624,7 +633,8 @@ public class AllArmInteractionPointTypes {
Item item = stack.getItem();
if (!(item instanceof RecordItem))
return stack;
if (cachedState.getValue(JukeboxBlock.HAS_RECORD))
if (cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD)
.orElse(true))
return stack;
BlockEntity blockEntity = level.getBlockEntity(pos);
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
@ -644,7 +654,8 @@ public class AllArmInteractionPointTypes {
@Override
public ItemStack extract(int slot, int amount, boolean simulate) {
if (!cachedState.getValue(JukeboxBlock.HAS_RECORD))
if (!cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD)
.orElse(false))
return ItemStack.EMPTY;
BlockEntity blockEntity = level.getBlockEntity(pos);
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
@ -668,14 +679,16 @@ public class AllArmInteractionPointTypes {
@Override
protected Vec3 getInteractionPositionVector() {
return Vec3.atLowerCornerOf(pos).add(.5f, 1, .5f);
return Vec3.atLowerCornerOf(pos)
.add(.5f, 1, .5f);
}
@Override
public ItemStack insert(ItemStack stack, boolean simulate) {
if (!stack.is(Items.GLOWSTONE))
return stack;
if (cachedState.getValue(RespawnAnchorBlock.CHARGE) == 4)
if (cachedState.getOptionalValue(RespawnAnchorBlock.CHARGE)
.orElse(4) == 4)
return stack;
if (!simulate)
RespawnAnchorBlock.charge(level, pos, cachedState);

View file

@ -18,6 +18,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.mutable.MutableDouble;
import com.jozufozu.flywheel.repack.joml.Math;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
import com.simibubi.create.content.contraptions.components.structureMovement.train.TrainCargoManager;
import com.simibubi.create.content.logistics.trains.DimensionPalette;
@ -734,9 +735,9 @@ public class Carriage {
if (sp.level.dimension()
.equals(other.getKey()))
continue;
if (otherDce.pivot == null)
Vec3 loc = otherDce.pivot == null ? otherDce.positionAnchor : otherDce.pivot.getLocation();
if (loc == null)
continue;
Vec3 loc = otherDce.pivot.getLocation();
ServerLevel level = sLevel.getServer()
.getLevel(other.getKey());
sp.teleportTo(level, loc.x, loc.y, loc.z, sp.getYRot(), sp.getXRot());

View file

@ -683,9 +683,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
boolean stationMessage = false;
private void displayApproachStationMessage(Player player, GlobalStation station) {
sendPrompt(player,
Lang.translateDirect("contraption.controls.approach_station", new KeybindComponent("key.jump"), station.name),
false);
sendPrompt(player, Lang.translateDirect("contraption.controls.approach_station",
new KeybindComponent("key.jump"), station.name), false);
stationMessage = true;
}
@ -728,6 +727,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
this.carriageIndex = carriage.train.carriages.indexOf(carriage);
if (contraption instanceof CarriageContraption cc)
cc.swapStorageAfterAssembly(this);
if (carriage.train.graph != null)
entityData.set(TRACK_GRAPH, Optional.of(carriage.train.graph.id));
DimensionalCarriageEntity dimensional = carriage.getDimensional(level);
dimensional.pivot = null;

View file

@ -53,7 +53,7 @@ public class CarriageParticles {
if (stopped) {
if (!arrived) {
arrived = true;
depressurise = 20;
depressurise = (int) (20 * entity.getCarriage().train.accumulatedSteamRelease / 10f);
}
} else
depressurise = 0;

View file

@ -61,10 +61,19 @@ public class CarriageSounds {
.subtract(entity.getPrevPositionVec());
Vec3 combinedMotion = contraptionMotion.subtract(camEntity.getDeltaMovement());
Train train = entity.getCarriage().train;
if (arrived && contraptionMotion.length() > 0.01f)
arrived = false;
if (arrived && entity.carriageIndex == 0)
train.accumulatedSteamRelease /= 2;
arrived |= entity.isStalled();
if (entity.carriageIndex == 0)
train.accumulatedSteamRelease = (float) Math
.min(train.accumulatedSteamRelease + Math.min(0.5f, Math.abs(contraptionMotion.length() / 10f)), 10);
Vec3 toBogey1 = leadingAnchor.subtract(cam);
Vec3 toBogey2 = trailingAnchor.subtract(cam);
double distance1 = toBogey1.length();
@ -103,13 +112,14 @@ public class CarriageSounds {
AllSoundEvents.STEAM.playAt(entity.level, soundLocation, v * 1.5f, .8f, false);
}
if (!arrived && speedFactor.getValue() < .002f) {
if (!arrived && speedFactor.getValue() < .002f && train.accumulatedSteamRelease > 1) {
arrived = true;
float releaseVolume = train.accumulatedSteamRelease / 10f;
entity.level.playLocalSound(soundLocation.x, soundLocation.y, soundLocation.z, SoundEvents.LAVA_EXTINGUISH,
SoundSource.NEUTRAL, .25f, .78f, false);
SoundSource.NEUTRAL, .25f * releaseVolume, .78f, false);
entity.level.playLocalSound(soundLocation.x, soundLocation.y, soundLocation.z,
SoundEvents.WOODEN_TRAPDOOR_CLOSE, SoundSource.NEUTRAL, .2f, 1.5f, false);
AllSoundEvents.STEAM.playAt(entity.level, soundLocation, .75f, .5f, false);
SoundEvents.WOODEN_TRAPDOOR_CLOSE, SoundSource.NEUTRAL, .2f * releaseVolume, 1.5f, false);
AllSoundEvents.STEAM.playAt(entity.level, soundLocation, .75f * releaseVolume, .5f, false);
}
float pitchModifier = ((entity.getId() * 10) % 13) / 36f;
@ -123,7 +133,6 @@ public class CarriageSounds {
volume = Math.min(volume, distanceFactor.getValue() / 1000);
Train train = entity.getCarriage().train;
for (Carriage carriage : train.carriages) {
DimensionalCarriageEntity mainDCE = carriage.getDimensionalIfPresent(entity.level.dimension());
if (mainDCE == null)

View file

@ -124,6 +124,8 @@ public class Train {
public Boolean lowHonk;
public int honkPitch;
public float accumulatedSteamRelease;
int tickOffset;
double[] stress;
@ -296,6 +298,8 @@ public class Train {
ResourceKey<Level> d = b ? d1 : d2;
if (!b && d1.equals(d2))
continue;
if (!d1.equals(d2))
continue;
DimensionalCarriageEntity dimensional = carriage.getDimensionalIfPresent(d);
DimensionalCarriageEntity dimensional2 = previousCarriage.getDimensionalIfPresent(d);
@ -312,6 +316,7 @@ public class Train {
}
}
if (entries > 0)
actual = total / entries;
@ -367,6 +372,7 @@ public class Train {
toFollowBackward == null ? navigation::control : mp -> mp.follow(toFollowBackward);
double totalStress = derailed ? 0 : leadingStress + trailingStress;
boolean first = i == 0;
boolean last = i == carriageCount - 1;
int carriageType = first ? last ? Carriage.BOTH : Carriage.FIRST : last ? Carriage.LAST : Carriage.MIDDLE;

View file

@ -124,6 +124,7 @@ public class BuilderTransformers {
.onRegister(movementBehaviour(new SlidingDoorMovementBehaviour()))
.tag(BlockTags.DOORS)
.tag(BlockTags.WOODEN_DOORS) // for villager AI
.tag(AllBlockTags.NON_DOUBLE_DOOR.tag)
.loot((lr, block) -> lr.add(block, BlockLoot.createDoorTable(block)))
.item()
.tag(ItemTags.DOORS)

View file

@ -3,7 +3,6 @@ package com.simibubi.create.foundation.ponder.content;
import java.util.Collection;
import com.google.common.collect.ImmutableList;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterBlock;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity;
@ -162,10 +161,11 @@ public class CrafterScenes {
.placeNearTarget();
scene.idle(60);
ItemStack alloy = AllItems.ANDESITE_ALLOY.asStack();
ItemStack log = new ItemStack(Items.OAK_LOG);
ItemStack redstoneDust = new ItemStack(Items.REDSTONE);
ItemStack iron = new ItemStack(Items.IRON_INGOT);
ItemStack cobble = new ItemStack(Items.COBBLESTONE);
scene.world.setCraftingResult(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.asStack(4));
scene.world.setCraftingResult(util.grid.at(1, 1, 2), new ItemStack(Items.PISTON));
scene.world.modifyTileEntity(util.grid.at(2, 3, 2), type, mct -> mct.getInventory()
.insertItem(0, planks.copy(), false));
@ -174,22 +174,22 @@ public class CrafterScenes {
.insertItem(0, planks.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(3, 2, 2), type, mct -> mct.getInventory()
.insertItem(0, alloy.copy(), false));
.insertItem(0, cobble.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(2, 2, 2), type, mct -> mct.getInventory()
.insertItem(0, log.copy(), false));
.insertItem(0, iron.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(1, 2, 2), type, mct -> mct.getInventory()
.insertItem(0, alloy.copy(), false));
.insertItem(0, cobble.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(1, 1, 2), type, mct -> mct.getInventory()
.insertItem(0, planks.copy(), false));
.insertItem(0, cobble.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(2, 1, 2), type, mct -> mct.getInventory()
.insertItem(0, planks.copy(), false));
.insertItem(0, redstoneDust.copy(), false));
scene.idle(5);
scene.world.modifyTileEntity(util.grid.at(3, 1, 2), type, mct -> mct.getInventory()
.insertItem(0, planks.copy(), false));
.insertItem(0, cobble.copy(), false));
scene.overlay.showText(80)
.attachKeyFrame()
@ -201,7 +201,6 @@ public class CrafterScenes {
scene.world.removeItemsFromBelt(depotPos);
ItemStack stick = new ItemStack(Items.STICK);
ItemStack iron = new ItemStack(Items.IRON_INGOT);
scene.world.setCraftingResult(util.grid.at(1, 1, 2), new ItemStack(Items.IRON_PICKAXE));
@ -395,11 +394,11 @@ public class CrafterScenes {
scene.idle(20);
scene.overlay.showText(90)
.attachKeyFrame()
.colored(PonderPalette.GREEN)
.pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH))
.text("Using Slot Covers, Crafters can be set to act as an Empty Slot in the arrangement")
.placeNearTarget();
.attachKeyFrame()
.colored(PonderPalette.GREEN)
.pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH))
.text("Using Slot Covers, Crafters can be set to act as an Empty Slot in the arrangement")
.placeNearTarget();
scene.idle(100);
scene.overlay
.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH)

View file

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