Skip to content

Commit

Permalink
Improved Developer API
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandw11 committed Jun 29, 2020
1 parent e95f520 commit bf65478
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/com/ryandw11/structure/api/ConditionType.java

This file was deleted.

36 changes: 34 additions & 2 deletions src/com/ryandw11/structure/api/CustomStructuresAPI.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
package com.ryandw11.structure.api;

import com.ryandw11.structure.CustomStructures;
import com.ryandw11.structure.loottables.LootTablesHandler;
import com.ryandw11.structure.loottables.customitems.CustomItemManager;
import com.ryandw11.structure.structure.StructureHandler;

public class CustomStructuresAPI {

private CustomStructures plugin;
public CustomStructuresAPI(){
this.plugin = CustomStructures.plugin;
}


public CustomStructures getMainInstance() {
return CustomStructures.plugin;
return plugin;
}

/**
* Get the number of structures.
* @return The number of structures.
*/
public int getNumberOfStructures() {
return CustomStructures.getInstance().getStructureHandler().getStructures().size();
return getStructureHandler().getStructures().size();
}

/**
* Get the structure handler.
* @return The structure handler.
*/
public StructureHandler getStructureHandler(){
return plugin.getStructureHandler();
}

/**
* Get the loot table handler.
* @return The loot table handler.
*/
public LootTablesHandler getLootTableHandler(){
return plugin.getLootTableHandler();
}

/**
* Get the custom item manager.
* @return The custom item manager.
*/
public CustomItemManager getCustomItemManager(){
return plugin.getCustomItemManager();
}
}
3 changes: 3 additions & 0 deletions src/com/ryandw11/structure/structure/Structure.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

/**
* The main class when it comes to structures.
*/
public class Structure {
private final String name;
private final String schematic;
Expand Down

0 comments on commit bf65478

Please sign in to comment.