Skip to content

Commit

Permalink
some work on updating things for the new pack formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Thutmose committed Sep 18, 2022
1 parent 86cb84c commit 65c768c
Show file tree
Hide file tree
Showing 19 changed files with 82 additions and 146 deletions.
Binary file added source/_images/animation gui/adjusted_hat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/finding_left_ear.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/initial screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/other_earring.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/see_off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/see_on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/see_on_hat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_images/animation gui/wearables module.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 22 additions & 44 deletions source/datapacks/editing_spawns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,20 @@ Here is an example of a spawns json
{
"values":{
"types":"mountain,cave",
"types":"#minecraft:is_ocean,cave",
"typesBlacklist":"wet"
}
}
This example will match a location which is of types `mountain` and `cave`, and not `wet`.
This example will match a location which is of types `#minecraft:is_ocean` and `cave`, and not `wet`.

Below is a list of accepted values, and what they will do.
Any below that are a list, will be separated by commas, like in `types` in the example above

- `types` - list of types which are all required to be valid
- `typesBlacklist` - list of types which, if present, will invalidate

- `category` - list of specific biomes, any biome matching will be listed as allowed
- `biomesBlacklist` - list of specific biomes, any biome matching will invalidate

- `biomes` - list of biome categories, any biome matching will be listed as allowed
- `categoryBlacklist` - list of biome categories, any biome matching will invalidate

- `structures` - list of structures which are required for spawning in
- `noStructures` - list of structures which will invalidate

Expand All @@ -69,37 +63,10 @@ Any below that are a list, will be separated by commas, like in `types` in the e

\* if none of these 4 are present, the rule will be valid at all times

Biome Categories
~~~~~~~~~~~~~~~~

Biome categories are a Vanilla Minecraft classification on biomes, the valid options are as follows:

::

none
taiga
extreme_hills
jungle
mesa
plains
savanna
icy
the_end
beach
forest
ocean
desert
river
swamp
mushroom
nether

Biome Types
~~~~~~~~~~~

.. _BiomeDictionary: https://github.com/MinecraftForge/MinecraftForge/blob/c3e84646db70f518dd0b37a8fcfc42cb814d7ba8/src/main/java/net/minecraftforge/common/BiomeDictionary.java#L288-L366?

For the types related fields, there are two different objects checked for validity. First, the Forge Biome Dictionary is checked. The list of built in types can be found here: `BiomeDictionary`_
For the types related fields, there are two different objects checked for validity. First, the Biome tags are checked. These use the same format as regular vanilla biome tags for names.

These will be checked first. If the listing does not match any of the Biome Types, then it will be assumed to be a Subbiome instead, and if not present, a Subbiome for the name will be added.

Expand All @@ -125,6 +92,8 @@ Here is the list of built in Subbiome types:
Creating the custom spawn rules
###############################

Custom spawn rules should go in the datapack under ``/data/<id>/database/pokemobs/spawns``. Examples of these files can be found in the `new_subbiomes` pack above, which uses `my_datapack` for `<id>`.

Spawn rules then generally have an additional set of values, for specifying rates, numbers, etc, and are as follows:

- `min` - minimum number in a spawn pack (default 2)
Expand All @@ -135,15 +104,24 @@ Spawn rules then generally have an additional set of values, for specifying rate

| An example of a spawn rule implementing several of these options is below:
.. code-block:: json
.. code-block:: Json
{
"values": {
"types": "route_1",
"rate": "0.45",
"level": 2,
"variance": "x + (4 * rand())"
}
"rules": [
{
"and_preset": "route_1",
"entries": [
{ "key": "rattata", "rate": 0.55, "level": 2, "variance": "x + (3 * rand())" },
{ "key": "rattata", "rate": 0.45, "level": 2, "variance": "x + (4 * rand())" }
]
},
{
"and_preset": "route_23",
"entries": [
{ "key": "sandslash", "rate": 0.05, "level": 41 },
{ "key": "arbok", "rate": 0.05, "level": 41 }
]
}
]
}
Applying Custom Subbiomes ingame
Expand Down
108 changes: 6 additions & 102 deletions source/datapacks/editing_worldgen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,12 @@
Adjusting Worldgen via Datapacks
********************************

Worldgen for Pokecube can be adjusted via datapacks. These datapacks should go in ``/config/pokecube/datapacks/`` and require a reboot to apply.
Worldgen for Pokecube can be adjusted via datapacks. These datapacks should go in the standard minecraft location for datapacks, and are required before generating the world.

By default, there are 2 of these present, one under ``data/pokecube/structures``, and one under ``data/pokecube_legends/structures``, so those are the ones you would need to include in your datapack if you wish to override the default behaviour.
This mostly uses the vanilla format for structures, and you can adjust them via changing the values in the ``structure_set`` sections of the datapacks.

Json Format:
------------
Sample Datapacks:
#################

The primary file in these datapacks is the ``worldgen.json``, located in ``/data/<modid>/structures/``. This json file is formatted as follows:

.. code-block:: json
{
"pools":[],
"jigsaws":[]
}
These are lists of the following types of objects:

- ``pool`` - a set of buildings/features which count as generally the same type
- ``jigsaw`` - the structure to register for worldgen, it will build features from ``pools``

Format for a pool:
~~~~~~~~~~~~~~~~~~

Below is an example of a pool:

.. code-block:: json
{
"name":"pokecube:scattered/ruins_rigid",
"rigid":true,
"biomeType":"ruin",
"options":[
"pokecube:scattered/ruins_rigid/ancient_tomb",
"pokecube:scattered/ruins_rigid/ruin_1"
]
}
This example pool registers a pool by the name ``pokecube:scattered/ruins_rigid``, which contains 2 options. Note that the files this references are ``/data/pokecube/scattered/ruins_rigid/ancient_tomb.nbt``, and are ``.nbt`` files produced by the vanilla structure blocks.

