mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-16 22:01:07 +00:00
rename TerraPlugin to Platform
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.addons.structure;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.addon.annotations.Addon;
|
||||
import com.dfsek.terra.api.addon.annotations.Author;
|
||||
@@ -16,7 +16,7 @@ import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
@Author("Terra")
|
||||
public class StructureAddon extends TerraAddon {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
package com.dfsek.terra.addons.structure;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
|
||||
|
||||
public class StructureFactory implements ConfigFactory<StructureTemplate, ConfiguredStructure> {
|
||||
@Override
|
||||
public ConfiguredStructure build(StructureTemplate config, TerraPlugin main) {
|
||||
public ConfiguredStructure build(StructureTemplate config, Platform main) {
|
||||
return new TerraStructure(config.getStructures(), config.getY(), config.getSpawn());
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.config.WorldConfig;
|
||||
import com.dfsek.terra.api.profiler.ProfileFrame;
|
||||
import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
@@ -20,9 +20,9 @@ import com.dfsek.terra.api.world.generator.GenerationStage;
|
||||
|
||||
|
||||
public class StructurePopulator implements GenerationStage, Chunkified {
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public StructurePopulator(TerraPlugin main) {
|
||||
public StructurePopulator(Platform main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
@@ -19,12 +19,12 @@ public class AsyncStructureFinder implements Runnable {
|
||||
protected final int centerX;
|
||||
protected final int centerZ;
|
||||
protected final World world;
|
||||
protected final TerraPlugin main;
|
||||
protected final Platform main;
|
||||
private final Consumer<Vector3> callback;
|
||||
protected int searchSize = 1;
|
||||
|
||||
public AsyncStructureFinder(BiomeProvider provider, ConfiguredStructure target, @NotNull Vector3 origin, World world, int startRadius,
|
||||
int maxRadius, Consumer<Vector3> callback, TerraPlugin main) {
|
||||
int maxRadius, Consumer<Vector3> callback, Platform main) {
|
||||
//setSearchSize(target.getSpawn().getWidth() + 2 * target.getSpawn().getSeparation());
|
||||
this.provider = provider;
|
||||
this.target = target;
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.block.entity.BlockEntity;
|
||||
import com.dfsek.terra.api.block.entity.Sign;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
@@ -29,7 +29,7 @@ import com.dfsek.terra.api.util.vector.Vector3;
|
||||
@Command(arguments = @Argument("id"), usage = "/terra structure export <ID>")
|
||||
public class StructureExportCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@ArgumentTarget("id")
|
||||
private String id;
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
import com.dfsek.terra.addons.structure.command.structure.argument.ScriptArgumentParser;
|
||||
import com.dfsek.terra.addons.structure.command.structure.completer.RotationCompleter;
|
||||
import com.dfsek.terra.addons.structure.command.structure.completer.ScriptCompleter;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Argument;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
@@ -54,7 +54,7 @@ public class StructureLoadCommand implements CommandTemplate {
|
||||
private Structure script;
|
||||
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import java.util.Locale;
|
||||
import com.dfsek.terra.addons.structure.command.AsyncStructureFinder;
|
||||
import com.dfsek.terra.addons.structure.command.structure.argument.StructureArgumentParser;
|
||||
import com.dfsek.terra.addons.structure.command.structure.completer.StructureCompleter;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Argument;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
@@ -42,7 +42,7 @@ import com.dfsek.terra.api.util.vector.Vector3;
|
||||
))
|
||||
public class StructureLocateCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@ArgumentTarget("structure")
|
||||
private ConfiguredStructure structure;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.addons.structure.command.structure.argument;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.arg.ArgumentParser;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.entity.Player;
|
||||
@@ -10,7 +10,7 @@ import com.dfsek.terra.api.structure.Structure;
|
||||
|
||||
public class ScriptArgumentParser implements ArgumentParser<Structure> {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public Structure parse(CommandSender sender, String arg) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.addons.structure.command.structure.argument;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.arg.ArgumentParser;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.entity.Player;
|
||||
@@ -10,7 +10,7 @@ import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
|
||||
public class StructureArgumentParser implements ArgumentParser<ConfiguredStructure> {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public ConfiguredStructure parse(CommandSender sender, String arg) {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.dfsek.terra.addons.structure.command.structure.completer;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.tab.TabCompleter;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.entity.Player;
|
||||
@@ -13,7 +13,7 @@ import com.dfsek.terra.api.structure.Structure;
|
||||
|
||||
public class ScriptCompleter implements TabCompleter {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public List<String> complete(CommandSender sender) {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.dfsek.terra.addons.structure.command.structure.completer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.tab.TabCompleter;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.entity.Player;
|
||||
@@ -13,7 +13,7 @@ import com.dfsek.terra.api.structure.configured.ConfiguredStructure;
|
||||
|
||||
public class StructureCompleter implements TabCompleter {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public List<String> complete(CommandSender sender) {
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ import com.dfsek.terra.addons.structure.structures.loot.functions.AmountFunction
|
||||
import com.dfsek.terra.addons.structure.structures.loot.functions.DamageFunction;
|
||||
import com.dfsek.terra.addons.structure.structures.loot.functions.EnchantFunction;
|
||||
import com.dfsek.terra.addons.structure.structures.loot.functions.LootFunction;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.inventory.Item;
|
||||
import com.dfsek.terra.api.inventory.ItemStack;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Entry {
|
||||
*
|
||||
* @param entry The JSON Object to instantiate from.
|
||||
*/
|
||||
public Entry(JSONObject entry, TerraPlugin main) {
|
||||
public Entry(JSONObject entry, Platform main) {
|
||||
String id = entry.get("name").toString();
|
||||
this.item = main.getItemHandle().createItem(id);
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.inventory.Inventory;
|
||||
import com.dfsek.terra.api.inventory.ItemStack;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LootTableImpl implements com.dfsek.terra.api.structure.LootTable {
|
||||
*
|
||||
* @throws ParseException if malformed JSON is passed.
|
||||
*/
|
||||
public LootTableImpl(String json, TerraPlugin main) throws ParseException {
|
||||
public LootTableImpl(String json, Platform main) throws ParseException {
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
Object tableJSON = jsonParser.parse(json);
|
||||
JSONArray poolArray = (JSONArray) ((JSONObject) tableJSON).get("pools");
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.inventory.ItemStack;
|
||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Pool {
|
||||
*
|
||||
* @param pool The JSON Object to instantiate from.
|
||||
*/
|
||||
public Pool(JSONObject pool, TerraPlugin main) {
|
||||
public Pool(JSONObject pool, Platform main) {
|
||||
entries = new ProbabilityCollection<>();
|
||||
Object amount = pool.get("rolls");
|
||||
if(amount instanceof Long) {
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.inventory.ItemStack;
|
||||
import com.dfsek.terra.api.inventory.item.Enchantment;
|
||||
import com.dfsek.terra.api.inventory.item.ItemMeta;
|
||||
@@ -18,10 +18,10 @@ public class EnchantFunction implements LootFunction {
|
||||
private final int min;
|
||||
private final int max;
|
||||
private final JSONArray disabled;
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
|
||||
public EnchantFunction(int min, int max, JSONArray disabled, TerraPlugin main) {
|
||||
public EnchantFunction(int min, int max, JSONArray disabled, Platform main) {
|
||||
this.max = max;
|
||||
this.min = min;
|
||||
this.disabled = disabled;
|
||||
|
||||
Reference in New Issue
Block a user