Fredashay's Utility Mass Insert
2023-11-11This plugin does a mass insert (sometimes called a mail-merge).
This plugin does a mass insert (sometimes called a mail-merge).
Why would anyone need a mail-merge in Minecraft?
Well, ever need to duplicate a lot of similar code segments or methods but with a slight difference (such as the event name) between each one?
I recently had to do this -- create a plugin with a crapton of nearly identical event handlers for a bunch of different event names that I copied directly from the Javadocs.
So what does it do, exactly?
Wherever it sees a "$" in the template file, it'll make a copy of that file and replace each "$" with the line from the list file and write that to output, then it'll go to the next line in the list and do the same thing again, and again, and again...
I chose "$" because that's the only character that's not an operator in Java.
Issue /INSERT [LISTFILE] [TEMPLATEFILE] [OUTPUTFILE]
For example, given this as LISTFILE.TXT:
BlockBreakEvent
BlockBurnEvent
BlockDamageEvent
BlockDispenseEvent
BlockExplodeEvent
BlockFadeEvent
BlockFormEvent
BlockFromToEvent
BlockGrowEvent
BlockIgniteEvent
BlockMultiPlaceEvent
BlockPhysicsEvent
BlockPistonEvent
BlockPistonExtendEvent
BlockPistonRetractEvent
BlockPlaceEvent
BlockSpreadEvent
And given is as TEMPLATE.TXT:
@EventHandler (priority = EventPriority.MONITOR)
public void my$Handler ($ event) {
// TODO put code here...
}
If you issue /INSERT LISTFILE.TXT TEMPLATE.TXT OUTFILE.TXT , you'll get this in OUTFILE.TXT:
@EventHandler (priority = EventPriority.MONITOR)
public void myBlockBreakEventHandler (BlockBreakEvent event) {
// TODO put code here...
}
@EventHandler (priority = EventPriority.MONITOR)
public void myBlockBurnEventHandler (BlockBurnEvent event) {
// TODO put code here...
}
@EventHandler (priority = EventPriority.MONITOR)
public void myBlockDamageEventHandler (BlockDamageEvent event) {
// TODO put code here...
}
etc.
etc.
etc.
All 3 parameters are required.
To install this plugin, copy the plugin JAR file to your server's plugins folder.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta