Commit Graph

58 Commits (master)

Author SHA1 Message Date
Auke Kok 263e143e6c Double bugfix - world, chunklist.
- World "world" may not even exist.
- Chunklist may be zero, but that won't break here
- Count all chunks in all enabled worlds.
2014-01-13 10:35:54 -08:00
Auke Kok 9e199372b9 Residence support: v2.6.6.6 tested 2014-01-12 15:33:50 -08:00
Auke Kok 9c85fe3e64 Fix test code not working in secondary worlds 2014-01-12 14:36:46 -08:00
Auke Kok 0196cbb0c2 Make it work this way.
I can't seem to make forName() work at all for me, so let's just
use an old API thing and catch that, which reliably works for me.

Tested with 1.7.x
- Factions 1.6.9.5
- mcore 7.0.1 + Factions 2.3.0
2014-01-09 22:55:56 -08:00
Auke Kok d8965a5b97 Support for old Factions versions.
This seems to work with Factions 1.6.9.5, as well as mcore+Factions 2.x.

Probably needs more testing to be sure.
2014-01-09 22:14:23 -08:00
Auke Kok b88b0f229b Add snowtest. Some major snow math issues fixed. 2014-01-09 20:41:01 -08:00
Auke Kok b50a7e7c6c Instead of having @supress all over the place.
Wrap getData and SetData into two small helper funcions
so we don't have suppression on the main, long body function.
2013-12-29 10:36:12 -08:00
Auke Kok 144f240ac6 Fix up Towny support? Untested. 2013-12-29 10:26:46 -08:00
Auke Kok 6947ffe69b Fix: don't break lake surfaces.
When fixing water, we'd chop holes into lake water surfaces
if they were above sealevel. By checking the data value, we
can skip fixing up the water if the water level is max (data
== 0) and leave the lake surfaces in order.
2013-12-28 15:53:58 -08:00
Auke Kok 1525cc6ec9 Allow snow to accumulate on a different speed. 2013-12-28 15:32:51 -08:00
Auke Kok 52cf47714c Fix: if world is unloaded, don't access array
This is possible with e.g. multiverse - worlds can be
entirely unloaded including spawn, which make the
chunklist array empty and Chunklist[0] fail with a
stacktrace on every block attempt.
2013-12-26 16:17:28 -08:00
Auke Kok 688f5fe167 Smooth out thawing, thaw edges. 2013-12-24 16:32:33 -08:00
Auke Kok 3edbfcda56 v8 2013-12-23 23:48:00 -08:00
Auke Kok 622c31a21e Mostly more glacier-style fixes.
- found a missing break causing stone never to decay
- a thick snow cover will break down everything down to gravel, but
  not to dirt. Grass will still become dirt. This makes mountains
  that are covered with snow become gravel producers
- under snow degradation goes faster, but displacement stays behind
  a bit as it did before.
- lots of minor adjustments
2013-12-23 23:29:02 -08:00
Auke Kok a4e5c274cb Snow accumulation rewrite.
No longer recursive, and tweaked all the parameters to be
a bit simpler and easier to check. The end result is a lot
better than before, since I broke quite a few aspects as
I was going through this code.

Pretty smooth snowy hilltops, growth is smooth as well.

Thawing is done right at the start which simplifies and
makes things a bit faster.
2013-12-23 23:29:02 -08:00
Auke Kok 7a14edba7c Fix snow melt. Snow is crushable too. 2013-12-23 23:29:02 -08:00
Auke Kok 0b358ab1f7 Don't need temperature anymore. 2013-12-23 23:29:02 -08:00
Auke Kok b691a91f5d clay: also don't create clay above sealevel.
There's otherwise still clay blocks being made in waterfalls
in river biomes, which looks weird once the waterfall
retreats.
2013-12-23 23:29:02 -08:00
Auke Kok 2e187b1958 Don't stack snow up high on vegetation. 2013-12-23 23:29:02 -08:00
Auke Kok 8bb184f164 Tuned snow accumulation.
Several math errors here, plus tuning some parameters
to make this look better overall. It's fairly decent now.
2013-12-23 23:29:02 -08:00
Auke Kok 97829fbc51 Checkpoint.
This isn't ideal yet - the max stack code isn't yet
entirely right as stacks seem to grow too high. I should
also try to limit snow edges to 1-2 snow layer thickness
max as right now things look a bit unbalanced.
2013-12-23 23:29:02 -08:00
Auke Kok ff65c99651 Patch error - duplicate method. 2013-12-23 23:29:02 -08:00
Auke Kok a6024aae94 Initial work for glaciers.
This code will create growing and thawing snow. The snow will grow
if it's storming and temperatures are low, and snow will melt if
the sun is out or some other light source is near. The algorithm
makes very pleasing rounded mountain tops.

From here on, we need to pile snow higher to produce ice blocks, the
next step needed to create glacier-like effects.
2013-12-23 23:29:02 -08:00
Auke Kok 85b232c989 Attempt to make waterfalls behave more natural
With the old code, waterfalls would only ever grow and
the amount of water blocks would never decrease. This
leads to huge pillars of water that are unrealistic and
create enormously large water fans, which is ugly at
best.

This code removes the water column entirely above blocks
that are moved. By doing so, we cause a waterfall block
update which will likely put the water back again, but
most of the time do so one block lower. This causes the
water depth to be adjusted continuously lower, and leads
to a more realistic flow.

