-
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: 'BREAKING_BLOCK', 'BROKEN_BLOCK', 'ENTITY_DAMAGE'…
…, 'ENTITY_DAMAGED', 'ENTITY_DIE', 'ENTITY_DEAD'. Better feature for 'DynamicArgs'. More documents completing.
- Loading branch information
Showing
32 changed files
with
1,070 additions
and
159 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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/github/cao/awa/conium/block/event/breaking/ConiumBreakingBlockEvent.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,30 @@ | ||
package com.github.cao.awa.conium.block.event.breaking | ||
|
||
import com.github.cao.awa.conium.event.ConiumEvent | ||
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.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective4 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.world.World | ||
|
||
class ConiumBreakingBlockEvent : ConiumEvent<ParameterSelective4<Boolean, World, PlayerEntity, BlockPos, AbstractBlockState>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.WORLD, | ||
ConiumEventArgTypes.PLAYER, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE | ||
).attach( | ||
forever(ConiumEventType.BREAKING_BLOCK) | ||
).arise { identity, world, player, blockPos, state -> | ||
noFailure(identity) { | ||
it.arise(world, player, blockPos, state) | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/github/cao/awa/conium/block/event/breaking/ConiumBrokenBlockEvent.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,31 @@ | ||
package com.github.cao.awa.conium.block.event.breaking | ||
|
||
import com.github.cao.awa.conium.event.ConiumEvent | ||
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.parameter.ParameterSelective | ||
import com.github.cao.awa.conium.parameter.ParameterSelective3 | ||
import com.github.cao.awa.conium.parameter.ParameterSelective4 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.world.World | ||
|
||
class ConiumBrokenBlockEvent : ConiumEvent<ParameterSelective4<Boolean, World, PlayerEntity, BlockPos, AbstractBlockState>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.WORLD, | ||
ConiumEventArgTypes.PLAYER, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE | ||
).attach( | ||
forever(ConiumEventType.BROKEN_BLOCK) | ||
).arise { identity, world, player, blockPos, state -> | ||
noFailure(identity) { | ||
it.arise(world, player, blockPos, state) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.