Skip to content
Closed
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
BlockServer [![Build Status](https://travis-ci.org/BlockServerProject/BlockServer.svg?branch=master)](https://travis-ci.org/BlockServerProject/BlockServer)
===========
BlockServer is an open source platform for Minecraft server software. It is very extensible and open source. This repository contains the core which is needed to run and load the extra modules which allow players to connect to the server.

The BlockServer Project develops modules to support both PC and PE connections. Currently PC is lower priority as our goal is to support PE first.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.blockserver.core.Server;
import org.blockserver.core.events.MessageHandleEvent;
import org.blockserver.core.message.Message;
import org.blockserver.core.modules.message.Message;

/**
* Written by Exerosis!
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/org/blockserver/core/event/ServerEventListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.event;

import org.blockserver.core.Server;

/**
* Written by Exerosis!
*/
public class ServerEventListener<B> extends EventListener<B, B> {
public void register(Class<B> listenerType, Server server) {
register(listenerType, server.getEventManager());
}

public ServerEventListener<B> post() {
super.post();
return this;
}

public ServerEventListener<B> priority(Priority priority) {
super.priority(priority);
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lombok.Getter;
import lombok.Setter;
import org.blockserver.core.event.CancellableImplementation;
import org.blockserver.core.message.Message;
import org.blockserver.core.modules.message.Message;

/**
* Written by Exerosis!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.exceptions;

import org.blockserver.core.exceptions.node.ExceptionBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.exceptions.node;

public class ExceptionBuilder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.exceptions.node;

public class ExceptionNode {
Expand Down
54 changes: 0 additions & 54 deletions src/main/java/org/blockserver/core/message/MessageModule.java

This file was deleted.

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
44 changes: 44 additions & 0 deletions src/main/java/org/blockserver/core/modules/entity/Entity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.modules.entity;

import org.blockserver.core.modules.world.positions.Location;

/**
* Written by Exerosis!
*
* @author BlockServer Team
*/
public class Entity {
private float x;
private float y;
private float z;

public Entity(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}

public Entity(Location location) {
this(location.getX(), location.getY(), location.getZ());
}

public Location getLocation() {
return new Location(x, y, z);
}
}
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 @@ -14,7 +14,7 @@
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.message;
package org.blockserver.core.modules.message;

import lombok.Getter;
import lombok.Setter;
Expand All @@ -24,9 +24,16 @@
* Written by Exerosis!
*/
public class Message {
@Getter final private boolean async;
@Getter @Setter private Player player;

public Message(Player player) {
this.player = player;
async = false;
}

public Message(Player player, boolean async) {
this.player = player;
this.async = async;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* This file is part of BlockServer.
*
* BlockServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlockServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.modules.message;

import org.blockserver.core.modules.player.Player;
import org.blockserver.core.utilities.Skin;

import java.util.UUID;

/**
* Written by Exerosis!
*/
public class PlayerLoginMessage extends Message {
public long clientID;
public String username;
public UUID uuid;
public Skin skin;

public PlayerLoginMessage(Player player) {
super(player);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with BlockServer. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blockserver.core.message.block;
package org.blockserver.core.modules.message.block;

import org.blockserver.core.message.Message;
import org.blockserver.core.modules.message.Message;
import org.blockserver.core.modules.player.Player;
import org.blockserver.core.modules.world.Block;

Expand Down
Loading