mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
Double Trouble
- Fixed an item duplication issue with belts - Spectators can no longer interact with contraptions
This commit is contained in:
parent
c55cdd2bac
commit
c36c4e756e
5 changed files with 10 additions and 0 deletions
|
@ -75,6 +75,8 @@ public class ContraptionHandlerClient {
|
|||
|
||||
if (player == null)
|
||||
return;
|
||||
if (player.isSpectator())
|
||||
return;
|
||||
if (mc.level == null)
|
||||
return;
|
||||
if (!event.isUseItem())
|
||||
|
|
|
@ -428,6 +428,8 @@ public class BeltInventory {
|
|||
Function<TransportedItemStack, TransportedResult> processFunction) {
|
||||
boolean dirty = false;
|
||||
for (TransportedItemStack transported : items) {
|
||||
if (toRemove.contains(transported))
|
||||
continue;
|
||||
ItemStack stackBefore = transported.stack.copy();
|
||||
if (Math.abs(position - transported.beltPosition) >= maxDistanceToPosition)
|
||||
continue;
|
||||
|
|
|
@ -511,6 +511,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
|
||||
@Override
|
||||
public boolean startControlling(BlockPos controlsLocalPos, Player player) {
|
||||
if (player == null || player.isSpectator())
|
||||
return false;
|
||||
if (carriage == null)
|
||||
return false;
|
||||
if (carriage.train.derailed)
|
||||
|
|
|
@ -79,6 +79,8 @@ public class TrainRelocator {
|
|||
LocalPlayer player = mc.player;
|
||||
if (player == null)
|
||||
return;
|
||||
if (player.isSpectator())
|
||||
return;
|
||||
|
||||
if (!player.position()
|
||||
.closerThan(relocatingOrigin, 24) || player.isSteppingCarefully()) {
|
||||
|
|
|
@ -28,6 +28,8 @@ public class ScheduleItemRetrieval {
|
|||
Player player = event.getPlayer();
|
||||
if (player == null || entity == null)
|
||||
return;
|
||||
if (player.isSpectator())
|
||||
return;
|
||||
|
||||
Entity rootVehicle = entity.getRootVehicle();
|
||||
if (!(rootVehicle instanceof CarriageContraptionEntity))
|
||||
|
|
Loading…
Reference in a new issue