lawremi / CustomOreGen

Custom Ore Generation mod for Minecraft, originally by JRoush
Artistic License 2.0
41 stars 25 forks source link

Add 'Touches' placement restriction for configuration #197

Closed MattJohns closed 7 years ago

MattJohns commented 7 years ago

Adds additional functionality to PlacesBeside configuration option for ore distributions. A new XML element has been added called Touches that has a superset of the PlacesBeside functionality. PlacesBeside will still be kept for legacy usage and existing configuration files will not be affected for users.

The new configuration option has the following features:

All attributes are optional except for block. minimumTouches must not be greater than maximumTouches. Commands are executed in the order they are found in the XML configuration. The attributes volume, contactType and direction are combined together using 'and' logic rather than 'or'. So a direction of north specifies the 3x3 slab to the north but if the command also has a volume of planeXZ it will only be the 3 of those 9 blocks that sit on the same y level as the block being checked.

There are issues at chunk boundaries which will cause missing blocks due to placement checks being made when some chunks are not yet loaded at all. If you are having issues with placement restrictions check whether they are occurring at a chunk boundary. This only affects placements that refer to other ore distributions, it doesn't affect those that reference natural terrain.

Examples:

<VeinsPreset name='test'> <OreBlock block='minecraft:grass' /> <Touches block='minecraft:stone' direction='south' /> </VeinsPreset>

<VeinsPreset name='test'> <OreBlock block='minecraft:grass' /> <Touches block='minecraft:stone' direction='northSouth' minimumTouches='2' mandatory='false' /> <Touches block='minecraft:stone' direction='eastWest' minimumTouches='2' mandatory='false' /> <Touches block='minecraft:stone' direction='any' volume='planeXZ' maximumTouches='2' mandatory='true' /> </VeinsPreset>

lawremi commented 7 years ago

Thank a lot for the contribution. I know it was a lot of effort.

MattJohns commented 7 years ago

No problem. Feel free to close those other pull requests. I'm going to delete the original repository where I made some branching errors.

Dominance commented 7 years ago

Thanks a ton for this. So many countless lost hours with trying to get placesbesides working. Now if only we can get this feature to 1.11.2!

lawremi commented 7 years ago

I'm pretty sure the feature does work for 1.11.2. At least it's in the master branch, which is 1.11.2 now.

Dominance commented 7 years ago

Yeah sorry noticed that way to late.

On Jun 19, 2017 1:44 AM, "Michael Lawrence" notifications@github.com<mailto:notifications@github.com> wrote:

I'm pretty sure the feature does work for 1.11.2. At least it's in the master branch, which is 1.11.2 now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lawremi/CustomOreGen/pull/197#issuecomment-309343945, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFxMcDp1qA_ctlpO4VrnDw1oABGoZVnnks5sFgqqgaJpZM4N1lD1.