StructurePlaceAnimator - McMellonTeam/easierworldcreator GitHub Wiki
The mod allows you to animate the placement of a structure. To animate your structure, you first need to sort your BlockList comparator $using a BlockSorter
In order to use the animator you need to define a AnimatorTime
and also a AnimatorSound
.
the animator time define the time your structure will take to be placed. There are many value that you can use:
this will place a constant number of block each tick. To use it, you have to set a number of blockPerTick using setBlocksPerTick()
this graph shows the number of block placed each tick from the start to the end
Will place an increasing (or decreasing) number of blocks per ticks linearly. You will have to specify the number of blockPerTicks that will be used based on the following principle:
- tick0 -> zero blocks placed
- tick1 -> blockPerTick blocks placed
- tick2 -> 2 * blockPerTick blocks placed
- tickN-1 -> (N-1) * blockPerTick blocks placed
- tickN -> min(N * blockPerTick blocks placed, remaining blocks)
...
to init the animator, You simply have to specify the number of BlockPerTicks
this graph shows the evolution of the placed block each tick where blockPerTick = 2
Will place an increasing (or decreasing) number of blocks per ticks that will grow on x². You will have to specify the number of blockPerTicks that will be used based on the following principle:
- tick0 -> zero blocks placed
- tick1 -> blockPerTick blocks placed
- tick2 -> 4 * blockPerTick blocks placed (2*2)
...
- tickN-1 -> (N-1) * (N-1) * blockPerTick blocks placed
- tickN -> min(N * N * blockPerTick blocks placed, remaining blocks)
to init the animator, You simply have to specify the number of BlockPerTicks
the graph shows the evolution of block placed each tick
Will place a random number blocks every tick.
For that you need to use the bounds
:
animator.setBounds(min_value, max_value);
The animator will then choose a random number of blocks to place each tick.
The random number chose will be contained between the min value and the max value. For example:
//possible values : {5, 6, 7, 8, 9, 10}
animator.setBounds(5,10);
this graph shows one case where the bounds are set between 10 and 30:
Determines a fixed number of ticks to place the structure.
For that, you need to specify the number of ticks: `setTicks()`.
The structure will then place a number of `blockSize / ticks` block each tick.
Will place an increasing (or decreasing) number of blocks per ticks linearly. You have to set a bound of blocks StructurePlaceAnimator.
- The number of blocks that will be placed on the first tick is the first integer of the pair.
- The last int of the pair represents the number of blocks that will be placed at the last tick.
this graph shows an example where startTick = 10 and end = 30 of course, you can have a decreasing curve
Will place an increasing (or decreasing) number of blocks per ticks following a quadratic curve. You have to set a bound of blocks {@link StructurePlaceAnimator}.
- The number of blocks that will be placed on the first tick is the first integer of the pair.
- The last int of the pair represents the number of blocks that will be placed at the last tick.
this graph shows an example where you set the start and the end number of block placed each tick
of course, you can have a decreasing curve
this enum determines if the animation should play sound. The sound that will be played correspond to the first block placed the tick