-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add events support: 'ITEM_INVENTORY_TICK', 'ITEM_INVENTORY_TICKED', 'ITEM_STACK_CLICK', 'ITEM_STACK_CLICKED'. Add context args: 'CURSOR_STACK', 'CLICK_TYPE', 'SLOT', 'SLOT_NUMBER', 'SELECT_STATUS'. Update version id to '1.0.0-alpha7'.
- Loading branch information
Showing
16 changed files
with
338 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/github/cao/awa/conium/item/event/stack/click/ConiumItemStackClickEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.github.cao.awa.conium.item.event.stack.click | ||
|
||
import com.github.cao.awa.conium.event.context.ConiumEventContext | ||
import com.github.cao.awa.conium.event.context.ConiumEventContextBuilder.requires | ||
import com.github.cao.awa.conium.event.type.ConiumEventArgTypes | ||
import com.github.cao.awa.conium.event.type.ConiumEventType | ||
import com.github.cao.awa.conium.item.event.ConiumItemEvent | ||
import com.github.cao.awa.conium.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective5 | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.screen.slot.Slot | ||
import net.minecraft.util.ClickType | ||
|
||
class ConiumItemStackClickEvent : ConiumItemEvent<ParameterSelective5<Boolean, PlayerEntity, ItemStack, ItemStack, ClickType, Slot>>(ConiumEventType.ITEM_STACK_CLICK) { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.PLAYER, | ||
ConiumEventArgTypes.ITEM_STACK, | ||
ConiumEventArgTypes.CURSOR_STACK, | ||
ConiumEventArgTypes.CLICK_TYPE, | ||
ConiumEventArgTypes.SLOT, | ||
).arise { identity: Any, player: PlayerEntity, itemStack: ItemStack, cursorStack: ItemStack, clickType: ClickType, slot: Slot -> | ||
noFailure(identity) { parameterSelective -> | ||
parameterSelective(player, itemStack, cursorStack, clickType, slot) | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...main/java/com/github/cao/awa/conium/item/event/stack/click/ConiumItemStackClickedEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.cao.awa.conium.item.event.stack.click | ||
|
||
import com.github.cao.awa.conium.event.context.ConiumEventContext | ||
import com.github.cao.awa.conium.event.context.ConiumEventContextBuilder.requires | ||
import com.github.cao.awa.conium.event.type.ConiumEventArgTypes | ||
import com.github.cao.awa.conium.event.type.ConiumEventType | ||
import com.github.cao.awa.conium.item.event.ConiumItemEvent | ||
import com.github.cao.awa.conium.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective4 | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.screen.slot.Slot | ||
import net.minecraft.util.ClickType | ||
|
||
class ConiumItemStackClickedEvent : ConiumItemEvent<ParameterSelective4<Boolean, PlayerEntity, ItemStack, ClickType, Slot>>(ConiumEventType.ITEM_STACK_CLICKED) { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.PLAYER, | ||
ConiumEventArgTypes.ITEM_STACK, | ||
ConiumEventArgTypes.CLICK_TYPE, | ||
ConiumEventArgTypes.SLOT | ||
).arise { identity: Any, player: PlayerEntity, itemStack: ItemStack, clickType: ClickType, slot: Slot -> | ||
noFailure(identity) { parameterSelective -> | ||
parameterSelective(player, itemStack, clickType, slot) | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
.../java/com/github/cao/awa/conium/item/event/tick/inventory/ConiumItemInventoryTickEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.cao.awa.conium.item.event.tick.inventory | ||
|
||
import com.github.cao.awa.conium.event.context.ConiumEventContext | ||
import com.github.cao.awa.conium.event.context.ConiumEventContextBuilder.requires | ||
import com.github.cao.awa.conium.event.type.ConiumEventArgTypes | ||
import com.github.cao.awa.conium.event.type.ConiumEventType | ||
import com.github.cao.awa.conium.item.event.ConiumItemEvent | ||
import com.github.cao.awa.conium.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective5 | ||
import net.minecraft.entity.Entity | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.world.World | ||
|
||
class ConiumItemInventoryTickEvent : ConiumItemEvent<ParameterSelective5<Boolean, World, Entity, ItemStack, Int, Boolean>>(ConiumEventType.ITEM_INVENTORY_TICK) { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.WORLD, | ||
ConiumEventArgTypes.ENTITY, | ||
ConiumEventArgTypes.ITEM_STACK, | ||
ConiumEventArgTypes.SLOT_NUMBER, | ||
ConiumEventArgTypes.SELECT_STATUS, | ||
).arise { identity: Any, world: World, entity: Entity, itemStack: ItemStack, slotNumber: Int, selectStatus: Boolean -> | ||
noFailure(identity) { parameterSelective -> | ||
parameterSelective(world, entity, itemStack, slotNumber, selectStatus) | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ava/com/github/cao/awa/conium/item/event/tick/inventory/ConiumItemInventoryTickedEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.cao.awa.conium.item.event.tick.inventory | ||
|
||
import com.github.cao.awa.conium.event.context.ConiumEventContext | ||
import com.github.cao.awa.conium.event.context.ConiumEventContextBuilder.requires | ||
import com.github.cao.awa.conium.event.type.ConiumEventArgTypes | ||
import com.github.cao.awa.conium.event.type.ConiumEventType | ||
import com.github.cao.awa.conium.item.event.ConiumItemEvent | ||
import com.github.cao.awa.conium.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective5 | ||
import net.minecraft.entity.Entity | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.world.World | ||
|
||
class ConiumItemInventoryTickedEvent : ConiumItemEvent<ParameterSelective5<Boolean, World, Entity, ItemStack, Int, Boolean>>(ConiumEventType.ITEM_INVENTORY_TICKED) { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.WORLD, | ||
ConiumEventArgTypes.ENTITY, | ||
ConiumEventArgTypes.ITEM_STACK, | ||
ConiumEventArgTypes.SLOT_NUMBER, | ||
ConiumEventArgTypes.SELECT_STATUS, | ||
).arise { identity: Any, world: World, entity: Entity, itemStack: ItemStack, slotNumber: Int, selectStatus: Boolean -> | ||
noFailure(identity) { parameterSelective -> | ||
parameterSelective(world, entity, itemStack, slotNumber, selectStatus) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.