fixed wrong call

This commit is contained in:
gnembon committed 2019-10-09 00:39:16 -03:00
1 parent 6f774e5727
commit 5b1cb6aaf9
1 file changed
+6 -6
@@ -207,6 +207,7 @@ public class CarpetEventServer
}, },
PLAYER_USES_ITEM("player_uses_item",new CallbackList(3)) PLAYER_USES_ITEM("player_uses_item",new CallbackList(3))
{ {
@Override
public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack) public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack)
{ {
handler.call( () -> handler.call( () ->
@@ -222,14 +223,15 @@ public class CarpetEventServer
}, },
PLAYER_CLICKS_BLOCK("player_clicks_block",new CallbackList(3)) PLAYER_CLICKS_BLOCK("player_clicks_block",new CallbackList(3))
{ {
public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack) @Override
public void onBlockAction(ServerPlayerEntity player, BlockPos blockpos, Direction facing)
{ {
handler.call( () -> handler.call( () ->
{ {
return Arrays.asList( return Arrays.asList(
((c, t) -> new EntityValue(player)), ((c, t) -> new EntityValue(player)),
((c, t) -> ListValue.fromItemStack(itemstack)), ((c, t) -> new BlockValue(null, player.getServerWorld(), blockpos)),
((c, t) -> new StringValue(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand")) ((c, t) -> new StringValue(facing.getName()))
); );
}, player::getCommandSource); }, player::getCommandSource);
} }
@@ -345,6 +347,7 @@ public class CarpetEventServer
}, },
PLAYER_FINISHED_USING_ITEM("player_finishes_using_item",new CallbackList(3)) PLAYER_FINISHED_USING_ITEM("player_finishes_using_item",new CallbackList(3))
{ {
@Override
public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack) public void onItemAction(ServerPlayerEntity player, Hand enumhand, ItemStack itemstack)
{ {
// this.getStackInHand(this.getActiveHand()), this.activeItemStack) // this.getStackInHand(this.getActiveHand()), this.activeItemStack)
@@ -360,9 +363,6 @@ public class CarpetEventServer
}; };
// on projectile thrown (arrow from bows, crossbows, tridents, snoballs, e-pearls // on projectile thrown (arrow from bows, crossbows, tridents, snoballs, e-pearls
public String name; public String name;
public static Map<String, Event> byName = new HashMap<String, Event>(){{ public static Map<String, Event> byName = new HashMap<String, Event>(){{
for (Event e: Event.values()) for (Event e: Event.values())