Clean up global state for cable render mode (#4539)

* Clean up the global state used to hack part interaction into respecting
the player's facade render mode. Make the name more indicative of
what is actually happening.

* Fun.
This commit is contained in:
shartte
2020-08-03 14:46:39 +02:00
committed by GitHub
parent 1801302d8f
commit 872d8d33cb
7 changed files with 50 additions and 29 deletions
+10 -2
View File
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Random;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerEntity;
@@ -55,11 +56,18 @@ public abstract class CommonHelper {
public abstract void postInit();
public abstract CableRenderMode getRenderMode();
public abstract CableRenderMode getCableRenderMode();
public abstract void triggerUpdates();
public abstract void updateRenderMode(PlayerEntity player);
/**
* Sets the player that is currently interacting with a cable or part attached
* to a cable. This will return that player's cable render mode from calls to
* {@link #getCableRenderMode()}, until another player or null is set.
*
* @param player Null to revert to the default cable render mode.
*/
public abstract void setPartInteractionPlayer(@Nullable PlayerEntity player);
public abstract boolean isActionKey(@Nonnull final ActionKey key, InputMappings.Input input);