Merge artifacts

This commit is contained in:
simibubi 2022-05-22 18:17:31 +02:00
parent 841bf3f350
commit 047129eefe
5 changed files with 12 additions and 13 deletions

View file

@ -9,7 +9,6 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankConnectivityHandler;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
@ -114,10 +113,9 @@ public class SteamEngineTileEntity extends SmartTileEntity implements IHaveGoggl
if (tank != null)
source = new WeakReference<>(null);
Direction facing = SteamEngineBlock.getFacing(getBlockState());
FluidTankTileEntity anyTankAt =
FluidTankConnectivityHandler.anyTankAt(level, worldPosition.relative(facing.getOpposite()));
if (anyTankAt != null)
source = new WeakReference<>(tank = anyTankAt);
BlockEntity be = level.getBlockEntity(worldPosition.relative(facing.getOpposite()));
if (be instanceof FluidTankTileEntity tankTe)
source = new WeakReference<>(tank = tankTe);
}
if (tank == null)
return null;

View file

@ -8,7 +8,6 @@ import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.components.steam.SteamJetParticleData;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleExtenderBlock.WhistleExtenderShape;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankConnectivityHandler;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
@ -26,6 +25,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.util.Mth;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
@ -161,10 +161,9 @@ public class WhistleTileEntity extends SmartTileEntity implements IHaveGoggleInf
if (tank != null)
source = new WeakReference<>(null);
Direction facing = WhistleBlock.getAttachedDirection(getBlockState());
FluidTankTileEntity anyTankAt =
FluidTankConnectivityHandler.anyTankAt(level, worldPosition.relative(facing));
if (anyTankAt != null)
source = new WeakReference<>(tank = anyTankAt);
BlockEntity be = level.getBlockEntity(worldPosition.relative(facing));
if (be instanceof FluidTankTileEntity tankTe)
source = new WeakReference<>(tank = tankTe);
}
if (tank == null)
return null;

View file

@ -333,9 +333,9 @@ public class FluidTankBlock extends Block implements IWrenchable, ITE<FluidTankT
public static void updateBoilerState(BlockState pState, Level pLevel, BlockPos tankPos) {
BlockState tankState = pLevel.getBlockState(tankPos);
if (!FluidTankBlock.isTank(tankState))
if (!(tankState.getBlock() instanceof FluidTankBlock tank))
return;
FluidTankTileEntity tankTE = FluidTankConnectivityHandler.anyTankAt(pLevel, tankPos);
FluidTankTileEntity tankTE = tank.getTileEntity(pLevel, tankPos);
if (tankTE == null)
return;
FluidTankTileEntity controllerTE = tankTE.getControllerTE();

View file

@ -521,6 +521,7 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
}
setWindows(window);
onFluidStackChanged(tankInventory.getFluid());
updateBoilerState();
setChanged();
}

View file

@ -211,7 +211,8 @@ public class AllArmInteractionPointTypes {
@Override
public boolean canCreatePoint(Level level, BlockPos pos, BlockState state) {
return AllBlocks.DEPOT.has(state) || AllBlocks.WEIGHTED_EJECTOR.has(state);
return AllBlocks.DEPOT.has(state) || AllBlocks.WEIGHTED_EJECTOR.has(state)
|| AllBlocks.TRACK_STATION.has(state);
}
@Override