Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit aca5139

Browse files
committed
Revert "Added LeftClickEmpty. (#197)"
This reverts commit cf02fa1
1 parent 3794f3a commit aca5139

File tree

6 files changed

+11
-65
lines changed

6 files changed

+11
-65
lines changed

patchwork-events-entity/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ public Direction getFace() {
9292
}
9393

9494
/**
95-
* @return The effective, i.e. logical, side of this interaction. This will be {@link LogicalSide#CLIENT} on the client thread, and {@link LogicalSide#SERVER} on the server thread.
95+
* @return Convenience method to get the world of this interaction.
9696
*/
97-
public LogicalSide getSide() {
98-
return getWorld().isClient ? LogicalSide.CLIENT : LogicalSide.SERVER;
97+
public World getWorld() {
98+
return getPlayer().getEntityWorld();
9999
}
100100

101101
/**
102-
* @return Convenience method to get the world of this interaction.
102+
* @return The effective, i.e. logical, side of this interaction. This will be {@link LogicalSide#CLIENT} on the client thread, and {@link LogicalSide#SERVER} on the server thread.
103103
*/
104-
public World getWorld() {
105-
return getPlayer().getEntityWorld();
104+
public LogicalSide getSide() {
105+
return getWorld().isClient ? LogicalSide.CLIENT : LogicalSide.SERVER;
106106
}
107107

108108
/**
@@ -295,8 +295,10 @@ public RightClickEmpty(PlayerEntity player, Hand hand) {
295295
* This event is fired when a player left clicks while targeting a block.
296296
*
297297
* <p>This event controls which of {@link net.minecraft.block.Block#onBlockBreakStart(BlockState, World, BlockPos, PlayerEntity)} and/or the item harvesting methods will be called.</p>
298+
298299
* <p>This event is cancellable.
299300
* Cancelling the event will cause none of the above noted methods to be called.</p>
301+
300302
* There are various results to this event, see the getters below.
301303
*
302304
* <p>Note that if the event is canceled and the player holds down left mouse, the event will continue to fire.
@@ -357,9 +359,9 @@ public void setCanceled(boolean canceled) {
357359
*
358360
* <p>This event is not cancellable.</p>
359361
*/
360-
public static class LeftClickEmpty extends PlayerInteractEvent {
362+
/* TODO public static class LeftClickEmpty extends PlayerInteractEvent {
361363
public LeftClickEmpty(PlayerEntity player) {
362364
super(player, Hand.MAIN_HAND, new BlockPos(player), null);
363365
}
364-
}
366+
}*/
365367
}

patchwork-events-entity/src/main/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
import net.minecraft.entity.player.PlayerEntity;
2424

2525
/**
26-
* Legacy version of PlayerXpEvent.PickupXp.<br/>
26+
* Legacy version of PlayerXpEvent.PickupXp. Mods should move to PickupXp, and
2727
* this class is removed in 1.15.
28-
*
29-
* @deprecated Mods should move to {@link net.minecraftforge.event.entity.player.PlayerXpEvent.PickupXp}
3028
*/
3129
@Deprecated
3230
public class PlayerPickupXpEvent extends PlayerXpEvent.PickupXp {

patchwork-events-entity/src/main/java/net/patchworkmc/impl/event/entity/PlayerEvents.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import net.minecraftforge.common.MinecraftForge;
2323
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
2424
import net.minecraftforge.event.entity.player.PlayerEvent;
25-
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
2625
import net.minecraftforge.eventbus.api.Event;
2726

2827
import net.minecraft.entity.ItemEntity;
@@ -60,10 +59,6 @@ public static void firePlayerSmeltedEvent(PlayerEntity player, ItemStack smelted
6059
MinecraftForge.EVENT_BUS.post(new PlayerEvent.ItemSmeltedEvent(player, smelted));
6160
}
6261

63-
public static void fireLeftClickEmptyEvent(PlayerEntity player) {
64-
MinecraftForge.EVENT_BUS.post(new PlayerInteractEvent.LeftClickEmpty(player));
65-
}
66-
6762
/**
6863
*
6964
* @return -1 if the event was canceled, 0 if the event was denied or had no result set, and 1 if the event was allowed

patchwork-events-entity/src/main/java/net/patchworkmc/mixin/event/entity/MixinMinecraftClient.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

patchwork-events-entity/src/main/resources/patchwork-events-entity.mixins.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"MixinClientPlayerEntity",
3333
"MixinClientWorld",
3434
"MixinItemStack",
35-
"MixinMinecraftClient",
3635
"MixinOtherClientPlayerEntity",
3736
"MixinPlayerEntityRenderer"
3837
],

patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import net.minecraft.world.World;
5151

5252
import net.patchworkmc.impl.event.entity.EntityEvents;
53-
import net.patchworkmc.impl.event.entity.PlayerEvents;
5453
import net.patchworkmc.impl.extensions.block.BlockHarvestManager;
5554
import net.patchworkmc.impl.loot.LootHooks;
5655

@@ -66,10 +65,6 @@ public static int canEntitySpawn(MobEntity entity, IWorld world, double x, doubl
6665

6766
// TODO: onInteractEntityAt
6867

69-
public static void onEmptyLeftClick(PlayerEntity player) {
70-
PlayerEvents.fireLeftClickEmptyEvent(player);
71-
}
72-
7368
public static ActionResult onInteractEntity(PlayerEntity player, Entity entity, Hand hand) {
7469
return EntityEvents.onInteractEntity(player, entity, hand);
7570
}

0 commit comments

Comments
 (0)