mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 07:27:15 +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)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
if (player.isSpectator())
|
||||||
|
return;
|
||||||
if (mc.level == null)
|
if (mc.level == null)
|
||||||
return;
|
return;
|
||||||
if (!event.isUseItem())
|
if (!event.isUseItem())
|
||||||
|
|
|
@ -428,6 +428,8 @@ public class BeltInventory {
|
||||||
Function<TransportedItemStack, TransportedResult> processFunction) {
|
Function<TransportedItemStack, TransportedResult> processFunction) {
|
||||||
boolean dirty = false;
|
boolean dirty = false;
|
||||||
for (TransportedItemStack transported : items) {
|
for (TransportedItemStack transported : items) {
|
||||||
|
if (toRemove.contains(transported))
|
||||||
|
continue;
|
||||||
ItemStack stackBefore = transported.stack.copy();
|
ItemStack stackBefore = transported.stack.copy();
|
||||||
if (Math.abs(position - transported.beltPosition) >= maxDistanceToPosition)
|
if (Math.abs(position - transported.beltPosition) >= maxDistanceToPosition)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -511,6 +511,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean startControlling(BlockPos controlsLocalPos, Player player) {
|
public boolean startControlling(BlockPos controlsLocalPos, Player player) {
|
||||||
|
if (player == null || player.isSpectator())
|
||||||
|
return false;
|
||||||
if (carriage == null)
|
if (carriage == null)
|
||||||
return false;
|
return false;
|
||||||
if (carriage.train.derailed)
|
if (carriage.train.derailed)
|
||||||
|
|
|
@ -79,6 +79,8 @@ public class TrainRelocator {
|
||||||
LocalPlayer player = mc.player;
|
LocalPlayer player = mc.player;
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
if (player.isSpectator())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!player.position()
|
if (!player.position()
|
||||||
.closerThan(relocatingOrigin, 24) || player.isSteppingCarefully()) {
|
.closerThan(relocatingOrigin, 24) || player.isSteppingCarefully()) {
|
||||||
|
|
|
@ -28,6 +28,8 @@ public class ScheduleItemRetrieval {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (player == null || entity == null)
|
if (player == null || entity == null)
|
||||||
return;
|
return;
|
||||||
|
if (player.isSpectator())
|
||||||
|
return;
|
||||||
|
|
||||||
Entity rootVehicle = entity.getRootVehicle();
|
Entity rootVehicle = entity.getRootVehicle();
|
||||||
if (!(rootVehicle instanceof CarriageContraptionEntity))
|
if (!(rootVehicle instanceof CarriageContraptionEntity))
|
||||||
|
|
Loading…
Reference in a new issue