APDevTeam / Movecraft-Cannons

Movecraft & Cannons Integration
GNU General Public License v3.0
6 stars 9 forks source link

[Feature Request] Per-craft cannon limits #1

Closed galacticwarrior9 closed 2 years ago

galacticwarrior9 commented 3 years ago

Firstly, thank you for creating this addon! I wasn't even sure it was possible to make. I will be testing it on my 1.16.4 server which is currently in development.

There has, however, been a small loss of functionality. Eirikh's fork has a feature which allows users to limit the numbers of a specified cannons that can be present on a craft. One use case for this is to help separate cannons between 'ground' and 'naval' classes, or to restrict heavier cannon designs to larger ship types (rather than, say, skiffs). It would be great to see this added if possible.

This could be an addendum to the configuration file - for example, one of my craft files on eirikh's fork has the following section:

maxCannons:
   "Mortar": N2
   "Cannon": N0
   "LargeCannon": N0
   "57mmArtilleryS": N0
   "57mmArtilleryL": N30 
   "240mmHowitzerS": N0 
   "240mmHowitzerL": N8
TylerS1066 commented 3 years ago

I'm not currently certain on how we'd implement this (due to everything in Movecraft-Cannons being in one config), but it sounds like a great idea!

goodroach commented 3 years ago

A temporary solution for this would be to have unusual blocks on your cannons and have those blocks restricted in the craftfiles. For example, your mortar could have a lapis block and you can make lapis only up to like 0.2% (1 per 500 blocks) on your craft. Or, you can use a number by putting the letter "N" in front sort of like how furnaces are limited in the default craftfiles.

TylerS1066 commented 3 years ago

While a temporary solution exists, we do plan on implementing this as soon as Movecraft 8 has a stable API for adding custom craft type flags from external plugins (which will be done before a full release).

TylerS1066 commented 2 years ago

With https://github.com/APDevTeam/Movecraft/pull/459 merged to Movecraft, I was able to make an attempt at implementing this in https://github.com/TylerS1066/Movecraft-Cannons/commit/917b206ce4b52dd45a8e1e9839bc23f8a17c530c. I've not tested it yet, but I plan to soon.

TylerS1066 commented 2 years ago

As of v1.a.6 this is implemented.