Options available for pools are as follows:

- ``name`` - a unique name for this pool, this is required.
- ``rigid`` - if false, the structure will fall to match terrain (default ``true``)
- ``water`` - if true, the structure will be allowed to spawn below sea level (default ``false``)
- ``biomeType`` - This is what :ref:`subbiome <subbiomes>` will be assigned to the structure.
- ``options`` - this is a list of nbt files to include in the pool
- ``include`` - this is a list of vanilla pools to also include in the pool

Format for a jigsaw:
~~~~~~~~~~~~~~~~~~~~

Below is an example of a jigsaw:

.. code-block:: json
{
"type":"pokecube:village",
"name":"pokecube:village/plains",
"root":"pokecube:village/plains/town_centers",
"distance":32,
"separation":12,
"size":6,
"priority":10,
"biomeType":"village",
"needed_once":[
"pokecenter",
"gym"
],
"dimBlacklist":[
"the_nether",
"the_end"
],
"spawn":{
"values":{
"types":"all",
"typesBlacklist":"snowy",
"categoryBlacklist":"desert,ocean,river,beach,mushroom,the_end,nether,savanna,mesa,taiga,icy,taiga"
}
}
},
This shows most of the features of the jigsaw. It will register a structure that will show in ``/locate`` as ``pokecube:village``, and will have a structure in it called ``pokecube:village.plains``.

valid options for the jigsaw are as follows:

- ``name`` - This is the unique identifier for this jigsaw
- ``type`` - If specified, this is what will be registered for the structure in ``/locate``, if not specified, ``name`` is used isntead.
- ``offset``
- ``size`` - This is the maximum "depth" of the jigsaw, for things like villages, this represents how many times the roads are allowed to branch
- ``distance`` - The structure is guarenteed to try to spawn at least every this many chunks
- ``separation`` - The structure shouldn't spawn closer than this many chunks to another copy of itself
- ``biomeType`` - Similar to in the pools, except a default for the entire structure
- ``spawn`` - the :ref:`spawn rule<spawn_rules>` for the structure, Note that this only matches based on biome, not subbiome or local values such as weather, etc
- ``surface`` - This spawns on the top of the ground (default ``true``)
- ``base_under`` - This generates a "natural" base under the structure (default ``true``)
- ``water`` - the structure will be allowed to generate under water (default ``false``)
- ``air`` - the structure will generate a random distance above the ground, limited by ``variance`` and ``height`` (default ``false``)
- ``allow_void`` - If false, the structure will not be allowed to spawn over an area which is lower than ``minY`` (default ``false``)
- ``minY`` - see ``allow_void``
- ``height`` - see ``air``
- ``variance`` - see ``air``
- ``needed_once`` - pool options with these flags must be present exactly once for this structure to complete
- ``dimBlacklist`` - This structure shouldn't spawn in these dimensions
- ``dimWhitelist`` - This allows letting the structure spawn in dimensions in the :ref:`softWorldgenDimBlacklist <pokecube-common.toml>`
- Removing all Structures: :download:`no_structures.zip`
This datapack replaces the structure sets with empty ones, thereby preventing them from spawning.
Binary file modified source/datapacks/new_subbiomes.zip
Binary file not shown.
Binary file modified source/datapacks/no_spawns.zip
Binary file not shown.
Binary file added source/datapacks/no_structures.zip
Binary file not shown.
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Welcome to Pokecube Documentation's documentation!
getting_started/index
configs/index
datapacks/index
resourcepacks/index
commands/commands
trainers/index
quests_and_legends/index
Expand Down
45 changes: 45 additions & 0 deletions source/resourcepacks/animating_pokemobs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
***************************************
|Pokemob| Animation and Wearables Setup
***************************************

|Pokemob| animations are defined by keyframe or function animations defined in an xml file of the same name as the |pokemob|'s model.

Step 1: Making an un-zipped resourcepack
----------------------------------------

The first step to setting up for animations and wearables is to make an un-zipped resourcepack containing the xml file for the |pokemob| in question. This should go in the standard minecraft resourcepacks directory. The following example would be for adjusting animations for abra.
The following file was created in resourcepacks: ``animation_tests/assets/pokecube_mobs/gen_1/entity/models/abra.xml``. The initial contents of this XML file are copied from the default file located in the mod's jar, or downloaded from the github repository.

Also created are ``animation_tests/pack.mcmeta`` and ``animation_tests/pack.png`` for the resourcepack to be valid.

Step 2: Enabling the animation gui
-----------------------------------

This is done by assigning a hotkey for opening this gui.

.. figure:: ../_images/animation_gui/gui hotkey button.png
:alt: animation gui hokey
:name: hokey_setup
:width: 600

Hotkey to enable animation gui

Pressing this hotkey should open the following screen:


.. figure:: ../_images/animation_gui/initial screen.png
:alt: Animation Gui
:name: initial_screen
:width: 600

Initial screen for gui.

Pressing the modules button in the lower left will bring up the display for wearables setup and animation testing.

.. figure:: ../_images/animation_gui/wearables module.png
:alt: Animation Gui
:name: wearables_screen
:width: 600


.. include:: ../.shared.rst
8 changes: 8 additions & 0 deletions source/resourcepacks/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Resourcepacks
---------

.. toctree::
:maxdepth: 2
:glob:

*

0 comments on commit 65c768c

Please sign in to comment.