mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 22:10:22 +00:00
Add FixChunk command
This commit is contained in:
1 parent
8e1dd75ae9
commit
c91d2a46ed
4 files changed
+53
-2
No files matched your search
@@ -100,7 +100,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.polydev</groupId>
|
<groupId>org.polydev</groupId>
|
||||||
<artifactId>gaea</artifactId>
|
<artifactId>gaea</artifactId>
|
||||||
<version>1.11.2</version>
|
<version>1.11.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.dfsek.terra.command;
|
||||||
|
|
||||||
|
import com.dfsek.terra.generation.TerraChunkGenerator;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.polydev.gaea.command.WorldCommand;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class FixChunkCommand extends WorldCommand {
|
||||||
|
public FixChunkCommand(org.polydev.gaea.command.Command parent) {
|
||||||
|
super(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Player player, @NotNull Command command, @NotNull String s, @NotNull String[] strings, World world) {
|
||||||
|
TerraChunkGenerator.fixChunk(player.getLocation().getChunk());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "fixchunk";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int arguments() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getTabCompletions(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,7 +23,8 @@ public class TerraCommand extends Command {
|
|||||||
new SaveDataCommand(this),
|
new SaveDataCommand(this),
|
||||||
new StructureCommand(this),
|
new StructureCommand(this),
|
||||||
new ImageCommand(this),
|
new ImageCommand(this),
|
||||||
new GeometryCommand(this));
|
new GeometryCommand(this),
|
||||||
|
new FixChunkCommand(this));
|
||||||
|
|
||||||
public TerraCommand(GaeaPlugin main) {
|
public TerraCommand(GaeaPlugin main) {
|
||||||
super(main);
|
super(main);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.dfsek.terra.population.TreePopulator;
|
|||||||
import com.dfsek.terra.structure.StructureSpawnRequirement;
|
import com.dfsek.terra.structure.StructureSpawnRequirement;
|
||||||
import com.dfsek.terra.util.DataUtil;
|
import com.dfsek.terra.util.DataUtil;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
@@ -156,6 +157,11 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static synchronized void fixChunk(Chunk c) {
|
||||||
|
if(!(c.getWorld().getGenerator() instanceof TerraChunkGenerator)) throw new IllegalArgumentException();
|
||||||
|
popMap.get(c.getWorld()).checkNeighbors(c.getX(), c.getZ(), c.getWorld());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNoiseOctaves(World world) {
|
public int getNoiseOctaves(World world) {
|
||||||
return 4;
|
return 4;
|
||||||
|
|||||||
Reference in new issue
Block a user