Ultimately, this code will also remove the waterfall
itself since it will remove the water origin block as
well if it is no longer protected. Since the landscape
generator usually put waterfalls *under* another stone
block, this will take a long time. All water will disappear
and you're left with a "dry" valley and alluvial fan below,
which bears resemblance to dry valleys in nature.
2013-12-21 14:20:19 -08:00
Auke Kok 98a5011818 Also deposit into lava
This makes the plugin consider lava equivalent to water and
blocks will fall -into- lava pools and streams, just like
they can fall into water.
2013-12-13 23:34:54 -08:00
Auke Kok c2d6b026e1 Make sure we check if there is a region manager.
Worlds may not have a manager, in which case the world is
going to be unprotected.
2013-12-13 11:23:25 -08:00
Auke Kok 9ac2ed31e5 WorldGuard integration - UNTESTED 2013-12-13 11:11:15 -08:00
Auke Kok d4c28a3ed1 Strip data bytes when needed.
- stripping data byte prevents us from randomly degrading into
  podzol or colored clay.
- degrade into mossy cobblestone in taiga's.
- consider mossy cobblestone a naturally degrading material as it
  occurs in nature.
2013-12-10 17:48:32 -08:00
Auke Kok 83c80a9306 v6 release.
- the "protect" option is now a config file only setting
- "ticks" config file option allows you to change the interval
  at which the plugin runs, so it can be slowed down further
2013-12-09 23:04:42 -08:00
Auke Kok dd27353b88 Mostly refactoring, no effective changes here. 2013-12-06 20:51:30 -08:00
Auke Kok 7006c851e3 Sideways check needs to account for water.
This is a good reminder I need to do away with some of
these switch statements and use class-based checks instead where
possible.
2013-12-04 00:19:29 -08:00
Auke Kok 51ada029ef don't move blocks that are locked in.
This seems to be the better way of finding locked in blocks. This
will prevent awkward holes and change slopes to look a bit more
usual during erosion.

To test this I wrote a test function that allows me to quickly
do a lot of erosion attempts on a small section of the map, which
will be handy since I've been having a hard time testing the
validity of the algorithms due to the math scale of things (even
blocks of sand were resisting 1000+ attempts to move down 1 spot!).
Having a hammer to whack at it hard will reduce my testing time
and will make for an easier time tuning the parameters.
2013-12-03 22:19:31 -08:00
Auke Kok d3a4803a2c Don't implement this FIXME.
Since erosion already does more work at mountain tops since they
are generally more exposed, don't have vegetation and the dirt
cover on them washes away fast, there's no real reason to add an
elevation factor at this point.
2013-12-03 19:59:14 -08:00
Auke Kok bf903910c6 Fix strange water blocks created at sea level and below. 2013-12-03 19:56:32 -08:00
Auke Kok 31e70ec47b Copy block data too.
This prevents podzol, red sand, colored clay from losing
it's color or turning to regular sand/dirt.
2013-12-02 21:34:42 -08:00
Auke Kok a071124597 1.7.2 sediment materials.
- Red sand equals sand. In most biome's, it's not going
  to get degraded further, but if deposited into an ocean or
  other wet biome, it'll turn into clay as normal.
- hardened clay and stained clay are considered as hard as
  stone (e.g. sandstone) in minecraft (see wiki). For that
  reason, we'll consider these equivalend to sandstone and
  cobblestone, so they degrade into gravel and are not
  very movable.
2013-12-02 15:51:59 -08:00
Auke Kok 059d75efaa Add 1.7.2 plant materials. 2013-12-02 15:33:38 -08:00
Auke Kok 140b77887c 1.7.2 Biome's.
Add exceptions where needed for new biome's in 1.7.2.
2013-12-02 14:35:46 -08:00
Auke Kok 03919245fe Silence this warning.
This wasn't really useful and displayed a warning at startup for no
reason.
2013-12-02 11:56:27 -08:00
Auke Kok 719b7b2ff5 Make protection optional.
This will disable protection even if Factions or towny are present.
2013-12-02 11:53:37 -08:00
Auke Kok 1c5ecedc43 Also erode blocks that are under snow, but slower. 2013-12-02 00:11:25 -08:00
Auke Kok cc1e58b597 Falling blocks will crush" snow cover. 2013-12-01 23:58:48 -08:00
Auke Kok 9033851191 No rain in deserts
since it doesn't rain in deserts, we should not increase the erosion
there when the world is storming.
2013-12-01 23:11:30 -08:00
Auke Kok 06b4a5ec38 v3 release: Towny support (UNTESTED) 2013-12-01 20:46:07 -08:00
Auke Kok 86fe6f9f3f Slow down progressively under deeper water.
This preserves the deeper oceans while still having a good effect on shallow
water - it'll create a bit of a bulge near the coastline that looks more natural and
won't erode coastlines as much as the versions before.
2013-12-01 17:45:49 -08:00
Auke Kok 3ef0195847 Handle ores.
- move just as fast as stone
- very low chance of degrading into stone
2013-12-01 17:08:27 -08:00
Auke Kok 7b73e2b6e9 Don't create clay except underwater in clay-natural regions.
This prevents ocean islands etc. from creating clay blocks above water,
and from non-clay natural regions from creating any type of clay
underwater, which doesn't fit well in Minecraft landscapes.
2013-12-01 16:52:13 -08:00
Auke Kok 44888529bd Implement Factions support - protect claimed chunks
Factions is optional, and does not need to be present on the server.
2013-12-01 16:44:47 -08:00
Auke Kok 2c627874c2 Fix water gaps at sea level and below.
we don't want to fix these problems at higher elevation as it
creates lakes near waterfalls that are hard to fix.
2013-12-01 11:22:38 -08:00
Auke Kok a3e2e6bcfb Play a splash when blocks fall in water
Somehow doesn't always seem to play a splash sound properly, but
fun enough to already put in. I must have my calculations off
somewhere in this section.
2013-12-01 01:42:27 -08:00