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

Commit

Permalink
Revert "Added LeftClickEmpty. (#197)"
Browse files Browse the repository at this point in the history
This reverts commit cf02fa1
  • Loading branch information
TheGlitch76 committed Oct 25, 2020
1 parent 3794f3a commit aca5139
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ public Direction getFace() {
}

/**
* @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.
* @return Convenience method to get the world of this interaction.
*/
public LogicalSide getSide() {
return getWorld().isClient ? LogicalSide.CLIENT : LogicalSide.SERVER;
public World getWorld() {
return getPlayer().getEntityWorld();
}

/**
* @return Convenience method to get the world of this interaction.
* @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.
*/
public World getWorld() {
return getPlayer().getEntityWorld();
public LogicalSide getSide() {
return getWorld().isClient ? LogicalSide.CLIENT : LogicalSide.SERVER;
}

/**
Expand Down Expand Up @@ -295,8 +295,10 @@ public RightClickEmpty(PlayerEntity player, Hand hand) {
* This event is fired when a player left clicks while targeting a block.
*
* <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>
* <p>This event is cancellable.
* Cancelling the event will cause none of the above noted methods to be called.</p>
* There are various results to this event, see the getters below.
*
* <p>Note that if the event is canceled and the player holds down left mouse, the event will continue to fire.
Expand Down Expand Up @@ -357,9 +359,9 @@ public void setCanceled(boolean canceled) {
*
* <p>This event is not cancellable.</p>
*/
public static class LeftClickEmpty extends PlayerInteractEvent {
/* TODO public static class LeftClickEmpty extends PlayerInteractEvent {
public LeftClickEmpty(PlayerEntity player) {
super(player, Hand.MAIN_HAND, new BlockPos(player), null);
}
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
import net.minecraft.entity.player.PlayerEntity;

/**
* Legacy version of PlayerXpEvent.PickupXp.<br/>
* Legacy version of PlayerXpEvent.PickupXp. Mods should move to PickupXp, and
* this class is removed in 1.15.
*
* @deprecated Mods should move to {@link net.minecraftforge.event.entity.player.PlayerXpEvent.PickupXp}
*/
@Deprecated
public class PlayerPickupXpEvent extends PlayerXpEvent.PickupXp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.Event;

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

public static void fireLeftClickEmptyEvent(PlayerEntity player) {
MinecraftForge.EVENT_BUS.post(new PlayerInteractEvent.LeftClickEmpty(player));
}

/**
*
* @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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"MixinClientPlayerEntity",
"MixinClientWorld",
"MixinItemStack",
"MixinMinecraftClient",
"MixinOtherClientPlayerEntity",
"MixinPlayerEntityRenderer"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import net.minecraft.world.World;

import net.patchworkmc.impl.event.entity.EntityEvents;
import net.patchworkmc.impl.event.entity.PlayerEvents;
import net.patchworkmc.impl.extensions.block.BlockHarvestManager;
import net.patchworkmc.impl.loot.LootHooks;

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

// TODO: onInteractEntityAt

public static void onEmptyLeftClick(PlayerEntity player) {
PlayerEvents.fireLeftClickEmptyEvent(player);
}

public static ActionResult onInteractEntity(PlayerEntity player, Entity entity, Hand hand) {
return EntityEvents.onInteractEntity(player, entity, hand);
}
Expand Down

0 comments on commit aca5139

Please sign in to comment.