Skip to content

Commit

Permalink
[1.20.3] Move clientPickBlock APIs to client source set. (#3363)
Browse files Browse the repository at this point in the history
* Move clientPickBlock APIs to client source set.

* Fix entrypoints

* Dont move impl class to test lol
  • Loading branch information
modmuss50 authored Oct 8, 2023
1 parent 0e870a0 commit af7e9a6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af7e9a6

Please sign in to comment.