mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-15 00:14:28 -04:00
[1.20.3] Move clientPickBlock APIs to client source set. (#3363)
* Move clientPickBlock APIs to client source set. * Fix entrypoints * Dont move impl class to test lol
This commit is contained in:
parent
0e870a06e0
commit
af7e9a669d
7 changed files with 8 additions and 8 deletions
fabric-events-interaction-v0/src
client/java/net/fabricmc/fabric
api/event/client/player
impl/event/interaction/client
main/resources
testmod/resources
testmodClient/java/net/fabricmc/fabric/test/client/event/interaction
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.event.interaction;
|
||||
package net.fabricmc.fabric.impl.event.interaction.client;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
|
@ -25,7 +25,7 @@
|
|||
"net.fabricmc.fabric.impl.event.interaction.InteractionEventsRouter"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.event.interaction.InteractionEventsRouterClient"
|
||||
"net.fabricmc.fabric.impl.event.interaction.client.InteractionEventsRouterClient"
|
||||
]
|
||||
},
|
||||
"description": "Events for player interaction with blocks and entities.",
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
"main": [
|
||||
"net.fabricmc.fabric.test.event.interaction.AttackBlockTests",
|
||||
"net.fabricmc.fabric.test.event.interaction.PlayerBreakBlockTests",
|
||||
"net.fabricmc.fabric.test.event.interaction.PlayerPickBlockTests",
|
||||
"net.fabricmc.fabric.test.event.interaction.UseEntityTests"
|
||||
],
|
||||
"fabric-gametest": [
|
||||
"net.fabricmc.fabric.test.event.interaction.FakePlayerTests"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.test.client.event.interaction.ClientPreAttackTests"
|
||||
"net.fabricmc.fabric.test.client.event.interaction.ClientPreAttackTests",
|
||||
"net.fabricmc.fabric.test.client.event.interaction.PlayerPickBlockTests"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.test.event.interaction;
|
||||
package net.fabricmc.fabric.test.client.event.interaction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.event.client.player.ClientPickBlockApplyCallback;
|
||||
|
||||
public class PlayerPickBlockTests implements ModInitializer {
|
||||
public class PlayerPickBlockTests implements ClientModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
public void onInitializeClient() {
|
||||
ClientPickBlockApplyCallback.EVENT.register((player, result, stack) -> {
|
||||
if (player.getStackInHand(Hand.MAIN_HAND).getItem() == Items.DIAMOND) {
|
||||
return new ItemStack(Items.OBSIDIAN);
|
Loading…
Add table
Reference in a new issue