Coder Social home page Coder Social logo

canarylib's Introduction

CanaryLib

Last Build Last Successful Build ChangeLog

CanaryMod is a Minecraft Server wrapper and library with built-in data management features as well as player permissions and groups management. CanaryMod provides a stable and feature-rich framework that makes sure that Plugins written today, will still work in months without the need of updating on each Minecraft update. As server owner, this allows you to spend more time on managing your server, making it awesome, instead of waiting for all your plugins to update each time.

As a Plugin Developer, our Mod allows you to concentrate on the things that make your Plugin great and unique - you won’t ever need to bother about implementing data storage or resolving dependencies with other plugins. We do the dirty work for you, you go and make amazing plugins. It’s as easy as that!

This repository contains the library.

Plugin Development

Maven

    <dependency>
        <groupId>net.canarymod</groupId>
        <artifactId>CanaryLib</artifactId>
        <version>[0.9,)</version> <!-- Will always use the latest version found (including snapshots)-->
    </dependency>

Repository:

    <repository>
        <id>vi-repo</id>
        <name>Visual Illusions Repository</name>
        <url>http://repo.visualillusionsent.net</url>
    </repository>

Non-Maven

Add CanaryLib (unshaded or shaded) and VIUtils 1.1.1 (if using unshaded) to the build path of your Plugin project. VIUtils downloads can be found at http://wiki.visualillusionsent.net/VIUtils or http://repo.visualillusionsent.net/net/visualillusionsent/viutils/

Java Docs

Official JavaDocs

http://build.canarymod.net/job/CanaryLib/javadoc/

JavaDoc Alternate Locations http://canary.playblack.net/docs/ http://docs.visualillusionsent.net/CanaryLib/

VIUtils Library Docs http://docs.visualillusionsent.net/VIUtils/

Pull Requests

It helps us when others take the time to submit fixes rather than just pointing out bugs/inconsistencies. However, We have standards for the sources we have. Things like formatting and generally following the Sun/Oracle coding standards

Source Formatting and requirements

  • No tabs; use 4 spaces instead.

  • No trailing whitespaces.

  • No CRLF line endings, LF only.

  • JavaDocs well written (as necessary)

  • Matching how we format statements

      public class MyClass { //note the whitespace
          public void function() {
              if (something) {
                  // do stuff
              }
              else if (somethingElse) {
                  // do other stuff
              }
              else {
                  // do else stuff
              }
          }
      }
    

canarylib's People

Contributors

14mrh4x0r avatar ayyron-dev avatar bluxdragon avatar darkdiplomat avatar greatman avatar gregcarlin avatar hidendra avatar joskuijpers avatar larry1123 avatar shadow386 avatar wwol avatar ylivay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canarylib's Issues

missing methods

im missing
player.getLevel();
player.setXP()
warp.getLocation();
Home.getLocation();
player.setCreatetiveMode(boolean); since we have player.isInCreativeMode();

World.getBlockAt(x, y, z)

Maybe I'm just missing it, but I can't seem to find this method. I think it's pretty crucial though.

new methods

couldnt find some methods

player.getInventory.getItemFromSlot();
and world.Explode(x,y,z,power);
player.isOp();
player.setOp(): ?

also
some replacement for
oworld.a(new OEntityLightningBolt(oworld, player.getX(), player.getY(), player.getZ()));?

Plugin conflicting with itself

When disabling and enabling plugins multiple time I got the message
2012-07-21 21:13:17 [WARNING] Plugin 'CCPlugin' and 'CCPlugin' shouldn't have the same priority. Edit Canary.inf to resolve the conflict.
The plugin seams to conflict with itself.

Thanks,

WWOL

listwarps empty

warps don't get added to /listwarps on load or when using a plugin to create a warp, only temporarily when using /setwarp

onBlockRightClicked issues

RightClickHook.getBlockPlaced() is actually the block you click, and getBlockClicked() is null if your hand is empty but the type is not what you hold, it's always from 1 to 5 depending on what direction you're facing.

Also, the item in your hand is null (or has id 0) the first time you right click, but after that it gets the correct id. Might be only for items you have when you log in.

I think it's only for onBlockRightClicked because onBlockPlace works fine.

Arrows don't shoot

When I fire a bow, I can pull it back fine, but when I release it no arrow comes out. The arrow is removed from my inventory, but an inventory refresh returns the arrow and the restores the damage on the bow.

Implement /reload

The reload command with all its functionality is a critical feature and must be implemented.
It must reload the flatfile database, refresh backbone and configuration caches, and refill variables in the original minecraft code to make the changes take effect.

Default group is not recognized ...

... if it's not the first in line. This should be an issue with the Groups and Users backbone. Might be an easy fix, probably something incredibly stupid. My guess is that it's in the constructor of said backbone where it sorts out the loaded groups.

Animal & Item creation for Dimension

