You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Provides a ticker that updates campfire workbench block entities each tick.
58
+
*
59
+
* @return a BlockEntityTicker that invokes AbstractWorkbenchEntity.tick for CampfireWorkbenchEntity instances, or `null` if the supplied block entity type does not match the campfire workbench type.
60
+
*/
61
+
@Nullable
62
+
@Override
63
+
public <TextendsBlockEntity> BlockEntityTicker<T> getTicker(Levellevel, BlockStatestate, BlockEntityType<T> type) {
64
+
// This connects the Level's ticking system to your static tick method
// Only spawn the entity at the "Master" position (LOWER + LEFT or LOWER + SINGLE)
96
-
if (state.getValue(HALF) == DoubleBlockHalf.LOWER && state.getValue(TYPE) != ChestType.RIGHT) {
97
-
returnblockEntityType.get().create(pos, state);
98
-
}
99
-
returnnull;
100
-
}
101
-
102
-
/**
103
-
* Handles a player's interaction with the workbench when no item is used.
104
-
*
105
-
* <p>On the client this acknowledges the interaction. On the server this method
106
-
* is a hook for workbench-specific handling; if the workbench processes the
107
-
* interaction it will consume it, otherwise the interaction is passed to other handlers.</p>
108
-
*
109
-
* @param state the block state of the workbench
110
-
* @param level the world in which the interaction occurs
111
-
* @param pos the position of the interacted block
112
-
* @param player the player performing the interaction
113
-
* @param hit the hit result describing the interaction point
114
-
* @return {@code InteractionResult.SUCCESS} on client, {@code InteractionResult.CONSUME} if handled by the workbench, or {@code InteractionResult.PASS} otherwise
0 commit comments