I threw this together because someone was asking for this functionality and it sounded interesting to try. As I'm a Java beginner, if you hit problems post the stack trace and what you were doing and I'll try to fix it.
- Tested Minecraft Versions:
The way it works is you create "designs". The designs have whatever pattern types. When someone crafts a banner, it loops through all the designs and checks to see if the patterns match what is being made. So if you had a design "teeth" with pattern types triangles_top and triangles_bottom, it will let you craft a banner with triangles on top OR triangles on bottom but not both together as that matches an interdicted design. If you wanted to block any skull banners, you would make a design with just one pattern "skull" for example. You can have as many designs as you want with as many patterns per design as you want.
Usage and permissions:
Administrative permission to be able to do it all is ipat.admin
Main control command
/IPAT LIST d | p | c
ipat.list to be able to get help
ipat.list.patterns to be able to list patterns
ipat.list.designs to be able to list designs
ipat.list.colors to be able to list colors
Lists all known (d)esigns, (p)attern types or (c)olors. The p option is handy because this uses the PatternType enum to validate pattern types for the designs and I assume not everyone knows the enum pattern types off the top of their heads. Same with the c option, that's to list the values of the DyeColor enum.
Lists the strings used by the plugin
/IPAT MSG msgcode
Shows the current value of the message code
/IPAT MSG msgcode value
Sets the value of the message code. You can use vars %br% for a line break, %pattern% for pattern and %design% for design. Obviously it is context related, so if you use %pattern% in the reload message it will not get replaced with anything.
Reloads the config
Lists the pattern types in a design
/IPAT design ADD (patterntype | patterntype:color)
Adds a pattern type to a design. If the design doesn't exist, it creates it. If the patterntype is alone, it blocks any color of that pattern in the design. If you pass it a color after colon, it only blocks if the pattern is made in the specified color. You can pass multiple designations per command, so if you wanted to block any SKULL and green MOJANG, you would do: /ipat mydesign add skull mojang:green
/IPAT design DEL (patterntype | patterntype:color)
Removes a pattern type from a design
/IPAT design CLEAR
Removes a design
/IPAT EXAMINE (craft | punch | hand)
Turning this on will make the system message you with what pattern types are applied to a banner in certain instances. If you do /ipat examine and it is off, it will turn the mode on set to "craft" trigger. If you do it again, it toggles off. You can pass what trigger mode you want. Trigger modes are craft, punch and hand. In craft mode when you craft a banner, it will tell you the pattern types. In punch mode, if you punch a banner once it will tell you that banner's pattern types. In hand mode if you hold the banner in your hand it will tell you the banner's pattern types. Hand mode requires an item swap in your hand, so if you turn it on whilst holding a banner you need to hit another item in the hotbar then go back to see the results. If you do /ipat examine with no trigger passed, it will default to whatever trigger the user has permission for in the order craft, hand and punch. To use this at all, the user needs ipat.examine then each trigger mode use requires the related permission.