There is already a createMob in Dimension which will return a new Instance of a Mob.
Additionally there needs to be createItem and createAnimal, maybe even createLiving methods so Plugins that only use the Lib can create new stuff like that instead of including CanaryMod.jar.

Create better default settings...

... for Permissions and groups so the server is runnable in a basic form out of the box.
Should include:
Permissions: =true, canary.world.=true, canary.command.=true
Groups: players, mods, admins
rels: * to admins, canary.world to players/mods, canary.command.
to mods

getItemHeld & getSlot

getItemHeld does not recognise the item when you login after a server reboot

and getSlot doesn't return null. It returns a NullPointerException instead =/

System-Default hook priorities fail

System default hook priorities make registering a plugin with them fail.
Pluin.getPriorityNode(name) must get an oveload for default hook priorities and their values,
and return a repsective priority node so registering with default priorities will still be possible!

Factory

Make factory classes to get around the fact the plugin devs can't go new Item() because it is an interface.
Without a factory devs have to add CanaryMod the the build path and use new CanaryBlock().

@damagefilter
@Jarvix
Thoughts?

The way I have it set out at the moment is everything is in the net.canarymod.api.factory package.
For a dev it is simple.
Canary.factory().itemFactory().newItem(int id);
There are lots of overloads for handling enchantments, damage etc.

WWOL

missing rot methods

im missing player.rotX y z etc can these be implemented
(also bump for fixing signchange :))

Warps overriding is glitchy

System does not check if a player is allowed to override a warp (override private with public warp (same name) for example).
That will cause some nasty trouble. Needs some checks if a warp can be changed before it is executed on the database.
Also: Needs to properly override all properties including isHome and "owner"

Permission query priorities

Permission Query is pretty dumb at the moment and needs some more intelligence.
That "explicitly deny a permission" thing doesn't work if there's an asterisk on the path.
That means if the asterisk is true but any subsequent nodes are not, it needs to know that and check
the full path instead of only until it reaches the asterisk.

item methods

im missing an method to get the item name
(item.getType.toString()) in old canary
also for damaged items me and dark wrote a piece for iAuction maby you could use it http://pastebin.com/Fv9BrkQY

item.setSlot(item,slot); doesnt work with parameter slot

also missing something like
player.swichworlds(world); player.swichdimension(dim); ?

Implement a modular command system?

It's possibly preferable to implement a modular command system for both native and plugin commands, where plugins can add commands using this.addCommand(CommandHandler, String command...), where CommandHandler takes a help description much like BaseCommand in CanaryMod.

A couple requested methods

I've been working a lot with the newest creeper (0.3), and I have found a need for a couple of methods:

playerInstance.isBlocking() - Returns whether or not the player is blocking with a sword
playerInstance.hasPotionEffect(PotionEffect e) - Check if player has a give potion effect. I am looking for this one in particular, but I presume that a whole potion effect API needs to be added because I don't seem to see anything like it in the docs.
vehicleInstance.setPassenger(Entity e) - I swear this existed before the update (not sure if it ever worked)

EDIT: Forgot to mention entityInstance.remove(), entityInstance.destroy() or something similar.
EDIT2: Just remembered playerInstance.isInVehicle() for determining whether or not a player is in a boat or minecart

Register commands to Help system

That might be a tricky thing to do as the help system is probably not loaded when the commands enum is processed
and therefore there is no access to the Help system.

onSmelt

I would love to see something similar to onCraft, but for furnaces. I understand that you have more important issues at the moment, like fixing onCraft, but I thought I'd mention this.

Duplicated commands on reload

When reloading a plugin I get a DuplicatedCommandException saying the command already exists.
This breaks plugin reload.

WWOL

Add maven

Add maven to Lib and Recode for easy project building.

onCraft additions

I would really like to see the following things added to the onCraft hook:

  1. Make it a cancelable hook
  2. Retrieve the items in the crafting slots and their locations (probably in a small array)

Command (Small) Refactor

@damagefilter
@darkdiplomat

When adding commands the logic is split into console and player methods. Often for simple commands these are the same. The only thing different is permission checking.
Why can't these be merged into the one method. MessageReciever can check permissions and send messages to the command caller so I see no reason to split it.
That said for the more advanced commands (or where the console can't be used) could still split the logic.

Thanks,

WWOL

calHook in HookExecutor needs refinement

callHook does not consider Plugin priorities yet, however it should. Changes must include:

  • High and Critical priority Plugins must get hooks regardless of their cancel-state
  • (Suggestion) Low priority Plugins could receive cancelled hooks for monitoring stuff.

ConfigurationFile paths

When creating a ConfigurationFile the path must be split by a / for the auto creation to work. This caused a bit of trouble when I was using File.seperator and wondering why it didn't work. I had to look at the source to figure it out. Perhaps it should use lastIndexOf(File.seperator) instead of lastIndexOf("/")? Or just replace all File.seperator with "/"?

Thoughts?

WWOL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.