Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #26 from McMoonLakeDev/v1.9-alpha
Browse files Browse the repository at this point in the history
v1.9 a1
  • Loading branch information
MoonLake authored Jan 27, 2017
2 parents 627ad66 + a3d3937 commit 463802a
Show file tree
Hide file tree
Showing 56 changed files with 4,996 additions and 413 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MoonLake [![GitHub version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=gh&type=6&v=1.8-final&x2=0)](https://github.com/u2g/MoonLake) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/u2g/MoonLake) [![Open Source Love](https://badges.frapsoft.com/os/gpl/gpl.svg?v=102)](https://github.com/u2g/MoonLake)
# MoonLake [![GitHub version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=gh&type=6&v=1.9-a1&x2=0)](https://github.com/u2g/MoonLake) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/u2g/MoonLake) [![Open Source Love](https://badges.frapsoft.com/os/gpl/gpl.svg?v=102)](https://github.com/u2g/MoonLake)

Minecraft MoonLake Core API Plugin
By Month_Light Ver: 1.8-final
By Month_Light Ver: 1.9-a1

## 简介
这个插件提供了大量的 API 功能,实现了一些 Bukkit 无法做到的 NMS 功能<br />
Expand Down
6 changes: 3 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
################################
# MoonLake Core API Plugin #
# By Month_Light Ver: 1.8-final #
# By Month_Light Ver: 1.9-a1 #
################################

# 插件版本号: 此项请勿修改!
version: '1.8-final'
version: '1.9-a1'

# 数据包通道监听器
# 此项可设置是否开启这个功能
# 如果关闭则插件中的一些API功能将无法使用
# 例如: MoonLakePlayerJoinEvent
# PS: 此项是实时监听客户端与服务端的数据包交流
PacketChannelListener: false
PacketChannelListener: true
4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: MoonLake
main: com.minecraft.moonlake.MoonLakePlugin
version: 1.8-final
version: 1.9-a1
prefix: MoonLake
description: Minecraft MoonLake Core API Plugin
website: http://www.mcyszh.com/
author: Month_Light
authors: [Month_Light, MoonLake]
softdepend: [MoonLakeEconomy, PermissionsEx, Vault]
softdepend: [MoonLakeEconomy, PermissionsEx, Vault, WorldEdit]
28 changes: 25 additions & 3 deletions src/com/minecraft/moonlake/MoonLakeAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import com.minecraft.moonlake.event.EventHelper;
import com.minecraft.moonlake.exception.MoonLakeException;
import com.minecraft.moonlake.execute.Consumer;
import com.minecraft.moonlake.logger.MLogger;
import com.minecraft.moonlake.mysql.MySQLConnection;
import com.minecraft.moonlake.mysql.MySQLFactory;
import com.minecraft.moonlake.mysql.exception.MySQLInitializeException;
Expand Down Expand Up @@ -79,6 +78,7 @@
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.logging.Logger;

/**
* <h1>MoonLakeAPI</h1>
Expand Down Expand Up @@ -118,9 +118,9 @@ public static MoonLakePlugin getMoonLake() {
*
* @return 日志对象
*/
public static MLogger getMLogger() {
public static Logger getLogger() {

return moonlake.getMLogger();
return moonlake.getLogger();
}

/**
Expand Down Expand Up @@ -1622,6 +1622,28 @@ public static void callEvent(MoonLakeEvent event) {
EventHelper.callEvent(event);
}

/**
* 调用事件帮助器异步触发指定事件
*
* @param plugin 插件
* @param event 事件
*/
public static void callEventAsync(Plugin plugin, Event event) {

EventHelper.callEventAsync(plugin, event);
}

/**
* 调用事件帮助器异步触发指定事件
*
* @param plugin 插件
* @param event 事件
*/
public static void callEventAsync(Plugin plugin, MoonLakeEvent event) {

EventHelper.callEventAsync(plugin, event);
}

/**
* 调用事件帮助器注册事件监听器
*
Expand Down
18 changes: 4 additions & 14 deletions src/com/minecraft/moonlake/MoonLakePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import com.minecraft.moonlake.api.packet.listener.PacketListenerFactory;
import com.minecraft.moonlake.api.player.PlayerLibraryFactorys;
import com.minecraft.moonlake.exception.MoonLakeException;
import com.minecraft.moonlake.logger.MLogger;
import com.minecraft.moonlake.logger.MLoggerWrapped;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -34,7 +32,7 @@
* <hr />
* <div>
* <h1>Minecraft MoonLake Core API Plugin</h1>
* <p>By Month_Light Ver: 1.8-final</p>
* <p>By Month_Light Ver: 1.9-a1</p>
* <p>Website: <a href="http://www.mcyszh.com" target="_blank" style="text-decoration: none;">MoonLake Website</a></p>
* <p>QQ Group: 377607025 -> <a href="http://jq.qq.com/?_wv=1027&k=2IfPFrH" target="_blank">Jump</a></p>
* <hr />
Expand Down Expand Up @@ -69,12 +67,11 @@
* <h1>修改操作请您遵守 <a href="https://github.com/u2g/MoonLake/blob/master/LICENSE" target="_blank">GPLv3</a> 协议,您必须公开修改过的所有代码!</h1>
* </div>
*
* @version 1.8-final
* @version 1.9-a1
* @author Month_Light
*/
public class MoonLakePlugin extends JavaPlugin implements MoonLake {

private final MLogger mLogger;
private final PluginDescriptionFile description;
private MoonLakePluginConfig configuration;

Expand All @@ -86,7 +83,6 @@ public class MoonLakePlugin extends JavaPlugin implements MoonLake {
public MoonLakePlugin() {

this.description = getDescription();
this.mLogger = new MLoggerWrapped("MoonLake");
}

@Override
Expand All @@ -103,7 +99,7 @@ public void onEnable() {
// load class
this.loadClass();

this.getMLogger().info("月色之湖核心 API 插件 v" + getPluginVersion() + " 成功加载.");
this.getLogger().info("月色之湖核心 API 插件 v" + getPluginVersion() + " 成功加载.");
}

private void loadClass() {
Expand All @@ -113,7 +109,7 @@ private void loadClass() {
// load PacketListenerFactory class
Class.forName(PacketListenerFactory.class.getName());

this.getMLogger().info("月色之湖数据包通道监听器(PCL)成功加载.");
this.getLogger().info("月色之湖数据包通道监听器(PCL)成功加载.");
}
// load PlayerLibraryFactorys class to register listener
Class.forName(PlayerLibraryFactorys.class.getName());
Expand Down Expand Up @@ -143,12 +139,6 @@ public static MoonLake getInstances() {
return MAIN;
}

@Override
public MLogger getMLogger() {

return mLogger;
}

@Override
public MoonLakePlugin getPlugin() {

Expand Down
5 changes: 3 additions & 2 deletions src/com/minecraft/moonlake/api/MoonLake.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

import com.minecraft.moonlake.MoonLakePlugin;
import com.minecraft.moonlake.MoonLakePluginConfig;
import com.minecraft.moonlake.logger.MLogger;

import java.util.logging.Logger;

/**
* <hr />
Expand All @@ -40,7 +41,7 @@ public interface MoonLake extends MoonLakeCore, MoonLakeInfo, BukkitInfo {
*
* @return 日志对象
*/
MLogger getMLogger();
Logger getLogger();

/**
* 获取月色之湖插件对象
Expand Down
62 changes: 62 additions & 0 deletions src/com/minecraft/moonlake/api/VectorConvertible.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2017 The MoonLake Authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


package com.minecraft.moonlake.api;

import com.minecraft.moonlake.api.player.depend.WorldEditVector;
import com.minecraft.moonlake.api.region.RegionBlockVector;
import com.minecraft.moonlake.api.region.RegionVector;
import org.bukkit.util.Vector;

/**
* <h1>VectorConvertible</h1>
* 矢量可转换接口(详细doc待补充...)
*
* @version 1.0
* @author Month_Light
*/
public interface VectorConvertible {

/**
* 转换为 Bukkit 的矢量对象
*
* @return Vector
*/
Vector asBukkitVector();

/**
* 转换为 WorldEdit 的矢量对象
*
* @return WorldEditVector
*/
WorldEditVector asWorldEditVector();

/**
* 转换为区域矢量对象
*
* @return RegionVector
*/
RegionVector asRegionVector();

/**
* 转换为区域方块矢量对象
*
* @return RegionBlockVector
*/
RegionBlockVector asRegionBlockVector();
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public class AnvilWindowClickEvent extends AnvilWindowAbstractEvent implements C
*
* @param clicked 点击者玩家
* @param anvilWindow 铁砧窗口对象
* @param clickSolt 点击的槽位
* @param clickSlot 点击的槽位
* @param clickItemStack 点击的物品栈
*/
public AnvilWindowClickEvent(Player clicked, AnvilWindow anvilWindow, AnvilWindowSlot clickSolt, ItemStack clickItemStack) {
public AnvilWindowClickEvent(Player clicked, AnvilWindow anvilWindow, AnvilWindowSlot clickSlot, ItemStack clickItemStack) {

super(clicked, anvilWindow);

this.clickSlot = clickSolt;
this.clickSlot = clickSlot;
this.clickItemStack = clickItemStack;
}

Expand Down
Loading

0 comments on commit 463802a

Please sign in to comment.