Class VibrationListener
java.lang.Object
net.minecraft.world.level.gameevent.vibrations.VibrationListener
- All Implemented Interfaces:
GameEventListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.level.gameevent.GameEventListener
GameEventListener.DeliveryMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final VibrationListener.VibrationListenerConfig
protected VibrationInfo
protected final int
protected final PositionSource
private final VibrationSelector
protected int
static final it.unimi.dsi.fastutil.objects.Object2IntMap<GameEvent>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionVibrationListener
(PositionSource p_248645_, int p_250290_, VibrationListener.VibrationListenerConfig p_249414_) private
VibrationListener
(PositionSource p_252286_, int p_249404_, VibrationListener.VibrationListenerConfig p_251761_, VibrationInfo p_250360_, VibrationSelector p_250234_, int p_248651_) -
Method Summary
Modifier and TypeMethodDescriptionstatic com.mojang.serialization.Codec<VibrationListener>
codec
(VibrationListener.VibrationListenerConfig p_223782_) void
forceGameEvent
(ServerLevel p_250726_, GameEvent p_251544_, GameEvent.Context p_250365_, Vec3 p_249607_) static int
getGameEventFrequency
(GameEvent p_252168_) int
boolean
handleGameEvent
(ServerLevel p_251930_, GameEvent p_250161_, GameEvent.Context p_251443_, Vec3 p_250045_) private static boolean
isOccluded
(Level p_223776_, Vec3 p_223777_, Vec3 p_223778_) void
scheduleVibration
(ServerLevel p_250210_, GameEvent p_251063_, GameEvent.Context p_249354_, Vec3 p_250310_, Vec3 p_249553_) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.gameevent.GameEventListener
getDeliveryMode
-
Field Details
-
VIBRATION_FREQUENCY_FOR_EVENT
public static final it.unimi.dsi.fastutil.objects.Object2IntMap<GameEvent> VIBRATION_FREQUENCY_FOR_EVENT -
listenerSource
-
listenerRange
protected final int listenerRange -
config
-
currentVibration
-
travelTimeInTicks
protected int travelTimeInTicks -
selectionStrategy
-
-
Constructor Details
-
VibrationListener
private VibrationListener(PositionSource p_252286_, int p_249404_, VibrationListener.VibrationListenerConfig p_251761_, @Nullable VibrationInfo p_250360_, VibrationSelector p_250234_, int p_248651_) -
VibrationListener
public VibrationListener(PositionSource p_248645_, int p_250290_, VibrationListener.VibrationListenerConfig p_249414_)
-
-
Method Details
-
codec
public static com.mojang.serialization.Codec<VibrationListener> codec(VibrationListener.VibrationListenerConfig p_223782_) -
getGameEventFrequency
-
tick
-
getListenerSource
- Specified by:
getListenerSource
in interfaceGameEventListener
-
getListenerRadius
public int getListenerRadius()- Specified by:
getListenerRadius
in interfaceGameEventListener
-
handleGameEvent
public boolean handleGameEvent(ServerLevel p_251930_, GameEvent p_250161_, GameEvent.Context p_251443_, Vec3 p_250045_) - Specified by:
handleGameEvent
in interfaceGameEventListener
-
forceGameEvent
public void forceGameEvent(ServerLevel p_250726_, GameEvent p_251544_, GameEvent.Context p_250365_, Vec3 p_249607_) -
scheduleVibration
public void scheduleVibration(ServerLevel p_250210_, GameEvent p_251063_, GameEvent.Context p_249354_, Vec3 p_250310_, Vec3 p_249553_) -
isOccluded
-