-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Snow.java
608 lines (499 loc) · 25.5 KB
/
Snow.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
package com.sk89q.craftbook.mechanics;
import com.google.common.collect.Lists;
import com.sk89q.craftbook.AbstractCraftBookMechanic;
import com.sk89q.craftbook.CraftBookPlayer;
import com.sk89q.craftbook.bukkit.CraftBookPlugin;
import com.sk89q.craftbook.util.BlockSyntax;
import com.sk89q.craftbook.util.BlockUtil;
import com.sk89q.craftbook.util.EventUtil;
import com.sk89q.craftbook.util.ProtectionUtil;
import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.worldedit.blocks.Blocks;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.type.Slab;
import org.bukkit.block.data.type.Stairs;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.BlockVector;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**
* Snow fall mechanism. Builds up/tramples snow
*
* @author Me4502
*/
@SuppressWarnings("deprecation")
public class Snow extends AbstractCraftBookMechanic {
@Override
public boolean enable() {
if(meltSunlight || piling) {
for(World world : Bukkit.getWorlds()) {
for(Chunk chunk : world.getLoadedChunks()) {
boolean isChunkUseful = false;
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
if(chunk.getBlock(x, world.getMaxHeight()-1, z).getTemperature() < 0.15) {
isChunkUseful = true;
break;
}
}
}
if(!isChunkUseful) continue;
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowChunkHandler(chunk), getRandomDelay() * 20L);
}
}
}
return true;
}
private boolean canLandOn(Block block) {
switch(block.getType()) {
case CAKE:
case DAYLIGHT_DETECTOR:
case REPEATER:
case COMPARATOR:
case TORCH:
case AIR:
return false;
default:
if (Tag.STAIRS.isTagged(block.getType())) {
return ((Stairs) block.getBlockData()).getHalf() == Bisected.Half.TOP;
}
if (Tag.SLABS.isTagged(block.getType())) {
return ((Slab) block.getBlockData()).getType() != Slab.Type.BOTTOM;
}
if (Tag.CARPETS.isTagged(block.getType()) || Tag.RAILS.isTagged(block.getType()) || Tag.SAPLINGS.isTagged(block.getType())) {
return false;
}
return !(!freezeWater && (block.getType() == Material.WATER)) && !isReplacable(block);
}
}
private boolean isReplacable(Block block) {
return !(block.getType() == Material.WATER)
&& (BlockUtil.isBlockReplacable(block.getType())
|| Blocks.containsFuzzy(realisticReplacables, BukkitAdapter.adapt(block.getBlockData())));
}
@EventHandler(priority = EventPriority.HIGH)
public void onSnowballHit(ProjectileHitEvent event) {
if (!place) return;
if(!EventUtil.passesFilter(event))
return;
if (event.getEntity() instanceof Snowball) {
Block block = event.getEntity().getLocation().getBlock();
if (event.getEntity().getShooter() != null && event.getEntity().getShooter() instanceof Player) {
if (CraftBookPlugin.inst().getConfiguration().pedanticBlockChecks && !ProtectionUtil.canBuild((Player)event.getEntity().getShooter(), block.getLocation(), true)) {
return;
}
CraftBookPlayer player = CraftBookPlugin.inst().wrapPlayer((Player) event.getEntity().getShooter());
if (!player.hasPermission("craftbook.mech.snow.place")) return;
}
Bukkit.getScheduler().runTask(CraftBookPlugin.inst(), new SnowHandler(block, 1));
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onBlockPlace(BlockPlaceEvent event) {
if (!realistic) return;
if(event.getBlock().getType() != Material.SNOW) return;
if(!EventUtil.passesFilter(event))
return;
Bukkit.getScheduler().runTask(CraftBookPlugin.inst(), new SnowHandler(event.getBlock(), 0));
}
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerMove(PlayerMoveEvent event) {
if (!trample && !slowdown) return;
if(!EventUtil.passesFilter(event))
return;
CraftBookPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
if (event.getTo().getBlock().getType() == Material.SNOW) {
if(slowdown) {
if(event.getTo().getBlock().getData() > 4)
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20, 2), true);
else if(event.getTo().getBlock().getData() > 0)
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20, 1), true);
}
if (trample) {
if (!player.hasPermission("craftbook.mech.snow.trample"))
return;
if (jumpTrample && !(event.getFrom().getY() - event.getTo().getY() >= 0.1D))
return;
if (CraftBookPlugin.inst().getRandom().nextInt(20) == 0) {
if (event.getTo().getBlock().getData() == 0x0 && partialTrample)
return;
if (CraftBookPlugin.inst().getConfiguration().pedanticBlockChecks && !ProtectionUtil
.canBuild(event.getPlayer(), event.getPlayer().getLocation(), false))
return;
Bukkit.getScheduler().runTask(CraftBookPlugin.inst(), new SnowHandler(event.getTo().getBlock(), -1));
}
}
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onBlockBreak(BlockBreakEvent event) {
if(event.getBlock().getType() == Material.SNOW) {
if(!EventUtil.passesFilter(event))
return;
event.setCancelled(true);
event.getBlock().setType(Material.AIR, false);
for(ItemStack stack : BlockUtil.getBlockDrops(event.getBlock(), event.getPlayer().getItemInHand()))
event.getBlock().getWorld().dropItemNaturally(BlockUtil.getBlockCentre(event.getBlock()), stack);
if(realistic) {
BlockFace[] faces = new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST};
for(BlockFace dir : faces) Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(event.getBlock().getRelative(dir), 0, event.getBlock().getLocation().toVector().toBlockVector()), animationTicks);
}
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onPhysicsUpdate(BlockPhysicsEvent event) {
if(!realistic) return;
if(!EventUtil.passesFilter(event))
return;
if((event.getBlock().getType() == Material.SNOW || event.getBlock().getType() == Material.SNOW_BLOCK) && CraftBookPlugin.inst().getRandom().nextInt(10) == 0)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(event.getBlock(), 0), animationTicks);
}
@EventHandler(priority = EventPriority.HIGH)
public void onChunkLoad(ChunkLoadEvent event) {
if(!piling) return;
if(!EventUtil.passesFilter(event))
return;
boolean isChunkUseful = false;
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
if(meltSunlight || event.getChunk().getBlock(x, event.getWorld().getMaxHeight()-1, z).getTemperature() < 0.15) {
isChunkUseful = true;
break;
}
}
}
if(!isChunkUseful) return;
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowChunkHandler(event.getChunk()), getRandomDelay() * (event.getWorld().hasStorm() ? 20L : 10L));
}
private class SnowChunkHandler implements Runnable {
public Chunk chunk;
SnowChunkHandler(Chunk chunk) {
this.chunk = chunk;
}
@Override
public void run () {
if(!chunk.isLoaded()) {
return; //Abandon ship.
}
boolean meltMode = !chunk.getWorld().hasStorm() && meltSunlight;
Block chunkBase = chunk.getBlock(0, 0, 0);
Block highest = chunk.getWorld().getHighestBlockAt(chunkBase.getX() + CraftBookPlugin.inst().getRandom().nextInt(16), chunkBase.getZ() + CraftBookPlugin.inst().getRandom().nextInt(16));
if(highest.getType() == Material.SNOW || highest.getType() == Material.SNOW_BLOCK || highest.getType() == Material.ICE || isReplacable(highest)) {
if(highest.getWorld().hasStorm() && highest.getType() != Material.ICE) {
if(highest.getTemperature() < 0.15) {
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(highest, 1), animationTicks);
}
} else if(meltMode) {
if(highest.getType() == Material.SNOW && meltPartial)
if(highest.getData() == 0) return;
if(highest.getTemperature() > 0.05)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(highest, -1), animationTicks);
}
}
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), this, getRandomDelay() * (meltMode ? 5L : 20L));
}
}
private static long getRandomDelay() {
return CraftBookPlugin.inst().getRandom().nextInt(4) + 1; // 5 is max possible, 1 is min possible.
}
private class SnowHandler implements Runnable {
Block block;
SnowBlock snowblock;
int amount;
SnowHandler(Block block, int amount) {
snowblock = new SnowBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ());
if(queue.contains(snowblock)) {
snowblock = null;
return;
}
this.block = block;
this.amount = amount;
queue.add(snowblock);
}
SnowHandler(Block block, int amount, BlockVector from) {
this(block, amount);
this.from = from;
}
BlockVector from;
@Override
public void run () {
if(snowblock == null || !queue.contains(snowblock)) return; //Something went wrong here.
queue.remove(snowblock);
if(amount == 0) {
if(realistic)
if(!disperse(block) && !canLandOn(block.getRelative(0, -1, 0)))
decreaseSnow(block, false);
} else if (amount < 0) {
if(decreaseSnow(block, true))
amount++;
if(amount < 0)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(block, amount), animationTicks);
} else {
if(increaseSnow(block, realistic))
amount--;
if(amount > 0)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(block, amount), animationTicks);
}
}
boolean disperse(Block snow) {
if(!realistic) return false;
List<BlockFace> faces = new LinkedList<>(Arrays.asList(BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST));
if(snow.getType() == Material.SNOW && canLandOn(snow.getRelative(0, -2, 0)) && isReplacable(snow.getRelative(0, -1, 0)))
faces = new LinkedList<>(Collections.singletonList(BlockFace.DOWN));
else {
Collections.shuffle(faces, CraftBookPlugin.inst().getRandom());
faces.add(0, BlockFace.DOWN);
}
BlockFace best = null;
int bestDiff = 0;
for(BlockFace dir : faces) {
Block block = snow.getRelative(dir);
if(from != null && block.getLocation().getBlockX() == from.getBlockX() && block.getLocation().getBlockY() == from.getBlockY() && block.getLocation().getBlockZ() == from.getBlockZ()) continue;
if(!isReplacable(block)) continue;
if(queue.contains(new SnowBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ()))) continue;
if(block.getType() == Material.SNOW && snow.getType() == Material.SNOW && block.getData() >= snow.getData() && dir != BlockFace.DOWN && dir != BlockFace.UP) {
if(block.getData() > snow.getData()+1) {
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(block, 0, snow.getLocation().toVector().toBlockVector()),
animationTicks);
}
continue;
}
if (isReplacable(block) && snow.getType() == Material.SNOW && (snow.getData() == 0 || block.getType() == Material.SNOW && block.getData() == snow.getData() - 1) && dir != BlockFace.DOWN && dir != BlockFace.UP && canLandOn(block.getRelative(0, -1, 0)) && CraftBookPlugin.inst().getRandom().nextInt(10) != 0)
continue;
int diff;
if(block.getType() == Material.SNOW) {
if(snow.getData() == 2 && block.getData() == 1 && dir != BlockFace.DOWN)
continue;
diff = snow.getData() - block.getData();
} else
diff = block.getType() == Material.AIR ? 100 : 99;
if(diff > bestDiff || dir == BlockFace.DOWN) {
best = dir;
bestDiff = diff;
if(dir == BlockFace.DOWN) break;
}
}
if(best != null) {
Block block = snow.getRelative(best);
if(snow.getLocation().equals(block.getLocation())) return false;
boolean success = false;
if(amount < 0) {
if(decreaseSnow(block, false))
success = increaseSnow(snow, true);
} else {
if(decreaseSnow(snow, false))
success = increaseSnow(block, true);
}
return success;
}
return false;
}
boolean increaseSnow(Block snow, boolean disperse) {
if (!animateFalling) {
while (snow.getRelative(0, -1, 0).getType() == Material.AIR) {
snow = snow.getRelative(0, -1, 0);
}
}
Block below = snow.getRelative(0, -1, 0);
if(below.getType() != Material.AIR && isReplacable(below)) {
if(below.getType() != Material.SNOW || below.getData() < 0x7)
return increaseSnow(below, disperse);
}
if (freezeWater && (below.getType() == Material.WATER)) {
if(below.getData() == 0) {
BlockState state = below.getState();
state.setType(Material.ICE);
if(ProtectionUtil.canBlockForm(state.getBlock(), state))
below.setType(Material.ICE);
} else below.setType(Material.AIR);
} else if(below.getType() == Material.WATER) {
return true; //Still return true, pretend it's actually succeeded.
}
if(snow.getType() != Material.SNOW && snow.getType() != Material.SNOW_BLOCK) {
if (below.getType() == Material.SNOW_BLOCK) {
boolean allowed = false;
if (pileHigh) {
for (int i = 0; i < maxPileHeight + 1; i++) {
if (below.getRelative(0, -i, 0).getType() != Material.SNOW_BLOCK) {
allowed = true;
break;
}
}
}
if (!allowed) {
return false;
}
}
if(isReplacable(snow)) {
snow.setType(Material.SNOW, false);
if(disperse)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(snow, 0, from), animationTicks);
return true;
} else
return false;
}
org.bukkit.block.data.type.Snow snowData = (org.bukkit.block.data.type.Snow) snow.getBlockData();
if(snowData.getLayers() + 1 > snowData.getMaximumLayers()) {
if(pileHigh) {
boolean allowed = false;
for(int i = 0; i < maxPileHeight+1; i++) {
if(below.getRelative(0,-i,0).getType() != Material.SNOW_BLOCK) {
allowed = true;
break;
}
}
if(allowed) {
snow.setType(Material.SNOW_BLOCK);
if(disperse)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(snow, 0, from), animationTicks);
return true;
} else
return false;
} else
return false;
} else
snowData.setLayers(snowData.getLayers() + 1);
if(disperse)
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(snow, 0, from), animationTicks);
return true;
}
boolean decreaseSnow(Block snow, boolean disperse) {
if(snow.getType() == Material.ICE) {
snow.setType(Material.WATER);
return true;
}
if(snow.getType() != Material.SNOW && snow.getType() != Material.SNOW_BLOCK)
return false;
if(snow.getRelative(0, 1, 0).getType() == Material.SNOW || snow.getRelative(0, 1, 0).getType() == Material.SNOW_BLOCK) {
return decreaseSnow(snow.getRelative(0,1,0), disperse);
}
if (snow.getType() == Material.SNOW_BLOCK) {
org.bukkit.block.data.type.Snow snowData = (org.bukkit.block.data.type.Snow) Material.SNOW.createBlockData();
snowData.setLayers(snowData.getMaximumLayers() - 1);
snow.setBlockData(snowData, false);
} else {
org.bukkit.block.data.type.Snow snowData = (org.bukkit.block.data.type.Snow) snow.getBlockData();
if (snowData.getLayers() == 0) {
snow.setType(Material.AIR, false);
} else {
snowData.setLayers(snowData.getLayers() - 1);
}
}
if(disperse && realistic) {
BlockFace[] faces = new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST};
for(BlockFace dir : faces) Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(snow.getRelative(dir), 0, snow.getLocation().toVector().toBlockVector()),
animationTicks);
}
return true;
}
}
private Set<SnowBlock> queue = new HashSet<>();
private static class SnowBlock {
int x,y,z;
char[] worldname;
SnowBlock(String worldname, int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
this.worldname = worldname.toCharArray();
}
@Override
public boolean equals(Object o) {
return o instanceof SnowBlock
&& ((SnowBlock) o).x == x && ((SnowBlock) o).y == y
&& ((SnowBlock) o).z == z && Arrays.equals(((SnowBlock) o).worldname, worldname);
}
@Override
public int hashCode() {
// Constants correspond to glibc's lcg algorithm parameters
return (Arrays.hashCode(worldname) * 1103515245 + 12345 ^ x * 1103515245 + 12345 ^ y
* 1103515245 + 12345 ^ z * 1103515245 + 12345) * 1103515245 + 12345;
}
}
private boolean piling;
private boolean trample;
private boolean partialTrample;
private boolean place;
private boolean slowdown;
private boolean realistic;
private boolean pileHigh;
private int maxPileHeight;
private boolean jumpTrample;
private List<BlockStateHolder> realisticReplacables;
private int animationTicks;
private boolean freezeWater;
private boolean meltSunlight;
private boolean meltPartial;
private boolean animateFalling;
private static List<String> getDefaultReplacables() {
return Lists.newArrayList(
BlockTypes.DEAD_BUSH.getId(),
BlockTypes.GRASS.getId(),
BlockTypes.DANDELION.getId(),
BlockTypes.POPPY.getId(),
BlockTypes.BROWN_MUSHROOM.getId(),
BlockTypes.RED_MUSHROOM.getId(),
BlockTypes.FIRE.getId(),
BlockTypes.FERN.getId());
}
@Override
public void loadConfiguration (YAMLProcessor config, String path) {
config.setComment(path + "piling", "Enables the piling feature of the Snow mechanic.");
piling = config.getBoolean(path + "piling", false);
config.setComment(path + "trample", "Enables the trampling feature of the Snow mechanic.");
trample = config.getBoolean(path + "trample", false);
config.setComment(path + "partial-trample-only", "If trampling is enabled, only trample it down to the smallest snow.");
partialTrample = config.getBoolean(path + "partial-trample-only", false);
config.setComment(path + "jump-trample", "Require jumping to trample snow.");
jumpTrample = config.getBoolean(path + "jump-trample", false);
config.setComment(path + "place", "Allow snowballs to create snow when they land.");
place = config.getBoolean(path + "place", false);
config.setComment(path + "slowdown", "Slows down entities as they walk through thick snow.");
slowdown = config.getBoolean(path + "slowdown", false);
config.setComment(path + "realistic", "Realistically move snow around, creating an 'avalanche' or 'mound' effect.");
realistic = config.getBoolean(path + "realistic", false);
config.setComment(path + "high-piling", "Allow piling above the 1 block height.");
pileHigh = config.getBoolean(path + "high-piling", false);
config.setComment(path + "max-pile-height", "The maximum piling height of high piling snow.");
maxPileHeight = config.getInt(path + "max-pile-height", 3);
config.setComment(path + "replacable-blocks", "A list of blocks that can be replaced by realistic snow.");
realisticReplacables = BlockSyntax.getBlocks(config.getStringList(path + "replacable-blocks", getDefaultReplacables()), true);
config.setComment(path + "animate-falling", "Cause the snow to fall slowly (May be intensive).");
animateFalling = config.getBoolean(path + "animate-falling", false);
config.setComment(path + "falldown-animation-speed", "The animation delay of all snow interactions in ticks.");
animationTicks = config.getInt(path + "falldown-animation-speed", 5);
config.setComment(path + "freeze-water", "Should snow freeze water?");
freezeWater = config.getBoolean(path + "freeze-water", false);
config.setComment(path + "melt-in-sunlight", "Enables snow to melt in sunlight.");
meltSunlight = config.getBoolean(path + "melt-in-sunlight", false);
config.setComment(path + "partial-melt-only", "If melt in sunlight is enabled, only melt it down to the smallest snow.");
meltPartial = config.getBoolean(path + "partial-melt-only", false);
}
}