Merge artifacts
This commit is contained in:
parent
841bf3f350
commit
047129eefe
5 changed files with 12 additions and 13 deletions
|
@ -9,7 +9,6 @@ import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
||||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
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.fluids.tank.FluidTankTileEntity;
|
||||||
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
|
@ -114,10 +113,9 @@ public class SteamEngineTileEntity extends SmartTileEntity implements IHaveGoggl
|
||||||
if (tank != null)
|
if (tank != null)
|
||||||
source = new WeakReference<>(null);
|
source = new WeakReference<>(null);
|
||||||
Direction facing = SteamEngineBlock.getFacing(getBlockState());
|
Direction facing = SteamEngineBlock.getFacing(getBlockState());
|
||||||
FluidTankTileEntity anyTankAt =
|
BlockEntity be = level.getBlockEntity(worldPosition.relative(facing.getOpposite()));
|
||||||
FluidTankConnectivityHandler.anyTankAt(level, worldPosition.relative(facing.getOpposite()));
|
if (be instanceof FluidTankTileEntity tankTe)
|
||||||
if (anyTankAt != null)
|
source = new WeakReference<>(tank = tankTe);
|
||||||
source = new WeakReference<>(tank = anyTankAt);
|
|
||||||
}
|
}
|
||||||
if (tank == null)
|
if (tank == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -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.SteamJetParticleData;
|
||||||
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
|
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.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.fluids.tank.FluidTankTileEntity;
|
||||||
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
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.Component;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
import net.minecraft.network.chat.TextComponent;
|
||||||
import net.minecraft.util.Mth;
|
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.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
@ -161,10 +161,9 @@ public class WhistleTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
||||||
if (tank != null)
|
if (tank != null)
|
||||||
source = new WeakReference<>(null);
|
source = new WeakReference<>(null);
|
||||||
Direction facing = WhistleBlock.getAttachedDirection(getBlockState());
|
Direction facing = WhistleBlock.getAttachedDirection(getBlockState());
|
||||||
FluidTankTileEntity anyTankAt =
|
BlockEntity be = level.getBlockEntity(worldPosition.relative(facing));
|
||||||
FluidTankConnectivityHandler.anyTankAt(level, worldPosition.relative(facing));
|
if (be instanceof FluidTankTileEntity tankTe)
|
||||||
if (anyTankAt != null)
|
source = new WeakReference<>(tank = tankTe);
|
||||||
source = new WeakReference<>(tank = anyTankAt);
|
|
||||||
}
|
}
|
||||||
if (tank == null)
|
if (tank == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -333,9 +333,9 @@ public class FluidTankBlock extends Block implements IWrenchable, ITE<FluidTankT
|
||||||
|
|
||||||
public static void updateBoilerState(BlockState pState, Level pLevel, BlockPos tankPos) {
|
public static void updateBoilerState(BlockState pState, Level pLevel, BlockPos tankPos) {
|
||||||
BlockState tankState = pLevel.getBlockState(tankPos);
|
BlockState tankState = pLevel.getBlockState(tankPos);
|
||||||
if (!FluidTankBlock.isTank(tankState))
|
if (!(tankState.getBlock() instanceof FluidTankBlock tank))
|
||||||
return;
|
return;
|
||||||
FluidTankTileEntity tankTE = FluidTankConnectivityHandler.anyTankAt(pLevel, tankPos);
|
FluidTankTileEntity tankTE = tank.getTileEntity(pLevel, tankPos);
|
||||||
if (tankTE == null)
|
if (tankTE == null)
|
||||||
return;
|
return;
|
||||||
FluidTankTileEntity controllerTE = tankTE.getControllerTE();
|
FluidTankTileEntity controllerTE = tankTE.getControllerTE();
|
||||||
|
|
|
@ -521,6 +521,7 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI
|
||||||
}
|
}
|
||||||
setWindows(window);
|
setWindows(window);
|
||||||
onFluidStackChanged(tankInventory.getFluid());
|
onFluidStackChanged(tankInventory.getFluid());
|
||||||
|
updateBoilerState();
|
||||||
setChanged();
|
setChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,8 @@ public class AllArmInteractionPointTypes {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canCreatePoint(Level level, BlockPos pos, BlockState state) {
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue