Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/org/blockserver/core/module/Enableable.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
*/
public interface Enableable {
void onEnable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import java.util.Map;
import java.util.WeakHashMap;

/**
* @author BlockServer Team
* @see org.blockserver.core.module.Enableable
*/
public interface EnableableImplementation extends Enableable {
Map<EnableableImplementation, Boolean> instances = new WeakHashMap<>();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/blockserver/core/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import org.blockserver.core.Server;

/**
* Base class for all modules.
* Base class for all modules. New modules should implement this class.
*
* @author BlockServer Team
* @see org.blockserver.core.modules
* @see org.blockserver.core.module.EnableableImplementation
*/
public class Module implements EnableableImplementation {
@Getter private final Server server;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/blockserver/core/module/ModuleLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

import java.util.Collection;

/**
* @author BlockServer Team
* @see org.blockserver.core.module.loaders
*/
public interface ModuleLoader {
Collection<Module> setModules(Collection<Module> currentModules, Server server);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

import java.util.Collection;

/**
* @author BlockServer Team
* @see org.blockserver.core.module.ModuleLoader
*/
public class CoreModuleLoader implements ModuleLoader {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

/**
* Module Loader that can load modules from JARs
*
* @author BlockServer Team
* @see org.blockserver.core.module.ModuleLoader
*/
public class JarModuleLoader implements ModuleLoader {
@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/blockserver/core/modules/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
*/
public class Entity {
private float x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import org.blockserver.core.module.Module;

/**
* Logging Module with different log levels. (debug, info, warn, error)
* TODO: Implement SLF4j and/or log4j2
*
* @author BlockServer Team
* @see org.blockserver.core.module.Module
*/
public class LoggingModule extends Module {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* Represents a Player on the server.
*
* @author BlockServer Team
* @see PlayerModule
*/
public class Player {
@Getter private final Server server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

/**
* Module that handles players.
*
* @author BlockServer Team
* @see org.blockserver.core.module.Module
*/
public class PlayerModule extends Module {
private final Set<Player> players = Collections.synchronizedSet(new HashSet<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see org.blockserver.core.module.Module
*/
public class SchedulerModule extends Module {
@Getter private final Map<Runnable, TaskData> tasks = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see SchedulerModule
*/
public class TaskData {
@Getter @Setter protected long lastTickTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see org.blockserver.core.module.Module
*/
public class ServerListModule extends Module {
private final SchedulerModule schedulerModule;
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/blockserver/core/modules/world/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,31 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see WorldModule
*/
public class Block {
@Getter private World world;
@Getter private Material material;
@Getter private byte lightLevel;
@Getter private Vector vector;

/**
* Sets lightlevel between 0 and 15.
*
* @param lightLevel block lightlevel
*/
public void setLightLevel(byte lightLevel) {
this.lightLevel = lightLevel;
}

/**
* Sets block material.
*
* @param material block material
* @see Material
*/
public void setMaterial(Material material) {
this.material = material;
for (Player player : world.getPlayers()) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/blockserver/core/modules/world/Chunk.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see WorldModule
*/
public class Chunk {
public Block getBlockAt(int x, int y, int z) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see WorldModule
*/
public interface ChunkProvider {
Chunk loadChunkAt(int x, int y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see WorldModule
*/
public enum Material {
}
5 changes: 3 additions & 2 deletions src/main/java/org/blockserver/core/modules/world/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see WorldModule
*/
public class World {
@Getter private Server server;
Expand All @@ -34,6 +37,4 @@ public class World {
public World(Server server) {
this.server = server;
}


}
14 changes: 12 additions & 2 deletions src/main/java/org/blockserver/core/modules/world/WorldModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see org.blockserver.core.module.Module
*/
public class WorldModule extends Module {
public WorldModule(Server server) {
super(server);
}


/**
* Setter method for block material.
*
* @param block Block which's material will be set.
* @param material material of the block
*/
public void setBlockMaterial(Block block, Material material) {

block.setMaterial(material);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see org.blockserver.core.modules.world.positions.Vector
* @see org.blockserver.core.modules.world.WorldModule
*/
public class Location extends Vector {
@Getter long yaw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

/**
* Written by Exerosis!
*
* @author BlockServer Team
* @see org.blockserver.core.modules.world.WorldModule
*/
public class Vector {
@Getter float x;
Expand Down