-
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 supported: 'FLUID_SCHEDULE_TICK', 'FLUID_SCHEDULE_TICKED',…
… 'BLOCK_SCHEDULE_TICK', 'BLOCK_SCHEDULE_TICKED'. Fix script unresolved reference: 'ENTITY_TICK', 'ENTITY_TICKED' Add event context args: 'RANDOM', 'SCHEDULE_TICK_VIEW', 'FLUID_STATE'. Add method 'preRequest' in 'ConiumEventContextBuilder', used to make 'presage' trigger. Methods 'request' in 'ConiumEventContextBuilder' can input two lambdas now, first is 'arise', seconds is 'presage'.
- Loading branch information
Showing
12 changed files
with
828 additions
and
25 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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/cao/awa/conium/block/event/tick/ConiumBlockScheduleTickEvent.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,32 @@ | ||
package com.github.cao.awa.conium.block.event.tick | ||
|
||
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.ParameterSelective5 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.server.world.ServerWorld | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.util.math.random.Random | ||
import net.minecraft.world.tick.ScheduledTickView | ||
|
||
class ConiumBlockScheduleTickEvent : ConiumEvent<ParameterSelective5<Boolean, ServerWorld, BlockPos, AbstractBlockState, ScheduledTickView, Random>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.SERVER_WORLD, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE, | ||
ConiumEventArgTypes.SCHEDULE_TICK_VIEW, | ||
ConiumEventArgTypes.RANDOM | ||
).attach( | ||
forever(ConiumEventType.BLOCK_SCHEDULE_TICK) | ||
).arise { identity, world, pos, blockState, scheduler, random -> | ||
noFailure(identity) { | ||
it.arise(world, pos, blockState, scheduler, random) | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/cao/awa/conium/block/event/tick/ConiumBlockScheduleTickedEvent.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,32 @@ | ||
package com.github.cao.awa.conium.block.event.tick | ||
|
||
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.ParameterSelective5 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.server.world.ServerWorld | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.util.math.random.Random | ||
import net.minecraft.world.tick.ScheduledTickView | ||
|
||
class ConiumBlockScheduleTickedEvent : ConiumEvent<ParameterSelective5<Boolean, ServerWorld, BlockPos, AbstractBlockState, ScheduledTickView, Random>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.SERVER_WORLD, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE, | ||
ConiumEventArgTypes.SCHEDULE_TICK_VIEW, | ||
ConiumEventArgTypes.RANDOM | ||
).attach( | ||
forever(ConiumEventType.BLOCK_SCHEDULE_TICKED) | ||
).arise { identity, world, pos, blockState, scheduler, random -> | ||
noFailure(identity) { | ||
it.arise(world, pos, blockState, scheduler, random) | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ain/java/com/github/cao/awa/conium/block/event/tick/fluid/ConiumFluidScheduleTickEvent.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,32 @@ | ||
package com.github.cao.awa.conium.block.event.tick.fluid | ||
|
||
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.ParameterSelective5 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.fluid.FluidState | ||
import net.minecraft.server.world.ServerWorld | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.world.tick.ScheduledTickView | ||
|
||
class ConiumFluidScheduleTickEvent : ConiumEvent<ParameterSelective5<Boolean, ServerWorld, BlockPos, AbstractBlockState, FluidState, ScheduledTickView>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.SERVER_WORLD, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE, | ||
ConiumEventArgTypes.FLUID_STATE, | ||
ConiumEventArgTypes.SCHEDULE_TICK_VIEW | ||
).attach( | ||
forever(ConiumEventType.FLUID_SCHEDULE_TICK) | ||
).arise { identity, world, pos, blockState, fluidState, scheduler -> | ||
noFailure(identity) { | ||
it.arise(world, pos, blockState, fluidState, scheduler) | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...n/java/com/github/cao/awa/conium/block/event/tick/fluid/ConiumFluidScheduleTickedEvent.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,32 @@ | ||
package com.github.cao.awa.conium.block.event.tick.fluid | ||
|
||
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.ParameterSelective5 | ||
import net.minecraft.block.AbstractBlock.AbstractBlockState | ||
import net.minecraft.fluid.FluidState | ||
import net.minecraft.server.world.ServerWorld | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.world.tick.ScheduledTickView | ||
|
||
class ConiumFluidScheduleTickedEvent : ConiumEvent<ParameterSelective5<Boolean, ServerWorld, BlockPos, AbstractBlockState, FluidState, ScheduledTickView>>() { | ||
override fun requirement(): ConiumEventContext<out ParameterSelective> { | ||
return requires( | ||
ConiumEventArgTypes.SERVER_WORLD, | ||
ConiumEventArgTypes.BLOCK_POS, | ||
ConiumEventArgTypes.BLOCK_STATE, | ||
ConiumEventArgTypes.FLUID_STATE, | ||
ConiumEventArgTypes.SCHEDULE_TICK_VIEW | ||
).attach( | ||
forever(ConiumEventType.FLUID_SCHEDULE_TICKED) | ||
).arise { identity, world, pos, blockState, fluidState, scheduler -> | ||
noFailure(identity) { | ||
it.arise(world, pos, blockState, fluidState, scheduler) | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.