mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 06:27:41 +01:00
Merge branch 'mc1.20.1/0.5.1' into mc1.20.1/dev
This commit is contained in:
commit
1935b790dd
13 changed files with 18 additions and 43 deletions
|
@ -545,9 +545,12 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
|
|||
relativeMotion = reverseRotation(relativeMotion, 1);
|
||||
context.relativeMotion = relativeMotion;
|
||||
|
||||
return !BlockPos.containing(previousPosition).equals(gridPosition)
|
||||
|| (context.relativeMotion.length() > 0 || context.contraption instanceof CarriageContraption)
|
||||
&& context.firstMovement;
|
||||
boolean ignoreMotionForFirstMovement =
|
||||
context.contraption instanceof CarriageContraption || actor instanceof PortableStorageInterfaceMovement;
|
||||
|
||||
return !BlockPos.containing(previousPosition)
|
||||
.equals(gridPosition)
|
||||
|| (context.relativeMotion.length() > 0 || ignoreMotionForFirstMovement) && context.firstMovement;
|
||||
}
|
||||
|
||||
public void move(double x, double y, double z) {
|
||||
|
|
|
@ -106,7 +106,7 @@ public class FluidTankBlock extends Block implements IWrenchable, IBE<FluidTankB
|
|||
@Override
|
||||
public int getLightEmission(BlockState state, BlockGetter world, BlockPos pos) {
|
||||
FluidTankBlockEntity tankAt = ConnectivityHandler.partAt(getBlockEntityType(), world, pos);
|
||||
if (tankAt == null)
|
||||
if (tankAt == null || !tankAt.hasLevel())
|
||||
return 0;
|
||||
FluidTankBlockEntity controllerBE = tankAt.getControllerBE();
|
||||
if (controllerBE == null || !controllerBE.window)
|
||||
|
|
|
@ -197,7 +197,7 @@ public class FluidTankBlockEntity extends SmartBlockEntity implements IHaveGoggl
|
|||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public FluidTankBlockEntity getControllerBE() {
|
||||
if (isController())
|
||||
if (isController() || !hasLevel())
|
||||
return this;
|
||||
BlockEntity blockEntity = level.getBlockEntity(controller);
|
||||
if (blockEntity instanceof FluidTankBlockEntity)
|
||||
|
|
|
@ -120,12 +120,6 @@ public class MechanicalCrafterBlockEntity extends KineticBlockEntity {
|
|||
registerAwardables(behaviours, AllAdvancements.CRAFTER, AllAdvancements.CRAFTER_LAZY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateCaps() {
|
||||
inserting.removeListener();
|
||||
super.invalidateCaps();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeedChanged(float previousSpeed) {
|
||||
super.onSpeedChanged(previousSpeed);
|
||||
|
@ -138,7 +132,6 @@ public class MechanicalCrafterBlockEntity extends KineticBlockEntity {
|
|||
|
||||
public void blockChanged() {
|
||||
removeBehaviour(InvManipulationBehaviour.TYPE);
|
||||
inserting.removeListener();
|
||||
inserting = new InvManipulationBehaviour(this, this::getTargetFace);
|
||||
attachBehaviourLate(inserting);
|
||||
}
|
||||
|
|
|
@ -171,6 +171,8 @@ public class DeployerBlockEntity extends KineticBlockEntity {
|
|||
}
|
||||
if (level.isClientSide)
|
||||
return;
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
if (state == State.WAITING) {
|
||||
|
|
|
@ -273,12 +273,6 @@ public class FunnelBlockEntity extends SmartBlockEntity implements IHaveHovering
|
|||
registerAwardables(behaviours, AllAdvancements.FUNNEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateCaps() {
|
||||
invManipulation.removeListener();
|
||||
super.invalidateCaps();
|
||||
}
|
||||
|
||||
private boolean supportsAmountOnFilter() {
|
||||
BlockState blockState = getBlockState();
|
||||
boolean beltFunnelsupportsAmount = false;
|
||||
|
|
|
@ -56,13 +56,6 @@ public class SmartObserverBlockEntity extends SmartBlockEntity {
|
|||
behaviours.add(observedTank = new TankManipulationBehaviour(this, towardBlockFacing).bypassSidedness());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateCaps() {
|
||||
observedInventory.removeListener();
|
||||
observedTank.removeListener();
|
||||
super.invalidateCaps();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
|
|
@ -233,13 +233,6 @@ public class ThresholdSwitchBlockEntity extends SmartBlockEntity {
|
|||
behaviours.add(observedTank = new TankManipulationBehaviour(this, towardBlockFacing).bypassSidedness());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateCaps() {
|
||||
observedInventory.removeListener();
|
||||
observedTank.removeListener();
|
||||
super.invalidateCaps();
|
||||
}
|
||||
|
||||
public float getLevelForDisplay() {
|
||||
return currentLevel == -1 ? 0 : currentLevel;
|
||||
}
|
||||
|
|
|
@ -799,6 +799,8 @@ public class Carriage {
|
|||
}
|
||||
|
||||
private void createEntity(Level level, boolean loadPassengers) {
|
||||
if (positionAnchor != null)
|
||||
serialisedEntity.put("Pos", VecHelper.writeNBT(positionAnchor));
|
||||
Entity entity = EntityType.create(serialisedEntity, level)
|
||||
.orElse(null);
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
|
|||
import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour;
|
||||
import com.simibubi.create.foundation.item.ItemHelper.ExtractionCountMode;
|
||||
import com.simibubi.create.foundation.utility.BlockFace;
|
||||
import com.simibubi.create.foundation.utility.HashableNonNullConsumer;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
@ -80,10 +79,6 @@ public abstract class CapManipulationBehaviourBase<T, S extends CapManipulationB
|
|||
targetCapability = LazyOptional.empty();
|
||||
}
|
||||
|
||||
public void removeListener() {
|
||||
targetCapability.removeListener(new HashableNonNullConsumer<>(this::onHandlerInvalidated, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lazyTick() {
|
||||
super.lazyTick();
|
||||
|
@ -132,8 +127,6 @@ public abstract class CapManipulationBehaviourBase<T, S extends CapManipulationB
|
|||
Capability<T> capability = capability();
|
||||
targetCapability =
|
||||
bypassSided ? invBE.getCapability(capability) : invBE.getCapability(capability, targetBlockFace.getFace());
|
||||
if (targetCapability.isPresent())
|
||||
targetCapability.addListener(new HashableNonNullConsumer<>(this::onHandlerInvalidated, this));
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
|
|
@ -53,11 +53,11 @@ public class FluidHelper {
|
|||
public static boolean isLava(Fluid fluid) {
|
||||
return convertToStill(fluid) == Fluids.LAVA;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isSame(FluidStack fluidStack, FluidStack fluidStack2) {
|
||||
return fluidStack.getFluid() == fluidStack2.getFluid();
|
||||
}
|
||||
|
||||
|
||||
public static boolean isSame(FluidStack fluidStack, Fluid fluid) {
|
||||
return fluidStack.getFluid() == fluid;
|
||||
}
|
||||
|
@ -147,6 +147,8 @@ public class FluidHelper {
|
|||
Fluid fluid = ForgeRegistries.FLUIDS.getValue(id);
|
||||
if (fluid == null)
|
||||
throw new JsonSyntaxException("Unknown fluid '" + id + "'");
|
||||
if (fluid == Fluids.EMPTY)
|
||||
throw new JsonSyntaxException("Invalid empty fluid '" + id + "'");
|
||||
int amount = GsonHelper.getAsInt(json, "amount");
|
||||
FluidStack stack = new FluidStack(fluid, amount);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public abstract class FluidIngredient implements Predicate<FluidStack> {
|
|||
|
||||
public static FluidIngredient deserialize(@Nullable JsonElement je) {
|
||||
if (!isFluidIngredient(je))
|
||||
throw new JsonSyntaxException("Invalid fluid ingredient: " + Objects.toString(je));
|
||||
throw new JsonSyntaxException("Invalid fluid ingredient: " + je);
|
||||
|
||||
JsonObject json = je.getAsJsonObject();
|
||||
FluidIngredient ingredient = json.has("fluidTag") ? new FluidTagIngredient() : new FluidStackIngredient();
|
||||
|
|
|
@ -19,7 +19,7 @@ Technology that empowers the player.'''
|
|||
[[dependencies.create]]
|
||||
modId="forge"
|
||||
mandatory=true
|
||||
versionRange="[47.1.43,)"
|
||||
versionRange="[47.1.3,)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
|
|
Loading…
Reference in a new issue