Skip to content

Commit 309d5de

Browse files
authored
Merge pull request #594 from pylonmc/human/multi-event-handlers
Multi Event Handlers :D
2 parents b3041a4 + 09be04f commit 309d5de

File tree

109 files changed

+3392
-2024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3392
-2024
lines changed

rebar/src/main/kotlin/io/github/pylonmc/rebar/Rebar.kt

Lines changed: 134 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,61 @@ import io.github.pylonmc.rebar.content.guide.RebarGuide
2222
import io.github.pylonmc.rebar.entity.EntityListener
2323
import io.github.pylonmc.rebar.entity.EntityStorage
2424
import io.github.pylonmc.rebar.entity.RebarEntity
25+
import io.github.pylonmc.rebar.entity.base.RebarBat
26+
import io.github.pylonmc.rebar.entity.base.RebarBreedable
27+
import io.github.pylonmc.rebar.entity.base.RebarCombustibleEntity
28+
import io.github.pylonmc.rebar.entity.base.RebarCop
29+
import io.github.pylonmc.rebar.entity.base.RebarCreeper
30+
import io.github.pylonmc.rebar.entity.base.RebarDamageableEntity
31+
import io.github.pylonmc.rebar.entity.base.RebarDeathEntity
32+
import io.github.pylonmc.rebar.entity.base.RebarDragonFireball
33+
import io.github.pylonmc.rebar.entity.base.RebarDyeable
34+
import io.github.pylonmc.rebar.entity.base.RebarEnderDragon
35+
import io.github.pylonmc.rebar.entity.base.RebarEnderman
36+
import io.github.pylonmc.rebar.entity.base.RebarExperienceOrb
37+
import io.github.pylonmc.rebar.entity.base.RebarExplosiveEntity
38+
import io.github.pylonmc.rebar.entity.base.RebarFirework
39+
import io.github.pylonmc.rebar.entity.base.RebarInteractEntity
40+
import io.github.pylonmc.rebar.entity.base.RebarItemEntity
41+
import io.github.pylonmc.rebar.entity.base.RebarLeashable
42+
import io.github.pylonmc.rebar.entity.base.RebarMountableEntity
43+
import io.github.pylonmc.rebar.entity.base.RebarMountingEntity
44+
import io.github.pylonmc.rebar.entity.base.RebarMovingEntity
45+
import io.github.pylonmc.rebar.entity.base.RebarPathingEntity
46+
import io.github.pylonmc.rebar.entity.base.RebarPiglin
47+
import io.github.pylonmc.rebar.entity.base.RebarProjectile
48+
import io.github.pylonmc.rebar.entity.base.RebarResurrectable
49+
import io.github.pylonmc.rebar.entity.base.RebarSlime
50+
import io.github.pylonmc.rebar.entity.base.RebarSpellcaster
51+
import io.github.pylonmc.rebar.entity.base.RebarTameable
2552
import io.github.pylonmc.rebar.entity.base.RebarTickingEntity
53+
import io.github.pylonmc.rebar.entity.base.RebarTurtle
54+
import io.github.pylonmc.rebar.entity.base.RebarVillager
55+
import io.github.pylonmc.rebar.entity.base.RebarWitch
56+
import io.github.pylonmc.rebar.entity.base.RebarZombiePigman
57+
import io.github.pylonmc.rebar.event.api.MultiListener
2658
import io.github.pylonmc.rebar.fluid.placement.FluidPipePlacementService
2759
import io.github.pylonmc.rebar.guide.pages.base.PagedGuidePage
2860
import io.github.pylonmc.rebar.guide.pages.base.TabbedGuidePage
2961
import io.github.pylonmc.rebar.i18n.RebarTranslator
3062
import io.github.pylonmc.rebar.item.RebarInventoryTicker
3163
import io.github.pylonmc.rebar.item.RebarItem
3264
import io.github.pylonmc.rebar.item.RebarItemListener
65+
import io.github.pylonmc.rebar.item.base.RebarArrow
66+
import io.github.pylonmc.rebar.item.base.RebarBlockInteractor
67+
import io.github.pylonmc.rebar.item.base.RebarBow
68+
import io.github.pylonmc.rebar.item.base.RebarBrewingStandFuel
69+
import io.github.pylonmc.rebar.item.base.RebarBucket
70+
import io.github.pylonmc.rebar.item.base.RebarConsumable
71+
import io.github.pylonmc.rebar.item.base.RebarDispensable
72+
import io.github.pylonmc.rebar.item.base.RebarInteractor
73+
import io.github.pylonmc.rebar.item.base.RebarItemDamageable
74+
import io.github.pylonmc.rebar.item.base.RebarItemEntityInteractor
75+
import io.github.pylonmc.rebar.item.base.RebarLingeringPotion
76+
import io.github.pylonmc.rebar.item.base.RebarSplashPotion
77+
import io.github.pylonmc.rebar.item.base.RebarTool
78+
import io.github.pylonmc.rebar.item.base.RebarWeapon
79+
import io.github.pylonmc.rebar.item.base.VanillaCookingFuel
3380
import io.github.pylonmc.rebar.item.research.Research
3481
import io.github.pylonmc.rebar.logistics.CargoRoutes
3582
import io.github.pylonmc.rebar.metrics.RebarMetrics
@@ -116,14 +163,10 @@ object Rebar : JavaPlugin(), RebarAddon {
116163

117164
// Anything that listens for addon registration must be above this line
118165
registerWithRebar()
119-
120-
pm.registerEvents(BlockStorage, this)
121-
pm.registerEvents(BlockListener, this)
122-
pm.registerEvents(RebarCopperBlock, this)
123166
pm.registerEvents(RebarItemListener, this)
167+
pm.registerEvents(BlockStorage, this)
124168
pm.registerEvents(MultiblockCache, this)
125169
pm.registerEvents(EntityStorage, this)
126-
pm.registerEvents(EntityListener, this)
127170
pm.registerEvents(Research, this)
128171
pm.registerEvents(RebarVirtualInventoryBlock, this)
129172
pm.registerEvents(RebarGuiBlock, this)
@@ -139,14 +182,99 @@ object Rebar : JavaPlugin(), RebarAddon {
139182
pm.registerEvents(RebarTickingBlock, this)
140183
pm.registerEvents(RebarGuide, this)
141184
pm.registerEvents(RebarLogisticBlock, this)
142-
pm.registerEvents(RebarCargoBlock, this)
143185
pm.registerEvents(CargoRoutes, this)
144186
pm.registerEvents(CargoDuct, this)
145187
pm.registerEvents(RecipeCompletion, this)
146188
pm.registerEvents(PagedGuidePage, this)
147189
pm.registerEvents(TabbedGuidePage, this)
148190
pm.registerEvents(RebarTickingEntity, this)
149191

192+
// Rebar Blocks
193+
BlockListener.register(this, pm)
194+
RebarBeacon.register(this, pm)
195+
RebarBell.register(this, pm)
196+
RebarTNT.register(this, pm)
197+
RebarNoteBlock.register(this, pm)
198+
RebarCrafter.register(this, pm)
199+
RebarSponge.register(this, pm)
200+
RebarFurnace.register(this, pm)
201+
RebarCampfire.register(this, pm)
202+
RebarBrewingStand.register(this, pm)
203+
RebarDispenser.register(this, pm)
204+
RebarGrowable.register(this, pm)
205+
RebarCauldron.register(this, pm)
206+
RebarSign.register(this, pm)
207+
RebarTrialVault.register(this, pm)
208+
RebarLeaf.register(this, pm)
209+
RebarTargetBlock.register(this, pm)
210+
RebarComposter.register(this, pm)
211+
RebarShearable.register(this, pm)
212+
RebarLectern.register(this, pm)
213+
RebarPiston.register(this, pm)
214+
RebarEnchantingTable.register(this, pm)
215+
RebarRedstoneBlock.register(this, pm)
216+
RebarInteractBlock.register(this, pm)
217+
RebarSneakableBlock.register(this, pm)
218+
RebarJumpBlock.register(this, pm)
219+
RebarUnloadBlock.register(this, pm)
220+
RebarFlowerPot.register(this, pm)
221+
RebarVanillaContainerBlock.register(this, pm)
222+
RebarHopper.register(this, pm)
223+
RebarCargoBlock.register(this, pm)
224+
RebarCopperBlock.register(this, pm)
225+
RebarEntityChangedBlock.register(this, pm)
226+
227+
// Rebar Items
228+
RebarArrow.register(this, pm)
229+
RebarBlockInteractor.register(this, pm)
230+
RebarBow.register(this, pm)
231+
RebarBrewingStandFuel.register(this, pm)
232+
RebarBucket.register(this, pm)
233+
RebarConsumable.register(this, pm)
234+
RebarDispensable.register(this, pm)
235+
RebarInteractor.register(this, pm)
236+
RebarItemDamageable.register(this, pm)
237+
RebarItemEntityInteractor.register(this, pm)
238+
RebarLingeringPotion.register(this, pm)
239+
RebarSplashPotion.register(this, pm)
240+
RebarTool.register(this, pm)
241+
RebarWeapon.register(this, pm)
242+
VanillaCookingFuel.register(this, pm)
243+
244+
// Rebar Entities
245+
EntityListener.register(this, pm)
246+
RebarBat.register(this, pm)
247+
RebarBreedable.register(this, pm)
248+
RebarCombustibleEntity.register(this, pm)
249+
RebarCop.register(this, pm)
250+
RebarCreeper.register(this, pm)
251+
RebarDamageableEntity.register(this, pm)
252+
RebarDeathEntity.register(this, pm)
253+
RebarDragonFireball.register(this, pm)
254+
RebarDyeable.register(this, pm)
255+
RebarEnderDragon.register(this, pm)
256+
RebarEnderman.register(this, pm)
257+
RebarExperienceOrb.register(this, pm)
258+
RebarExplosiveEntity.register(this, pm)
259+
RebarFirework.register(this, pm)
260+
RebarInteractEntity.register(this, pm)
261+
RebarItemEntity.register(this, pm)
262+
RebarLeashable.register(this, pm)
263+
RebarMountableEntity.register(this, pm)
264+
RebarMountingEntity.register(this, pm)
265+
RebarMovingEntity.register(this, pm)
266+
RebarPathingEntity.register(this, pm)
267+
RebarPiglin.register(this, pm)
268+
RebarProjectile.register(this, pm)
269+
RebarResurrectable.register(this, pm)
270+
RebarSlime.register(this, pm)
271+
RebarSpellcaster.register(this, pm)
272+
RebarTameable.register(this, pm)
273+
RebarTurtle.register(this, pm)
274+
RebarVillager.register(this, pm)
275+
RebarWitch.register(this, pm)
276+
RebarZombiePigman.register(this, pm)
277+
150278
Bukkit.getScheduler().runTaskTimer(this, RebarInventoryTicker(), 0, RebarConfig.INVENTORY_TICKER_BASE_RATE)
151279

152280
if (RebarConfig.WailaConfig.ENABLED) {

0 commit comments

Comments
 (0)