├── .gitignore ├── README.md ├── pom.xml └── src ├── main ├── java │ └── net │ │ └── canarymod │ │ ├── BlockIterator.java │ │ ├── Canary.java │ │ ├── CanaryClassLoader.java │ │ ├── CanaryClassWatcher.java │ │ ├── CanaryDeserializeException.java │ │ ├── LineTracer.java │ │ ├── MathHelp.java │ │ ├── NativeTranslateBridge.java │ │ ├── ToolBox.java │ │ ├── Translator.java │ │ ├── api │ │ ├── BoundingBox.java │ │ ├── CommandBlockLogic.java │ │ ├── ConfigurationManager.java │ │ ├── DamageSource.java │ │ ├── DamageType.java │ │ ├── DataWatcher.java │ │ ├── DyeColor.java │ │ ├── EntityTracker.java │ │ ├── EntityTrackerEntry.java │ │ ├── GameMode.java │ │ ├── MobSpawnerEntry.java │ │ ├── MobSpawnerLogic.java │ │ ├── NetServerHandler.java │ │ ├── OfflinePlayer.java │ │ ├── PathFinder.java │ │ ├── PlayerListAction.java │ │ ├── PlayerListData.java │ │ ├── PlayerManager.java │ │ ├── PlayerReference.java │ │ ├── Server.java │ │ ├── VillagerTrade.java │ │ ├── ai │ │ │ ├── AIArrowAttack.java │ │ │ ├── AIAttackOnCollide.java │ │ │ ├── AIAvoidEntity.java │ │ │ ├── AIBase.java │ │ │ ├── AIBeg.java │ │ │ ├── AIBreakDoor.java │ │ │ ├── AIControlledByPlayer.java │ │ │ ├── AICreeperSwell.java │ │ │ ├── AIDefendVillage.java │ │ │ ├── AIDoorInteract.java │ │ │ ├── AIEatGrass.java │ │ │ ├── AIFindEntityNearest.java │ │ │ ├── AIFindEntityNearestPlayer.java │ │ │ ├── AIFleeSun.java │ │ │ ├── AIFollowGolem.java │ │ │ ├── AIFollowOwner.java │ │ │ ├── AIFollowParent.java │ │ │ ├── AIHarvestFarmland.java │ │ │ ├── AIHurtByTarget.java │ │ │ ├── AILeapAtTarget.java │ │ │ ├── AILookAtTradePlayer.java │ │ │ ├── AILookAtVillager.java │ │ │ ├── AILookIdle.java │ │ │ ├── AIManager.java │ │ │ ├── AIMate.java │ │ │ ├── AIMoveIndoors.java │ │ │ ├── AIMoveThroughVillage.java │ │ │ ├── AIMoveToBlock.java │ │ │ ├── AIMoveTowardsRestriction.java │ │ │ ├── AIMoveTowardsTarget.java │ │ │ ├── AINearestAttackableTarget.java │ │ │ ├── AIOcelotAttack.java │ │ │ ├── AIOcelotSit.java │ │ │ ├── AIOpenDoor.java │ │ │ ├── AIOwnerHurtByTarget.java │ │ │ ├── AIOwnerHurtTarget.java │ │ │ ├── AIPanic.java │ │ │ ├── AIPlay.java │ │ │ ├── AIRestrictOpenDoor.java │ │ │ ├── AIRestrictSun.java │ │ │ ├── AIRunAroundLikeCrazy.java │ │ │ ├── AISit.java │ │ │ ├── AISwimming.java │ │ │ ├── AITarget.java │ │ │ ├── AITargetNonTamed.java │ │ │ ├── AITempt.java │ │ │ ├── AITradePlayer.java │ │ │ ├── AIVillagerInteract.java │ │ │ ├── AIVillagerMate.java │ │ │ ├── AIWander.java │ │ │ ├── AIWatchClosest.java │ │ │ └── AIWatchClosest2.java │ │ ├── attributes │ │ │ ├── Attribute.java │ │ │ ├── AttributeMap.java │ │ │ ├── AttributeModifier.java │ │ │ ├── GenericAttribute.java │ │ │ ├── HorseAttribute.java │ │ │ ├── ModifiableAttribute.java │ │ │ ├── ModifiedAttribute.java │ │ │ ├── Operations.java │ │ │ ├── RangedAttribute.java │ │ │ └── ZombieAttribute.java │ │ ├── chat │ │ │ ├── ChatComponent.java │ │ │ ├── ChatFormatting.java │ │ │ ├── ChatStyle.java │ │ │ ├── ClickEvent.java │ │ │ ├── ClickEventAction.java │ │ │ ├── HoverEvent.java │ │ │ └── HoverEventAction.java │ │ ├── entity │ │ │ ├── ArmorStand.java │ │ │ ├── Arrow.java │ │ │ ├── EnderCrystal.java │ │ │ ├── EnderEye.java │ │ │ ├── Entity.java │ │ │ ├── EntityItem.java │ │ │ ├── EntityType.java │ │ │ ├── Explosive.java │ │ │ ├── FallingBlock.java │ │ │ ├── Fireball.java │ │ │ ├── FireworkRocket.java │ │ │ ├── FishHook.java │ │ │ ├── LargeFireball.java │ │ │ ├── Projectile.java │ │ │ ├── SmallFireball.java │ │ │ ├── TNTPrimed.java │ │ │ ├── WitherSkull.java │ │ │ ├── XPOrb.java │ │ │ ├── effect │ │ │ │ ├── LightningBolt.java │ │ │ │ └── WeatherEffect.java │ │ │ ├── hanging │ │ │ │ ├── HangingEntity.java │ │ │ │ ├── ItemFrame.java │ │ │ │ ├── LeashKnot.java │ │ │ │ └── Painting.java │ │ │ ├── living │ │ │ │ ├── Ageable.java │ │ │ │ ├── AmbientCreature.java │ │ │ │ ├── EntityLiving.java │ │ │ │ ├── Golem.java │ │ │ │ ├── IronGolem.java │ │ │ │ ├── LivingBase.java │ │ │ │ ├── Snowman.java │ │ │ │ ├── animal │ │ │ │ │ ├── Bat.java │ │ │ │ │ ├── Chicken.java │ │ │ │ │ ├── Cow.java │ │ │ │ │ ├── EntityAnimal.java │ │ │ │ │ ├── Horse.java │ │ │ │ │ ├── Mooshroom.java │ │ │ │ │ ├── Ocelot.java │ │ │ │ │ ├── Pig.java │ │ │ │ │ ├── Rabbit.java │ │ │ │ │ ├── Sheep.java │ │ │ │ │ ├── Squid.java │ │ │ │ │ ├── Tameable.java │ │ │ │ │ └── Wolf.java │ │ │ │ ├── humanoid │ │ │ │ │ ├── Human.java │ │ │ │ │ ├── HumanCapabilities.java │ │ │ │ │ ├── NonPlayableCharacter.java │ │ │ │ │ ├── Player.java │ │ │ │ │ ├── Villager.java │ │ │ │ │ └── npc │ │ │ │ │ │ ├── NPCAIExcutionException.java │ │ │ │ │ │ ├── NPCBehavior.java │ │ │ │ │ │ ├── NPCBehaviorListener.java │ │ │ │ │ │ ├── NPCBehaviorRegisteredListener.java │ │ │ │ │ │ ├── NPCBehaviorRegistry.java │ │ │ │ │ │ ├── NpcAiListenerMethodConsistancyException.java │ │ │ │ │ │ └── ai │ │ │ │ │ │ ├── Attacked.java │ │ │ │ │ │ ├── Clicked.java │ │ │ │ │ │ ├── Destroyed.java │ │ │ │ │ │ ├── NPCAI.java │ │ │ │ │ │ ├── PickupItem.java │ │ │ │ │ │ └── Update.java │ │ │ │ └── monster │ │ │ │ │ ├── Blaze.java │ │ │ │ │ ├── CaveSpider.java │ │ │ │ │ ├── Creeper.java │ │ │ │ │ ├── EnderDragon.java │ │ │ │ │ ├── Enderman.java │ │ │ │ │ ├── Endermite.java │ │ │ │ │ ├── EntityMob.java │ │ │ │ │ ├── Ghast.java │ │ │ │ │ ├── GiantZombie.java │ │ │ │ │ ├── Guardian.java │ │ │ │ │ ├── MagmaCube.java │ │ │ │ │ ├── PigZombie.java │ │ │ │ │ ├── RangedAttackMob.java │ │ │ │ │ ├── Silverfish.java │ │ │ │ │ ├── Skeleton.java │ │ │ │ │ ├── Slime.java │ │ │ │ │ ├── Spider.java │ │ │ │ │ ├── Witch.java │ │ │ │ │ ├── Wither.java │ │ │ │ │ └── Zombie.java │ │ │ ├── throwable │ │ │ │ ├── ChickenEgg.java │ │ │ │ ├── EnderPearl.java │ │ │ │ ├── EntityPotion.java │ │ │ │ ├── EntityThrowable.java │ │ │ │ ├── Snowball.java │ │ │ │ └── XPBottle.java │ │ │ └── vehicle │ │ │ │ ├── AnimalVehicle.java │ │ │ │ ├── Boat.java │ │ │ │ ├── ChestMinecart.java │ │ │ │ ├── CommandBlockMinecart.java │ │ │ │ ├── ContainerMinecart.java │ │ │ │ ├── EmptyMinecart.java │ │ │ │ ├── FurnaceMinecart.java │ │ │ │ ├── HopperMinecart.java │ │ │ │ ├── Minecart.java │ │ │ │ ├── MobSpawnerMinecart.java │ │ │ │ ├── TNTMinecart.java │ │ │ │ └── Vehicle.java │ │ ├── factory │ │ │ ├── AIFactory.java │ │ │ ├── AttributeFactory.java │ │ │ ├── ChatComponentFactory.java │ │ │ ├── EntityFactory.java │ │ │ ├── Factory.java │ │ │ ├── ItemFactory.java │ │ │ ├── NBTFactory.java │ │ │ ├── ObjectFactory.java │ │ │ ├── PacketFactory.java │ │ │ ├── PotionFactory.java │ │ │ └── StatisticsFactory.java │ │ ├── gui │ │ │ └── GUIControl.java │ │ ├── inventory │ │ │ ├── AnimalInventory.java │ │ │ ├── BaseItem.java │ │ │ ├── CraftingMatrix.java │ │ │ ├── CustomStorageInventory.java │ │ │ ├── Enchantment.java │ │ │ ├── EnderChestInventory.java │ │ │ ├── Hopper.java │ │ │ ├── Inventory.java │ │ │ ├── InventoryType.java │ │ │ ├── Item.java │ │ │ ├── ItemType.java │ │ │ ├── ItemTypeException.java │ │ │ ├── MapData.java │ │ │ ├── PlayerCraftingMatrix.java │ │ │ ├── PlayerInventory.java │ │ │ ├── VillagerInventory.java │ │ │ ├── helper │ │ │ │ ├── BannerPattern.java │ │ │ │ ├── BannerPatterns.java │ │ │ │ ├── BookHelper.java │ │ │ │ ├── ColoredItemHelper.java │ │ │ │ ├── FireworkHelper.java │ │ │ │ ├── ItemHelper.java │ │ │ │ ├── LeatherArmorHelper.java │ │ │ │ ├── PotionItemHelper.java │ │ │ │ └── SkullHelper.java │ │ │ ├── recipes │ │ │ │ ├── CraftingRecipe.java │ │ │ │ ├── Recipe.java │ │ │ │ ├── RecipeRow.java │ │ │ │ ├── ShapedRecipe.java │ │ │ │ ├── ShapelessRecipe.java │ │ │ │ └── SmeltRecipe.java │ │ │ └── slot │ │ │ │ ├── ButtonPress.java │ │ │ │ ├── GrabMode.java │ │ │ │ ├── SecondarySlotType.java │ │ │ │ └── SlotType.java │ │ ├── nbt │ │ │ ├── BaseTag.java │ │ │ ├── ByteArrayTag.java │ │ │ ├── ByteTag.java │ │ │ ├── CompoundTag.java │ │ │ ├── DoubleTag.java │ │ │ ├── FloatTag.java │ │ │ ├── IntArrayTag.java │ │ │ ├── IntTag.java │ │ │ ├── ListTag.java │ │ │ ├── LongTag.java │ │ │ ├── NBTTagType.java │ │ │ ├── PrimitiveTag.java │ │ │ ├── ShortTag.java │ │ │ └── StringTag.java │ │ ├── packet │ │ │ ├── BlockChangePacket.java │ │ │ ├── InvalidPacketConstructionException.java │ │ │ └── Packet.java │ │ ├── potion │ │ │ ├── Potion.java │ │ │ ├── PotionEffect.java │ │ │ ├── PotionEffectType.java │ │ │ └── PotionType.java │ │ ├── scoreboard │ │ │ ├── CriteriaType.java │ │ │ ├── Score.java │ │ │ ├── ScoreDummyCriteria.java │ │ │ ├── ScoreHealthCriteria.java │ │ │ ├── ScoreObjective.java │ │ │ ├── ScoreObjectiveCriteria.java │ │ │ ├── ScorePosition.java │ │ │ ├── Scoreboard.java │ │ │ ├── ScoreboardManager.java │ │ │ └── Team.java │ │ ├── statistics │ │ │ ├── Achievement.java │ │ │ ├── Achievements.java │ │ │ ├── Stat.java │ │ │ └── Statistics.java │ │ └── world │ │ │ ├── Biome.java │ │ │ ├── BiomeType.java │ │ │ ├── Chunk.java │ │ │ ├── ChunkProvider.java │ │ │ ├── ChunkProviderCustom.java │ │ │ ├── DimensionType.java │ │ │ ├── TreeType.java │ │ │ ├── UnknownWorldException.java │ │ │ ├── Village.java │ │ │ ├── World.java │ │ │ ├── WorldManager.java │ │ │ ├── WorldType.java │ │ │ ├── blocks │ │ │ ├── Anvil.java │ │ │ ├── Banner.java │ │ │ ├── Beacon.java │ │ │ ├── Block.java │ │ │ ├── BlockBase.java │ │ │ ├── BlockFace.java │ │ │ ├── BlockMaterial.java │ │ │ ├── BlockType.java │ │ │ ├── BrewingStand.java │ │ │ ├── Chest.java │ │ │ ├── CommandBlock.java │ │ │ ├── Comparator.java │ │ │ ├── CustomBlockTypeException.java │ │ │ ├── DaylightDetector.java │ │ │ ├── Dispenser.java │ │ │ ├── DoubleChest.java │ │ │ ├── Dropper.java │ │ │ ├── EnchantmentTable.java │ │ │ ├── EnderChest.java │ │ │ ├── Furnace.java │ │ │ ├── HopperBlock.java │ │ │ ├── Jukebox.java │ │ │ ├── LockableTileEntity.java │ │ │ ├── MapColor.java │ │ │ ├── MapColorList.java │ │ │ ├── MobSpawner.java │ │ │ ├── NoteBlock.java │ │ │ ├── Sign.java │ │ │ ├── Skull.java │ │ │ ├── TileEntity.java │ │ │ ├── VanillaBlock.java │ │ │ ├── Workbench.java │ │ │ └── properties │ │ │ │ ├── BlockBooleanProperty.java │ │ │ │ ├── BlockDirectionProperty.java │ │ │ │ ├── BlockEnumProperty.java │ │ │ │ ├── BlockIntegerProperty.java │ │ │ │ ├── BlockProperty.java │ │ │ │ └── helpers │ │ │ │ ├── AnvilProperties.java │ │ │ │ ├── BannerProperties.java │ │ │ │ ├── BedProperties.java │ │ │ │ ├── BlockProperties.java │ │ │ │ ├── BrewingStandProperties.java │ │ │ │ ├── ButtonProperties.java │ │ │ │ ├── CactusProperties.java │ │ │ │ ├── CakeProperties.java │ │ │ │ ├── CarpetProperties.java │ │ │ │ ├── CauldronProperties.java │ │ │ │ ├── ChestProperties.java │ │ │ │ ├── CocoaPlantProperties.java │ │ │ │ ├── ColoredBlockProperties.java │ │ │ │ ├── CommandBlockProperties.java │ │ │ │ ├── CropsProperties.java │ │ │ │ ├── DaylightDetectorProperties.java │ │ │ │ ├── DirectionalBlockProperties.java │ │ │ │ ├── DirtProperties.java │ │ │ │ ├── DispenserProperties.java │ │ │ │ ├── DoorProperties.java │ │ │ │ ├── DoublePlantProperties.java │ │ │ │ ├── DoubleStoneSlabNewProperties.java │ │ │ │ ├── DoubleStoneSlabProperties.java │ │ │ │ ├── EndPortalFrameProperties.java │ │ │ │ ├── EnderChestProperties.java │ │ │ │ ├── FarmlandProperties.java │ │ │ │ ├── FenceGateProperties.java │ │ │ │ ├── FenceProperties.java │ │ │ │ ├── FireProperties.java │ │ │ │ ├── FlowerPotProperties.java │ │ │ │ ├── FlowerProperties.java │ │ │ │ ├── FurnaceProperties.java │ │ │ │ ├── GrassProperties.java │ │ │ │ ├── HopperProperties.java │ │ │ │ ├── HugeMushroomProperties.java │ │ │ │ ├── JukeboxProperties.java │ │ │ │ ├── LadderProperties.java │ │ │ │ ├── LeavesProperties.java │ │ │ │ ├── LeverProperties.java │ │ │ │ ├── LiquidProperties.java │ │ │ │ ├── LogProperties.java │ │ │ │ ├── MyceliumProperties.java │ │ │ │ ├── NetherWartProperties.java │ │ │ │ ├── PistonHeadProperties.java │ │ │ │ ├── PistonProperties.java │ │ │ │ ├── PlanksProperties.java │ │ │ │ ├── PortalProperties.java │ │ │ │ ├── PressurePlateProperties.java │ │ │ │ ├── PrismarineProperties.java │ │ │ │ ├── QuartzProperties.java │ │ │ │ ├── RailPoweredProperties.java │ │ │ │ ├── RailProperties.java │ │ │ │ ├── RedSandstoneProperties.java │ │ │ │ ├── RedstoneComparatorProperties.java │ │ │ │ ├── RedstoneRepeaterProperties.java │ │ │ │ ├── RedstoneWireProperties.java │ │ │ │ ├── ReedProperties.java │ │ │ │ ├── RotatedPillarProperties.java │ │ │ │ ├── SandProperties.java │ │ │ │ ├── SandstoneProperties.java │ │ │ │ ├── SaplingProperties.java │ │ │ │ ├── SilverfishProperties.java │ │ │ │ ├── SkullProperties.java │ │ │ │ ├── SlabProperties.java │ │ │ │ ├── SnowProperties.java │ │ │ │ ├── SpongeProperties.java │ │ │ │ ├── StainedGlassPaneProperties.java │ │ │ │ ├── StainedGlassProperties.java │ │ │ │ ├── StairsProperties.java │ │ │ │ ├── StandingSignProperties.java │ │ │ │ ├── StemProperties.java │ │ │ │ ├── StoneBrickProperties.java │ │ │ │ ├── StoneProperties.java │ │ │ │ ├── StoneSlabNewProperties.java │ │ │ │ ├── StoneSlabProperties.java │ │ │ │ ├── TNTProperties.java │ │ │ │ ├── TallGrassProperties.java │ │ │ │ ├── TorchProperties.java │ │ │ │ ├── TrapDoorProperties.java │ │ │ │ ├── TripwireHookProperties.java │ │ │ │ ├── TripwireProperties.java │ │ │ │ ├── VineProperties.java │ │ │ │ ├── WallProperties.java │ │ │ │ ├── WallSignProperties.java │ │ │ │ ├── WeightedPressurePlateProperties.java │ │ │ │ ├── WoodProperties.java │ │ │ │ └── WoodSlabProperties.java │ │ │ ├── effects │ │ │ ├── AuxiliarySoundEffect.java │ │ │ ├── Particle.java │ │ │ └── SoundEffect.java │ │ │ └── position │ │ │ ├── Direction.java │ │ │ ├── Location.java │ │ │ ├── Position.java │ │ │ ├── Rotations.java │ │ │ └── Vector3D.java │ │ ├── backbone │ │ ├── Backbone.java │ │ ├── BackboneBans.java │ │ ├── BackboneGroups.java │ │ ├── BackboneKits.java │ │ ├── BackboneOperators.java │ │ ├── BackbonePermissions.java │ │ ├── BackboneReservelist.java │ │ ├── BackboneUsers.java │ │ ├── BackboneWarps.java │ │ ├── BackboneWhitelist.java │ │ ├── BanDataAccess.java │ │ ├── GroupDataAccess.java │ │ ├── KitDataAccess.java │ │ ├── OperatorsDataAccess.java │ │ ├── PermissionDataAccess.java │ │ ├── PlayerDataAccess.java │ │ ├── ReservelistDataAccess.java │ │ ├── WarpDataAccess.java │ │ └── WhitelistDataAccess.java │ │ ├── bansystem │ │ ├── Ban.java │ │ ├── BanManager.java │ │ └── BanType.java │ │ ├── channels │ │ ├── ChannelListener.java │ │ ├── ChannelManager.java │ │ ├── ChannelManagerInterface.java │ │ ├── CustomPayloadChannelException.java │ │ └── RegisteredChannelListener.java │ │ ├── chat │ │ ├── ChatFormat.java │ │ ├── Colors.java │ │ ├── MessageReceiver.java │ │ ├── ReceiverType.java │ │ └── TextFormat.java │ │ ├── commandsys │ │ ├── CanaryCommand.java │ │ ├── CanaryCommandPermissions.java │ │ ├── Command.java │ │ ├── CommandDependencyException.java │ │ ├── CommandException.java │ │ ├── CommandList.java │ │ ├── CommandListener.java │ │ ├── CommandManager.java │ │ ├── CommandOwner.java │ │ ├── DuplicateCommandException.java │ │ ├── DynamicCommandAnnotation.java │ │ ├── DynamicTabCompleteAnnotation.java │ │ ├── NativeCommand.java │ │ ├── PlayerSelector.java │ │ ├── TabComplete.java │ │ ├── TabCompleteDispatch.java │ │ ├── TabCompleteException.java │ │ ├── TabCompleteHelper.java │ │ └── commands │ │ │ ├── groupmod │ │ │ ├── GroupBase.java │ │ │ ├── GroupCheck.java │ │ │ ├── GroupCreate.java │ │ │ ├── GroupList.java │ │ │ ├── GroupParent.java │ │ │ ├── GroupPermissionAdd.java │ │ │ ├── GroupPermissionCheck.java │ │ │ ├── GroupPermissionFlush.java │ │ │ ├── GroupPermissionList.java │ │ │ ├── GroupPermissionRemove.java │ │ │ ├── GroupPrefix.java │ │ │ ├── GroupRemove.java │ │ │ └── GroupRename.java │ │ │ ├── player │ │ │ ├── Compass.java │ │ │ ├── GetPosition.java │ │ │ └── GodCommand.java │ │ │ ├── playermod │ │ │ ├── PlayerCreate.java │ │ │ ├── PlayerGroupAdd.java │ │ │ ├── PlayerGroupCheck.java │ │ │ ├── PlayerGroupList.java │ │ │ ├── PlayerGroupRemove.java │ │ │ ├── PlayerGroupSet.java │ │ │ ├── PlayerPermissionAdd.java │ │ │ ├── PlayerPermissionCheck.java │ │ │ ├── PlayerPermissionList.java │ │ │ ├── PlayerPermissionRemove.java │ │ │ ├── PlayerPrefix.java │ │ │ ├── PlayerRemove.java │ │ │ └── PlayermodBase.java │ │ │ ├── system │ │ │ ├── CreateVanilla.java │ │ │ ├── HelpCommand.java │ │ │ ├── Kick.java │ │ │ ├── ListPlugins.java │ │ │ ├── Motd.java │ │ │ ├── Mute.java │ │ │ ├── PlayerInfoAddition.java │ │ │ ├── PlayerInformation.java │ │ │ ├── PlayerList.java │ │ │ ├── PluginCommand.java │ │ │ ├── ReloadCommand.java │ │ │ ├── RestartServer.java │ │ │ ├── StopServer.java │ │ │ ├── bans │ │ │ │ ├── BanCommand.java │ │ │ │ ├── IpBanCommand.java │ │ │ │ └── UnbanCommand.java │ │ │ ├── informational │ │ │ │ ├── CanaryModCommand.java │ │ │ │ ├── SystemInformation.java │ │ │ │ └── Uptime.java │ │ │ ├── kits │ │ │ │ ├── KitCreate.java │ │ │ │ ├── KitDelete.java │ │ │ │ ├── KitGive.java │ │ │ │ └── KitList.java │ │ │ ├── operator │ │ │ │ ├── DeOp.java │ │ │ │ ├── Op.java │ │ │ │ └── OpList.java │ │ │ ├── reservelist │ │ │ │ ├── ReservelistAdd.java │ │ │ │ ├── ReservelistRemove.java │ │ │ │ └── ReservelistShow.java │ │ │ └── whitelist │ │ │ │ ├── WhitelistAdd.java │ │ │ │ ├── WhitelistDisable.java │ │ │ │ ├── WhitelistEnable.java │ │ │ │ ├── WhitelistReload.java │ │ │ │ ├── WhitelistRemove.java │ │ │ │ └── WhitelistShow.java │ │ │ ├── vanilla │ │ │ ├── Achievement.java │ │ │ ├── BlockData.java │ │ │ ├── Broadcast.java │ │ │ ├── Clear.java │ │ │ ├── Clone.java │ │ │ ├── Debug.java │ │ │ ├── DefaultGameMode.java │ │ │ ├── DefaultSpawnpoint.java │ │ │ ├── Difficulty.java │ │ │ ├── Effect.java │ │ │ ├── Emote.java │ │ │ ├── Enchant.java │ │ │ ├── EntityData.java │ │ │ ├── Execute.java │ │ │ ├── Fill.java │ │ │ ├── GameMode.java │ │ │ ├── GameRule.java │ │ │ ├── Give.java │ │ │ ├── Kill.java │ │ │ ├── Message.java │ │ │ ├── MessageRaw.java │ │ │ ├── Particle.java │ │ │ ├── PlaySound.java │ │ │ ├── ReplaceItem.java │ │ │ ├── SaveAll.java │ │ │ ├── SaveOff.java │ │ │ ├── SaveOn.java │ │ │ ├── Scoreboard.java │ │ │ ├── SetBlock.java │ │ │ ├── SpawnPoint.java │ │ │ ├── SpreadPlayers.java │ │ │ ├── Stats.java │ │ │ ├── Summon.java │ │ │ ├── Teleport.java │ │ │ ├── TestFor.java │ │ │ ├── TestForBlock.java │ │ │ ├── TestForBlocks.java │ │ │ ├── Time.java │ │ │ ├── Title.java │ │ │ ├── ToggleDownfall.java │ │ │ ├── Trigger.java │ │ │ ├── VanillaCommandWrapper.java │ │ │ ├── Weather.java │ │ │ ├── WorldBorder.java │ │ │ └── XP.java │ │ │ ├── warp │ │ │ ├── Home.java │ │ │ ├── SetHome.java │ │ │ ├── SpawnCommand.java │ │ │ ├── WarpList.java │ │ │ ├── WarpRemove.java │ │ │ ├── WarpSet.java │ │ │ └── WarpUse.java │ │ │ └── world │ │ │ ├── CreateWorldCommand.java │ │ │ ├── DeleteWorldCommand.java │ │ │ ├── ListWorldsCommand.java │ │ │ ├── LoadWorldCommand.java │ │ │ ├── MobClear.java │ │ │ ├── MobCommand.java │ │ │ ├── MobCount.java │ │ │ ├── MobSpawnerCheck.java │ │ │ ├── MobSpawnerCommand.java │ │ │ ├── MobSpawnerSet.java │ │ │ ├── UnloadWorldCommand.java │ │ │ └── WorldInfoCommand.java │ │ ├── config │ │ ├── Configuration.java │ │ ├── ConfigurationContainer.java │ │ ├── DatabaseConfiguration.java │ │ ├── ServerConfiguration.java │ │ └── WorldConfiguration.java │ │ ├── converter │ │ └── CanaryToVanilla.java │ │ ├── database │ │ ├── Column.java │ │ ├── DataAccess.java │ │ ├── Database.java │ │ ├── DatabaseLoader.java │ │ ├── JdbcConnectionManager.java │ │ ├── LocationDataAccess.java │ │ ├── PositionDataAccess.java │ │ ├── SQLType.java │ │ ├── exceptions │ │ │ ├── DatabaseAccessException.java │ │ │ ├── DatabaseException.java │ │ │ ├── DatabaseReadException.java │ │ │ ├── DatabaseTableInconsistencyException.java │ │ │ └── DatabaseWriteException.java │ │ ├── mysql │ │ │ └── MySQLDatabase.java │ │ ├── sqlite │ │ │ └── SQLiteDatabase.java │ │ └── xml │ │ │ └── XmlDatabase.java │ │ ├── exceptions │ │ ├── InvalidInstanceException.java │ │ ├── InvalidPluginException.java │ │ ├── PluginDependencyException.java │ │ └── PluginLoadFailedException.java │ │ ├── help │ │ ├── HelpManager.java │ │ └── HelpNode.java │ │ ├── hook │ │ ├── CancelableHook.java │ │ ├── Dispatcher.java │ │ ├── Hook.java │ │ ├── HookConsistencyException.java │ │ ├── HookExecutionException.java │ │ ├── HookExecutor.java │ │ ├── HookExecutorInterface.java │ │ ├── HookHandler.java │ │ ├── command │ │ │ ├── CommandBlockCommandHook.java │ │ │ ├── ConsoleCommandHook.java │ │ │ └── PlayerCommandHook.java │ │ ├── entity │ │ │ ├── ChickenLayEggHook.java │ │ │ ├── DamageHook.java │ │ │ ├── DimensionSwitchHook.java │ │ │ ├── EndermanDropBlockHook.java │ │ │ ├── EndermanPickupBlockHook.java │ │ │ ├── EntityDeathHook.java │ │ │ ├── EntityDespawnHook.java │ │ │ ├── EntityLightningStruckHook.java │ │ │ ├── EntityMountHook.java │ │ │ ├── EntityMoveHook.java │ │ │ ├── EntitySpawnHook.java │ │ │ ├── EntityTameHook.java │ │ │ ├── HangingEntityDestroyHook.java │ │ │ ├── ItemTouchGroundHook.java │ │ │ ├── MinecartActivateHook.java │ │ │ ├── MobTargetHook.java │ │ │ ├── PotionEffectAppliedHook.java │ │ │ ├── PotionEffectFinishHook.java │ │ │ ├── ProjectileHitHook.java │ │ │ ├── SlimeSplitHook.java │ │ │ ├── VehicleCollisionHook.java │ │ │ ├── VehicleDamageHook.java │ │ │ ├── VehicleDestroyHook.java │ │ │ ├── VehicleEnterHook.java │ │ │ ├── VehicleExitHook.java │ │ │ ├── VehicleMoveHook.java │ │ │ └── VillagerTradeUnlockHook.java │ │ ├── player │ │ │ ├── AnvilUseHook.java │ │ │ ├── ArmorBrokenHook.java │ │ │ ├── ArmorStandModifyHook.java │ │ │ ├── BanHook.java │ │ │ ├── BedEnterHook.java │ │ │ ├── BedExitHook.java │ │ │ ├── BlockDestroyHook.java │ │ │ ├── BlockLeftClickHook.java │ │ │ ├── BlockPlaceHook.java │ │ │ ├── BlockRightClickHook.java │ │ │ ├── BookEditHook.java │ │ │ ├── ChatHook.java │ │ │ ├── ConnectionHook.java │ │ │ ├── CraftHook.java │ │ │ ├── DisconnectionHook.java │ │ │ ├── EatHook.java │ │ │ ├── EnchantHook.java │ │ │ ├── EntityRightClickHook.java │ │ │ ├── ExperienceHook.java │ │ │ ├── FoodExhaustionHook.java │ │ │ ├── FoodLevelHook.java │ │ │ ├── FoodSaturationHook.java │ │ │ ├── GameModeChangeHook.java │ │ │ ├── HealthChangeHook.java │ │ │ ├── HeldItemChangeHook.java │ │ │ ├── InventoryHook.java │ │ │ ├── ItemDropHook.java │ │ │ ├── ItemFrameRotateHook.java │ │ │ ├── ItemFrameSetItemHook.java │ │ │ ├── ItemPickupHook.java │ │ │ ├── ItemUseHook.java │ │ │ ├── KickHook.java │ │ │ ├── LevelUpHook.java │ │ │ ├── PlayerArmSwingHook.java │ │ │ ├── PlayerDeathHook.java │ │ │ ├── PlayerIdleHook.java │ │ │ ├── PlayerListHook.java │ │ │ ├── PlayerMoveHook.java │ │ │ ├── PlayerRespawnedHook.java │ │ │ ├── PlayerRespawningHook.java │ │ │ ├── PortalUseHook.java │ │ │ ├── PreConnectionHook.java │ │ │ ├── ReturnFromIdleHook.java │ │ │ ├── SignChangeHook.java │ │ │ ├── SignShowHook.java │ │ │ ├── SlotClickHook.java │ │ │ ├── StatGainedHook.java │ │ │ ├── TeleportHook.java │ │ │ ├── ToolBrokenHook.java │ │ │ └── VillagerTradeHook.java │ │ ├── system │ │ │ ├── LoadWorldHook.java │ │ │ ├── PermissionCheckHook.java │ │ │ ├── PluginDisableHook.java │ │ │ ├── PluginEnableHook.java │ │ │ ├── ServerGuiStartHook.java │ │ │ ├── ServerListPingHook.java │ │ │ ├── ServerShutdownHook.java │ │ │ ├── ServerTickHook.java │ │ │ └── UnloadWorldHook.java │ │ └── world │ │ │ ├── BlockDropXpHook.java │ │ │ ├── BlockGrowHook.java │ │ │ ├── BlockPhysicsHook.java │ │ │ ├── BlockUpdateHook.java │ │ │ ├── ChunkCreatedHook.java │ │ │ ├── ChunkCreationHook.java │ │ │ ├── ChunkLoadedHook.java │ │ │ ├── ChunkUnloadHook.java │ │ │ ├── DecorateHook.java │ │ │ ├── DispenseHook.java │ │ │ ├── ExplosionHook.java │ │ │ ├── FireworkExplodeHook.java │ │ │ ├── FlowHook.java │ │ │ ├── HopperTransferHook.java │ │ │ ├── IgnitionHook.java │ │ │ ├── LeafDecayHook.java │ │ │ ├── LightningStrikeHook.java │ │ │ ├── LiquidDestroyHook.java │ │ │ ├── NoteBlockPlayHook.java │ │ │ ├── PistonExtendHook.java │ │ │ ├── PistonRetractHook.java │ │ │ ├── PortalCreateHook.java │ │ │ ├── PortalDestroyHook.java │ │ │ ├── RedstoneChangeHook.java │ │ │ ├── SmeltBeginHook.java │ │ │ ├── SmeltHook.java │ │ │ ├── TNTActivateHook.java │ │ │ ├── TimeChangeHook.java │ │ │ ├── TreeGrowHook.java │ │ │ └── WeatherChangeHook.java │ │ ├── kit │ │ ├── Kit.java │ │ └── KitProvider.java │ │ ├── logger │ │ └── Logman.java │ │ ├── metrics │ │ └── CanaryMetrics.java │ │ ├── motd │ │ ├── CanaryMessageOfTheDayListener.java │ │ ├── MOTDKey.java │ │ ├── MOTDOwner.java │ │ ├── MOTDParser.java │ │ ├── MessageOfTheDay.java │ │ └── MessageOfTheDayListener.java │ │ ├── permissionsystem │ │ ├── MultiworldPermissionProvider.java │ │ ├── PermissionManager.java │ │ ├── PermissionNode.java │ │ └── PermissionProvider.java │ │ ├── plugin │ │ ├── DefaultPluginManager.java │ │ ├── Plugin.java │ │ ├── PluginDescriptor.java │ │ ├── PluginException.java │ │ ├── PluginLangLoader.java │ │ ├── PluginLifecycle.java │ │ ├── PluginListener.java │ │ ├── PluginManager.java │ │ ├── PluginState.java │ │ ├── Priority.java │ │ ├── RegisteredPluginListener.java │ │ ├── dependencies │ │ │ └── DependencyGraph.java │ │ └── lifecycle │ │ │ ├── InvalidPluginLifecycleException.java │ │ │ ├── JavaPluginLifecycle.java │ │ │ ├── PluginLifecycleBase.java │ │ │ └── PluginLifecycleFactory.java │ │ ├── serialize │ │ └── Serializer.java │ │ ├── tasks │ │ ├── ServerTask.java │ │ ├── ServerTaskManager.java │ │ └── TaskOwner.java │ │ ├── user │ │ ├── Group.java │ │ ├── OperatorsProvider.java │ │ ├── ReservelistProvider.java │ │ ├── UserAndGroupsProvider.java │ │ └── WhitelistProvider.java │ │ ├── util │ │ ├── JsonNBTUtility.java │ │ ├── NullPlayer.java │ │ └── NullPlayerInventory.java │ │ └── warp │ │ ├── Warp.java │ │ └── WarpProvider.java └── resources │ ├── LICENSE │ └── resources │ └── lang │ ├── cs_CZ.lang │ ├── da_DK.lang │ ├── de_DE.lang │ ├── el_GR.lang │ ├── en_GB.lang │ ├── en_PT.lang │ ├── en_US.lang │ ├── es_ES.lang │ ├── fi_FI.lang │ ├── fr_FR.lang │ ├── hu_HU.lang │ ├── it_IT.lang │ ├── ja_JP.lang │ ├── ko_KR.lang │ ├── languages.txt │ ├── nl_NL.lang │ ├── no_NO.lang │ ├── pl_PL.lang │ ├── pt_PT.lang │ ├── ro_RO.lang │ ├── ru_RU.lang │ ├── sv_SE.lang │ ├── tr_TR.lang │ └── uk_UA.lang └── test └── java └── net └── canarymod ├── api └── world │ └── blocks │ ├── BlockTypeTest.java │ └── VanillaBlockTest.java └── permissionsystem └── MultiworldPermissionProviderTest.java /src/main/java/net/canarymod/CanaryDeserializeException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod; 2 | 3 | /** 4 | * Exception that will be thrown if the serialized String 5 | * of a CanarySerializable object does not have the expected length 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class CanaryDeserializeException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 4068917113777742144L; 12 | String vendor; 13 | 14 | /** 15 | * Constructs a new {@code CanaryDeserializeException} 16 | * 17 | * @param message 18 | * the message of the exception that occurred 19 | * @param vendor 20 | * the vendor 21 | */ 22 | public CanaryDeserializeException(String message, String vendor) { 23 | super(message); 24 | this.vendor = vendor; 25 | } 26 | 27 | /** 28 | * Return the vendor of the serializer that threw this exception. 29 | * 30 | * @return the vendor 31 | */ 32 | public String getVendor() { 33 | return vendor; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/EntityTrackerEntry.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | 5 | /** 6 | * EntityTrackerEntry to handle entries in entity trackers 7 | * Perhaps we need some more at some point, then we can have it here 8 | * 9 | * @author Chris (damagefilter) 10 | */ 11 | public interface EntityTrackerEntry { 12 | 13 | /** 14 | * Gets the {@link Entity} 15 | * 16 | * @return the {@link Entity} 17 | */ 18 | Entity getEntity(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/GameMode.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api; 2 | 3 | /** 4 | * An enum of player game modes 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public enum GameMode { 9 | /* DO NOT REORDER */ 10 | SURVIVAL, 11 | // 12 | CREATIVE, 13 | // 14 | ADVENTURE, 15 | // 16 | SPECTATOR, 17 | // 18 | ; 19 | 20 | public final int getId() { 21 | return this.ordinal(); 22 | } 23 | 24 | public final static GameMode fromId(int id) { 25 | switch (id) { 26 | case 1: 27 | return CREATIVE; 28 | case 2: 29 | return ADVENTURE; 30 | case 3: 31 | return SPECTATOR; 32 | default: 33 | return SURVIVAL; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/OfflinePlayer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api; 2 | 3 | import net.canarymod.api.nbt.CompoundTag; 4 | 5 | /** 6 | * An offline player. This is an offline version of a registered player. 7 | * OfflinePlayer contains information about groups, permissions, world and 8 | * location where the player has logged out, according to data on disk. 9 | * 10 | * @author Chris (damagefilter) 11 | * @author Jason (darkdiplomat) 12 | */ 13 | public interface OfflinePlayer extends PlayerReference { 14 | 15 | /** 16 | * Get the NBT tag for this offline player 17 | * 18 | * @return {@link CompoundTag} 19 | */ 20 | CompoundTag getNBT(); 21 | 22 | /** 23 | * Save changes made to this offline player. 24 | * Important: This will only apply if the player is not online! 25 | */ 26 | void save(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/PlayerListAction.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api; 2 | 3 | /** 4 | * PlayerList action enum 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public enum PlayerListAction { 9 | 10 | ADD_PLAYER, 11 | UPDATE_GAME_MODE, 12 | UPDATE_LATENCY, 13 | UPDATE_DISPLAY_NAME, 14 | REMOVE_PLAYER; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIArrowAttack.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIArrowAttack extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIAttackOnCollide.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIAttackOnCollide extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIAvoidEntity.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIAvoidEntity extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIBeg.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIBeg extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIBreakDoor.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIBreakDoor extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIControlledByPlayer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIControlledByPlayer extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AICreeperSwell.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AICreeperSwell extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIDefendVillage.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIDefendVillage extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIDoorInteract.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIDoorInteract extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIEatGrass.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIEatGrass extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFindEntityNearest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFindEntityNearest extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFindEntityNearestPlayer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFindEntityNearestPlayer extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFleeSun.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFleeSun extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFollowGolem.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFollowGolem extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFollowOwner.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFollowOwner extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIFollowParent.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIFollowParent extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIHarvestFarmland.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIHarvestFarmland extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIHurtByTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIHurtByTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AILeapAtTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AILeapAtTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AILookAtTradePlayer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AILookAtTradePlayer extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AILookAtVillager.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AILookAtVillager extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AILookIdle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AILookIdle extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMate.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMate extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMoveIndoors.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMoveIndoors extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMoveThroughVillage.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMoveThroughVillage extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMoveToBlock.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMoveToBlock extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMoveTowardsRestriction.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMoveTowardsRestriction extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIMoveTowardsTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIMoveTowardsTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AINearestAttackableTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AINearestAttackableTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIOcelotAttack.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIOcelotAttack extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIOcelotSit.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIOcelotSit extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIOpenDoor.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIOpenDoor extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIOwnerHurtByTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIOwnerHurtByTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIOwnerHurtTarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIOwnerHurtTarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIPanic.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIPanic extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIPlay.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIPlay extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIRestrictOpenDoor.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIRestrictOpenDoor extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIRestrictSun.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIRestrictSun extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIRunAroundLikeCrazy.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIRunAroundLikeCrazy extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AISit.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AISit extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AISwimming.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AISwimming extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AITarget.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AITarget extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AITargetNonTamed.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AITargetNonTamed extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AITempt.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AITempt extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AITradePlayer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AITradePlayer extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIVillagerInteract.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIVillagerInteract extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIVillagerMate.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIVillagerMate extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIWander.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIWander extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIWatchClosest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIWatchClosest extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/ai/AIWatchClosest2.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.ai; 2 | 3 | /** 4 | * @author Aaron 5 | */ 6 | public interface AIWatchClosest2 extends AIBase { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/Attribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | /** 4 | * @author Jason (darkdiplomat) 5 | */ 6 | public interface Attribute { 7 | 8 | /** 9 | * Gets the unlocalized internal name 10 | * 11 | * @return internal name 12 | */ 13 | String getInternalName(); 14 | 15 | /** 16 | * Gets the default value of the Attribute 17 | * 18 | * @return default value 19 | */ 20 | double getDefaultValue(); 21 | 22 | /** 23 | * Gets whether this Attribute should be watched 24 | * 25 | * @return {@code true} if watched 26 | */ 27 | boolean shouldWatch(); 28 | 29 | /** 30 | * Sets whether this attribute should be watched 31 | * 32 | * @param watch 33 | * {@code true} for watched 34 | * 35 | * @return {@code this} instance 36 | */ 37 | Attribute setShouldWatch(boolean watch); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/GenericAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | import com.google.common.annotations.Beta; 4 | import net.canarymod.Canary; 5 | 6 | /** 7 | * @author Jason (darkdiplomat) 8 | */ 9 | @Beta 10 | public enum GenericAttribute { 11 | 12 | MAXHEALTH("generic.maxHealth"), 13 | FOLLOWRANGE("generic.followRange"), 14 | MOVEMENTSPEED("generic.movementSpeed"), 15 | ATTACKDAMAGE("generic.attackDamage"), 16 | KNOCKBACKRESIST("generic.knockbackResistance"), 17 | ; 18 | 19 | private final String nmsName; 20 | 21 | GenericAttribute(String nmsName) { 22 | this.nmsName = nmsName; 23 | } 24 | 25 | public Attribute getAttribute() { 26 | return Canary.factory().getAttributeFactory().getGenericAttribute(this.nmsName); 27 | } 28 | 29 | public String getNativeName() { 30 | return this.nmsName; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/HorseAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | import com.google.common.annotations.Beta; 4 | import net.canarymod.Canary; 5 | 6 | /** 7 | * @author Jamie Mansfield (jamierocks) 8 | */ 9 | @Beta 10 | public enum HorseAttribute { 11 | 12 | JUMPSTRENGTH("horse.jumpStrength"), 13 | ; 14 | 15 | private final String nmsName; 16 | 17 | HorseAttribute(String nmsName) { 18 | this.nmsName = nmsName; 19 | } 20 | 21 | public Attribute getAttribute() { 22 | return Canary.factory().getAttributeFactory().getGenericAttribute(this.nmsName); 23 | } 24 | 25 | public String getNativeName() { 26 | return this.nmsName; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/ModifiableAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | import com.google.common.annotations.Beta; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * An instance of an {@link Attribute} that can be modified. 9 | * 10 | * @author Jason (darkdiplomat) 11 | * @author Jamie Mansfield (jamierocks) 12 | */ 13 | @Beta 14 | public interface ModifiableAttribute { 15 | 16 | Attribute getAttribute(); 17 | 18 | double getBaseValue(); 19 | 20 | void setBaseValue(double value); 21 | 22 | AttributeModifier getModifier(UUID uuid); 23 | 24 | void apply(AttributeModifier attributeModifier); 25 | 26 | void remove(AttributeModifier attributeModifier); 27 | 28 | double getValue(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/ModifiedAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | /** 4 | * An instance of an {@link Attribute} that can be modified. 5 | * 6 | * @author Jason (darkdiplomat) 7 | * @author Jamie Mansfield (jamierocks) 8 | * @deprecated Replaced by {@link ModifiableAttribute} 9 | */ 10 | @Deprecated 11 | public interface ModifiedAttribute extends ModifiableAttribute { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/Operations.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | /** 4 | * A psuedo-enum of operations within Minecraft. 5 | * 6 | * @author Jamie Mansfield (jamierocks) 7 | */ 8 | public final class Operations { 9 | 10 | public static final int ADD_AMOUNT = 0; 11 | public static final int MULTIPLY_BASE = 1; 12 | public static final int MULTIPLY = 2; 13 | 14 | private Operations() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/RangedAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | import com.google.common.annotations.Beta; 4 | 5 | /** 6 | * @author Jason (darkdiplomat) 7 | */ 8 | @Beta 9 | public interface RangedAttribute extends Attribute { 10 | 11 | RangedAttribute setDescription(String description); 12 | 13 | String getDescription(); 14 | 15 | double setValue(double value); 16 | 17 | double getMaxValue(); 18 | 19 | double getMinValue(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/attributes/ZombieAttribute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.attributes; 2 | 3 | import com.google.common.annotations.Beta; 4 | import net.canarymod.Canary; 5 | 6 | /** 7 | * @author Jamie Mansfield (jamierocks) 8 | */ 9 | @Beta 10 | public enum ZombieAttribute { 11 | 12 | SPAWNREINFORCEMENTS("zombie.spawnReinforcements"), 13 | ; 14 | 15 | private final String nmsName; 16 | 17 | ZombieAttribute(String nmsName) { 18 | this.nmsName = nmsName; 19 | } 20 | 21 | public Attribute getAttribute() { 22 | return Canary.factory().getAttributeFactory().getGenericAttribute(this.nmsName); 23 | } 24 | 25 | public String getNativeName() { 26 | return this.nmsName; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/chat/ChatFormatting.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.chat; 2 | 3 | /** 4 | * Wrapper interface for EnumChatFormatting 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface ChatFormatting { 9 | 10 | /** 11 | * Gets the {@code character} code 12 | * 13 | * @return {@code character} 14 | */ 15 | char getFormattingCode(); 16 | 17 | /** 18 | * Checks if this is a formatting code (ie: Bold, Italic, Strikethrough, Obfuscated, Underline) 19 | * 20 | * @return {@code true} if formatting code; {@code false} if not 21 | */ 22 | boolean isFormat(); 23 | 24 | /** 25 | * Checks if this is a color code (ie: DARK_GREEN) 26 | * 27 | * @return {@code true} if color code; {@code false} if not 28 | */ 29 | boolean isColor(); 30 | 31 | /** 32 | * Gets the name of this {@code ChatFormatting} (ie: DARK_GREEN) 33 | * 34 | * @return name 35 | */ 36 | String getName(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/chat/ClickEvent.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.chat; 2 | 3 | /** 4 | * Wrapper interface for Minecraft's native ClickEvent 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface ClickEvent { 9 | 10 | /** 11 | * Gets the {@link ClickEventAction} of this {@link ClickEvent} 12 | * 13 | * @return {@link ClickEventAction} 14 | */ 15 | ClickEventAction getAction(); 16 | 17 | /** 18 | * Gets the value of this {@code ClickEvent} 19 | * 20 | * @return the value 21 | */ 22 | String getValue(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/chat/ClickEventAction.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.chat; 2 | 3 | /** 4 | * Wrapper interface for Minecraft's native ClickEvent.Action 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface ClickEventAction { 9 | 10 | /** 11 | * Checks if the action is allowed in chat 12 | * 13 | * @return {@code true} if allowed; {@code false} if not 14 | */ 15 | boolean allowedInChat(); 16 | 17 | /** 18 | * Gets the name of the action 19 | * 20 | * @return the name 21 | */ 22 | String getName(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/chat/HoverEvent.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.chat; 2 | 3 | /** 4 | * Wrapper interface for Minecraft's native HoverEvent 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface HoverEvent { 9 | 10 | /** 11 | * Gets the {@link HoverEventAction} of this {@code HoverEvent} 12 | * 13 | * @return the {@link HoverEventAction} 14 | */ 15 | HoverEventAction getAction(); 16 | 17 | /** 18 | * Gets the {@link ChatComponent} value 19 | * 20 | * @return {@link ChatComponent} 21 | */ 22 | ChatComponent getValue(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/chat/HoverEventAction.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.chat; 2 | 3 | /** 4 | * Wrapper interface for Minecraft's native HoverEvent.Action 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface HoverEventAction { 9 | 10 | /** 11 | * Checks if the action is allowed in chat 12 | * 13 | * @return {@code true} if allowed; {@code false} if not 14 | */ 15 | boolean allowedInChat(); 16 | 17 | /** 18 | * Gets the name of this action 19 | * 20 | * @return the name 21 | */ 22 | String getName(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/FishHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | /** 4 | * Fish Hook wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface FishHook extends Entity { 9 | // I got nothing for this right now 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/LargeFireball.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | /** 4 | * Large Fireball Wrapper (Ghast Fireball) 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface LargeFireball extends Fireball, Explosive { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/Projectile.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | /** 4 | * Projectile wrapper 5 | * 6 | * @author Larry (Larry1123) 7 | */ 8 | public interface Projectile extends Entity { 9 | 10 | /** 11 | * Sets the Motion of a Projectile and Rotation 12 | * 13 | * @param motionX 14 | * the X-wise motion 15 | * @param motionY 16 | * the Y-wise motion 17 | * @param motionZ 18 | * the Z-wise motion 19 | * @param rotationYaw 20 | * the Y-rotation 21 | * @param rotationPitch 22 | * the X-rotation 23 | */ 24 | void setProjectileHeading(double motionX, double motionY, double motionZ, float rotationYaw, float rotationPitch); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/SmallFireball.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | /** 4 | * Small Fireball Wrapper (FireCharge) 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface SmallFireball extends Fireball { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/TNTPrimed.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | import net.canarymod.api.entity.living.LivingBase; 4 | 5 | /** 6 | * TNTPrimed wrapper interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface TNTPrimed extends Entity, Explosive { 11 | 12 | /** 13 | * Gets the {@link LivingBase} that activated the TNT 14 | * 15 | * @return {@link LivingBase} if activated by an entity; {@code null} if not activated by an entity 16 | */ 17 | LivingBase getActivatedBy(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/WitherSkull.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity; 2 | 3 | /** 4 | * WitherSkull wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface WitherSkull extends Fireball, Explosive { 9 | 10 | /** 11 | * Gets if the WitherSkull comes from an invulnerable WitherBoss 12 | * 13 | * @return {@code true} if invulnerable; {@code false} if not 14 | */ 15 | boolean isInvulnerable(); 16 | 17 | /** 18 | * Sets if the WitherSkull comes from an invulnerable WitherBoss 19 | * 20 | * @param invulenerable 21 | * {@code true} for invulnerable; {@code false} if not 22 | */ 23 | void setInvulnerable(boolean invulenerable); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/effect/WeatherEffect.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.effect; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | 5 | /** 6 | * Weather Effect Wrapper Interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface WeatherEffect extends Entity { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/hanging/LeashKnot.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.hanging; 2 | 3 | /** 4 | * LeashKnot wrapper interface 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface LeashKnot extends HangingEntity { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/Ageable.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living; 2 | 3 | /** 4 | * Ageable wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Ageable { 9 | 10 | /** 11 | * Set this animals age. 12 | * Set negative to turn it into a baby animal. 13 | * (Breeding related) 14 | * 15 | * @param age 16 | * Age to set. Negative values are child ages. 17 | */ 18 | void setGrowingAge(int age); 19 | 20 | /** 21 | * Get the growing age for this entity. 22 | * (Breeding related) 23 | * 24 | * @return The integer age of the Entity. Negative values are child ages. 25 | */ 26 | int getGrowingAge(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/AmbientCreature.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living; 2 | 3 | /** 4 | * Interface for ambient creatures. 5 | * 6 | * @author Larry1123 7 | */ 8 | public interface AmbientCreature { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/Golem.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living; 2 | 3 | /** 4 | * Golem wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Golem extends EntityLiving { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/Snowman.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living; 2 | 3 | import net.canarymod.api.entity.living.monster.RangedAttackMob; 4 | 5 | /** 6 | * Snowman wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Snowman extends Golem, RangedAttackMob { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Bat.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | /** 4 | * Bat wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Bat extends EntityAnimal { 9 | 10 | /** 11 | * Tells if this Bat is hanging or not 12 | * 13 | * @return {@code true} if hanging; {@code false} if not 14 | */ 15 | boolean isHanging(); 16 | 17 | /** 18 | * Sets wheter or not this Bat is hanging 19 | * 20 | * @param hanging 21 | * {@code true} for hanging; {@code false} for not 22 | */ 23 | void setHanging(boolean hanging); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Chicken.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.entity.living.Ageable; 4 | 5 | /** 6 | * Chicken Wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Chicken extends EntityAnimal, Ageable { 11 | 12 | /** 13 | * Gets the ticks until laying the next Egg 14 | * 15 | * @return tick until next egg 16 | */ 17 | int getTimeUntilNextEgg(); 18 | 19 | /** 20 | * Time in ticks (~20/Second) until the chicken lays the next egg. 21 | * Set 0 to make it lay an egg more or less instantly 22 | * 23 | * @param timeTicks 24 | * the ticks until the next egg 25 | */ 26 | void setTimeUntilNextEgg(int timeTicks); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Cow.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.entity.living.Ageable; 4 | 5 | /** 6 | * Cow Wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Cow extends EntityAnimal, Ageable { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/EntityAnimal.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.entity.living.EntityLiving; 4 | import net.canarymod.api.inventory.Item; 5 | 6 | /** 7 | * EntityAnimal wrapper 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface EntityAnimal extends EntityLiving { 12 | 13 | /** 14 | * Checks if the {@link Item} is the item the initiates breeding 15 | * 16 | * @param item 17 | * the {@link Item} to check 18 | * 19 | * @return {@code true} if breeding item; {@code false} if not 20 | */ 21 | public boolean isBreedingItem(Item item); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Mooshroom.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | /** 4 | * Mooshroom wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Mooshroom extends Cow { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Ocelot.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.entity.living.Ageable; 4 | 5 | /** 6 | * Ocelot wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Ocelot extends EntityAnimal, Tameable, Ageable { 11 | 12 | /** 13 | * SkinType enum 14 | * 15 | * @author Jason (darkdiplomat) 16 | */ 17 | enum SkinType { 18 | UNTAME, 19 | // 20 | TUXEDO, 21 | // 22 | GINGER, 23 | // 24 | SIAMESE; // 25 | } 26 | 27 | /** 28 | * Gets the SkinType of the Ocelot 29 | * 30 | * @return skintype 31 | */ 32 | SkinType getSkinType(); 33 | 34 | /** 35 | * Sets the SkinType of the Ocelot 36 | * 37 | * @param type 38 | * the SkinType to set 39 | */ 40 | void setSkinType(SkinType type); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Pig.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.entity.living.Ageable; 4 | import net.canarymod.api.entity.vehicle.AnimalVehicle; 5 | 6 | /** 7 | * Pig wrapper 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface Pig extends AnimalVehicle, Ageable { 12 | 13 | /** 14 | * Gets whether the Pig has a saddle or not 15 | * 16 | * @return {@code true} if saddled; {@code false} if not 17 | */ 18 | boolean isSaddled(); 19 | 20 | /** 21 | * Sets whether the Pig has a saddle or not 22 | * 23 | * @param saddle 24 | * {@code true} for saddled; {@code false} for not saddled 25 | */ 26 | void setSaddled(boolean saddle); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Rabbit.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | /** 4 | * Rabbit wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface Rabbit extends EntityAnimal { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Squid.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | /** 4 | * Squid wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Squid extends EntityAnimal { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/animal/Wolf.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.animal; 2 | 3 | import net.canarymod.api.DyeColor; 4 | import net.canarymod.api.entity.living.Ageable; 5 | 6 | /** 7 | * Wolf wrapper 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface Wolf extends Tameable, Ageable { 12 | 13 | /** 14 | * Sets the Collar color 15 | * 16 | * @param color 17 | * the {@link DyeColor} to make the colar 18 | */ 19 | void setCollarColor(DyeColor color); 20 | 21 | /** 22 | * Gets the Collar color 23 | * 24 | * @return collar color 25 | */ 26 | DyeColor getCollarColor(); 27 | 28 | /** 29 | * Gets whether the Wolf is angry or not 30 | * 31 | * @return {@code true} if angry; {@code false} if not 32 | */ 33 | boolean isAngry(); 34 | 35 | /** 36 | * Sets whether the Wolf is angry or not 37 | * 38 | * @param angry 39 | * {@code true} for angry; {@code false} for not angry 40 | */ 41 | void setAngry(boolean angry); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/NPCAIExcutionException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc; 2 | 3 | /** 4 | * NPC AI Excution Exception 5 | * Thrown if an exception occurs while executing a NPC AI Event 6 | * 7 | * @author Jason (darkdiplomat) 8 | */ 9 | public class NPCAIExcutionException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 201408281814L; 12 | 13 | /** 14 | * {@inheritDoc} 15 | */ 16 | public NPCAIExcutionException(String message) { 17 | super(message); 18 | } 19 | 20 | /** 21 | * {@inheritDoc} 22 | */ 23 | public NPCAIExcutionException(String msg, Throwable t) { 24 | super(msg, t); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/NPCBehavior.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.METHOD; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * NPC Behavior method annotation for the NPCBehavior Listener 11 | * 12 | * @author Jason (darkdiplomat) 13 | */ 14 | @Retention(RUNTIME) 15 | @Target(METHOD) 16 | public @interface NPCBehavior { 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/NPCBehaviorListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc; 2 | 3 | /** 4 | * A newer and updated NPC Behavior listening 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface NPCBehaviorListener { 9 | /* 10 | Example code: 11 | 12 | @NPCBehavior 13 | private final void someNameforanUpdateMethod(Update update){ 14 | // do stuff 15 | } 16 | 17 | */ 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/NpcAiListenerMethodConsistancyException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc; 2 | 3 | /** 4 | * @author Jason (darkdiplomat) 5 | */ 6 | public final class NpcAiListenerMethodConsistancyException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = 201408281759L; 9 | 10 | /** 11 | * {@inheritDoc} 12 | */ 13 | public NpcAiListenerMethodConsistancyException(String message) { 14 | super(message); 15 | } 16 | 17 | /** 18 | * {@inheritDoc} 19 | */ 20 | public NpcAiListenerMethodConsistancyException(String msg, Throwable t) { 21 | super(msg, t); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/Attacked.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | 5 | /** 6 | * AI Container for Attacked NPC 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Attacked extends NPCAI { 11 | public final Entity attacker; 12 | 13 | /** 14 | * Constructs a new Attacked AI Container 15 | * 16 | * @param attacker 17 | * the {@link net.canarymod.api.entity.Entity} attacking the NPC 18 | */ 19 | public Attacked(Entity attacker) { 20 | this.attacker = attacker; 21 | } 22 | 23 | /** 24 | * Gets the {@link net.canarymod.api.entity.Entity} attacker 25 | * 26 | * @return attacker 27 | */ 28 | public final Entity getAttacker() { 29 | return attacker; 30 | } 31 | 32 | /** 33 | * {@inheritDoc} 34 | */ 35 | public final String toString() { 36 | return String.format("NPCAI.Attacked[Attacker=%s]", attacker); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/Clicked.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Player; 4 | 5 | /** 6 | * AI container for Clicked NPC 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Clicked extends NPCAI { 11 | private final Player clicker; 12 | 13 | /** 14 | * Constructs a new Clicked AI Container 15 | * 16 | * @param clicker 17 | */ 18 | public Clicked(Player clicker) { 19 | this.clicker = clicker; 20 | } 21 | 22 | /** 23 | * Gets the {@link net.canarymod.api.entity.living.humanoid.Player} that has clicked the NPC 24 | * 25 | * @return clicker 26 | */ 27 | public final Player getClicker() { 28 | return this.clicker; 29 | } 30 | 31 | /** 32 | * {@inheritDoc} 33 | */ 34 | public final String toString() { 35 | return String.format("NPCAI.Clicked[Clicker=%s]", clicker); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/Destroyed.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | /** 4 | * AI Container for Destroyed NPC 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public final class Destroyed extends NPCAI { 9 | 10 | /** 11 | * {@inheritDoc} 12 | */ 13 | public final String toString() { 14 | return "NPCAI.Destroyed[]"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/NPCAI.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | import net.canarymod.api.entity.living.humanoid.NonPlayableCharacter; 4 | import net.canarymod.api.entity.living.humanoid.npc.NPCBehaviorRegistry; 5 | 6 | /** 7 | * Abstract container for the NPC AI system 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public abstract class NPCAI { 12 | 13 | /** 14 | * Gets the name of the NPC AI class 15 | * 16 | * @return NPCAI subclass name 17 | */ 18 | public final String getName() { 19 | return "NPCAI." + this.getClass().getSimpleName(); 20 | } 21 | 22 | /** 23 | * Short cut to calling this AI event 24 | * 25 | * @param npc 26 | * the NPC the event is taking place for 27 | */ 28 | public final void call(NonPlayableCharacter npc) { 29 | NPCBehaviorRegistry.execute(npc, this); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/PickupItem.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | import net.canarymod.api.inventory.Item; 4 | 5 | /** 6 | * AI Container for NPC item pickup 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class PickupItem extends NPCAI { 11 | private final Item pickedUp; 12 | 13 | /** 14 | * Constructs a new PickupItem AI Container 15 | * 16 | * @param pickedUp 17 | * the {@link net.canarymod.api.inventory.Item} being picked up 18 | */ 19 | public PickupItem(Item pickedUp) { 20 | this.pickedUp = pickedUp; 21 | } 22 | 23 | /** 24 | * Gets the {@link net.canarymod.api.inventory.Item} being picked up 25 | * 26 | * @return picked up item 27 | */ 28 | public final Item getItemPickedUp() { 29 | return pickedUp; 30 | } 31 | 32 | /** 33 | * {@inheritDoc} 34 | */ 35 | public final String toString() { 36 | return String.format("NPCAI.PickupItem[Item=%s]", pickedUp); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/humanoid/npc/ai/Update.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.humanoid.npc.ai; 2 | 3 | /** 4 | * AI Container for NPC Updates 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public final class Update extends NPCAI { 9 | 10 | /** 11 | * {@inheritDoc} 12 | */ 13 | public final String toString() { 14 | return "NPCAI.Update[]"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Blaze.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Blaze wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Blaze extends EntityMob { 9 | 10 | /** 11 | * Tells if this Blaze is on fire or not 12 | * 13 | * @return {@code true} if burning; {@code false} if not 14 | */ 15 | boolean isBurning(); 16 | 17 | /** 18 | * Sets if this Blaze is on fire or not 19 | * 20 | * @param isBurning 21 | * {@code true} for burning; {@code false} for not 22 | */ 23 | void setBurning(boolean isBurning); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/CaveSpider.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * CaveSpider Wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface CaveSpider extends Spider {// Nothing more required 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/EnderDragon.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | import net.canarymod.api.entity.EnderCrystal; 4 | 5 | /** 6 | * EnderDragon wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface EnderDragon extends EntityMob { 11 | 12 | /** 13 | * Checks if the EnderDragon is being slowed down (ie: flying through blocks) 14 | * 15 | * @return {@code true} if slowed; {@code false} if not 16 | */ 17 | boolean isSlowed(); 18 | 19 | /** 20 | * Gets the EnderCrystal healing the EnderDragon if present 21 | * 22 | * @return EnderCrystal if one is healing the dragon; {@code null} if none present 23 | */ 24 | EnderCrystal getHealingCrystal(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Endermite.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Endermite wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface Endermite extends EntityMob { 9 | 10 | /** 11 | * Gets whether a {@link net.canarymod.api.entity.living.humanoid.Player} has spawned the {@link Endermite} 12 | * 13 | * @return {@code true} if player spawned; {@code false} if not 14 | */ 15 | boolean isPlayerSpanwed(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/EntityMob.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | import net.canarymod.api.entity.living.EntityLiving; 4 | 5 | /** 6 | * A Mob base-entity that all mobs inherit from. 7 | * Declares some methods useful for mobs 8 | * 9 | * @author Chris Ksoll 10 | */ 11 | public interface EntityMob extends EntityLiving { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/GiantZombie.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Giant Zombie wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface GiantZombie extends EntityMob { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Guardian.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Guardian wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface Guardian extends EntityMob { 9 | 10 | /** 11 | * Gets whether this {@code Guardian} is an elder 12 | * 13 | * @return {@code true} if elder; {@code false} if not 14 | */ 15 | boolean isElder(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/MagmaCube.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * LavaSlime wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface MagmaCube extends Slime { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/RangedAttackMob.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Interface for distinguishing which mobs have ranged attack abilities. 5 | * 6 | * @author Aaron 7 | */ 8 | public interface RangedAttackMob { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Silverfish.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Silverfish wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Silverfish extends EntityMob { 9 | 10 | /** 11 | * Gets the ticks before calling allies 12 | * 13 | * @return the ticks before calling allies 14 | */ 15 | int getAllySummonCooldown(); 16 | 17 | /** 18 | * Sets the ticks before calling allies 19 | * 20 | * @param cooldown 21 | * the ticks before calling allies 22 | */ 23 | void setAllySummonCooldown(int cooldown); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Skeleton.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Skeleton wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Skeleton extends EntityMob, RangedAttackMob { 9 | 10 | /** 11 | * Gets whether this Skeleton is a WitherSkeleton 12 | * 13 | * @return {@code true} if WitherSkeleton; {@code false} if not 14 | */ 15 | boolean isWitherSkeleton(); 16 | 17 | /** 18 | * Sets whether this Skeleton is a WitherSkeleton 19 | * 20 | * @param wither 21 | * {@code true} if WitherSkeleton; {@code false} if not 22 | */ 23 | void setIsWitherSkeleton(boolean wither); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Spider.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Spider wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Spider extends EntityMob { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Witch.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Witch wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Witch extends EntityMob, RangedAttackMob { 9 | 10 | boolean isAgressive(); 11 | 12 | void setAggressive(boolean aggressive); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/living/monster/Wither.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.living.monster; 2 | 3 | /** 4 | * Wither wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Wither extends EntityMob, RangedAttackMob { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/ChickenEgg.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | /** 4 | * Chicken Egg wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface ChickenEgg extends EntityThrowable { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/EnderPearl.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | /** 4 | * EnderPerl wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface EnderPearl extends EntityThrowable { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/EntityPotion.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | import net.canarymod.api.potion.PotionType; 4 | 5 | /** 6 | * EntityPotion wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface EntityPotion extends EntityThrowable { 11 | 12 | /** 13 | * Gets the Potion Type ID as a short
14 | * This id may not match any of the id's in PotionType 15 | * 16 | * @return the Potion Type ID 17 | */ 18 | short getPotionTypeId(); 19 | 20 | /** 21 | * Gets the Potion Type as a PotionType 22 | * 23 | * @return the Potion Type 24 | */ 25 | PotionType getPotionType(); 26 | 27 | /** 28 | * Sets the Potion Type ID 29 | * 30 | * @param typeId 31 | * the Type ID to set 32 | */ 33 | void setPotionTypeId(short typeId); 34 | 35 | /** 36 | * Sets the Potion Type 37 | * 38 | * @param type 39 | * the PotionType to set 40 | */ 41 | void setPotionType(PotionType type); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/EntityThrowable.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | import net.canarymod.api.entity.Projectile; 5 | import net.canarymod.api.entity.living.LivingBase; 6 | 7 | /** 8 | * Throwable interface 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public interface EntityThrowable extends Entity, Projectile { 13 | 14 | /** 15 | * Gets the LivingBase that threw the Throwable 16 | * 17 | * @return the LivingBase that threw the Throwable 18 | */ 19 | LivingBase getThrower(); 20 | 21 | /** 22 | * Gets the amount of gravity to apply to the thrown entity with each tick. 23 | * 24 | * @return gravity 25 | * the amount of gravity applied 26 | */ 27 | float getGravity(); 28 | 29 | /** 30 | * Sets the amount of gravity to apply to the thrown entity with each tick. 31 | * 32 | * @param velocity 33 | * the amount of gravity to apply 34 | */ 35 | void setGravity(float velocity); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/Snowball.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | /** 4 | * Snowball wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Snowball extends EntityThrowable { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/throwable/XPBottle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.throwable; 2 | 3 | /** 4 | * XPBottle wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface XPBottle extends EntityThrowable { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/AnimalVehicle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.entity.living.animal.EntityAnimal; 4 | 5 | /** 6 | * Animal vehicle wrapper interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface AnimalVehicle extends EntityAnimal, Vehicle { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/Boat.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | /** 4 | * Boat Wrapper 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public interface Boat extends Vehicle { 9 | 10 | /** 11 | * Gets the direction that the vehicle is moving 12 | * 13 | * @return forward direction 14 | */ 15 | int getForwardDirection(); 16 | 17 | /** 18 | * Sets the direction that the vehicle is moving 19 | * 20 | * @param direction 21 | * the forward direction (0,1,2,3) 22 | */ 23 | void setForwardDirection(int direction); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/ChestMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | /** 4 | * ChestMinecraft wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface ChestMinecart extends ContainerMinecart { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/CommandBlockMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.CommandBlockLogic; 4 | 5 | /** 6 | * Command Block Minecart wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface CommandBlockMinecart extends Minecart, CommandBlockLogic { 11 | //nothing right now 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/ContainerMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.inventory.Inventory; 4 | 5 | /** 6 | * ContainerMinecart wrapper 7 | * 8 | * @author Somners 9 | */ 10 | public interface ContainerMinecart extends Minecart, Inventory { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/EmptyMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | /** 4 | * EmptyMinecart (Ridable) wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface EmptyMinecart extends Minecart { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/FurnaceMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | /** 4 | * FurnaceMinecart wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface FurnaceMinecart extends Minecart { 9 | 10 | /** 11 | * Gets the fuel level of the FurnaceMinecart 12 | * 13 | * @return fuel level 14 | */ 15 | int getFuelLevel(); 16 | 17 | /** 18 | * Sets the fuel level of the FurnaceMinecart 19 | * NOTE: The level increases by 3600 per Coal 20 | * 21 | * @param level 22 | * the level to be set 23 | */ 24 | void setFuelLevel(int level); 25 | 26 | /** 27 | * Increases the fuel level of the FurnaceMinecart 28 | * 29 | * @param increase 30 | * the amount to increase the fuel level 31 | */ 32 | void increaseFuelLevel(int increase); 33 | 34 | /** 35 | * Decreases the fuel level of the FurnaceMinecart 36 | * 37 | * @param decrease 38 | * the amount to decrease the fuel level 39 | */ 40 | void decreaseFuelLevel(int decrease); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/HopperMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.inventory.Hopper; 4 | 5 | /** 6 | * HopperMinecart wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface HopperMinecart extends ContainerMinecart, Hopper { 11 | 12 | /** 13 | * Gets if the Minecart is blocked by an activator rail 14 | * 15 | * @return {@code true} if blocked; {@code false} if not 16 | */ 17 | boolean isBlocked(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/MobSpawnerMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.MobSpawnerLogic; 4 | 5 | /** 6 | * MobSpawnerMinecart wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface MobSpawnerMinecart extends Minecart { 11 | 12 | /** 13 | * Gets the MobSpawnerLogic for this MobSpawnerMinecart 14 | * 15 | * @return mobspawnerlogic 16 | */ 17 | MobSpawnerLogic getMobSpawnerLogic(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/TNTMinecart.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.entity.Explosive; 4 | 5 | /** 6 | * TrinitrotolueneMinecart wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface TNTMinecart extends Minecart, Explosive { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/entity/vehicle/Vehicle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.entity.vehicle; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | 5 | /** 6 | * Vehicle wrapper 7 | * 8 | * @author Chris (damagefilter) 9 | */ 10 | public interface Vehicle extends Entity { 11 | 12 | /** 13 | * Gets the entity inside this vehicle 14 | * 15 | * @return entity 16 | */ 17 | Entity getPassenger(); 18 | 19 | /** 20 | * Says whether or not this vehicle is a boat 21 | * 22 | * @return {@code true} if boat; {@code false} if not 23 | */ 24 | boolean isBoat(); 25 | 26 | /** 27 | * Says whether or not this vehicle is a minecart 28 | * 29 | * @return {@code true} if minecart; {@code false} if not 30 | */ 31 | boolean isMinecart(); 32 | 33 | /** 34 | * Check if this vehicle is empty. 35 | * 36 | * @return {@code true} if empty; {@code false} if not 37 | */ 38 | boolean isEmpty(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/factory/StatisticsFactory.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.factory; 2 | 3 | import net.canarymod.api.statistics.Achievement; 4 | import net.canarymod.api.statistics.Stat; 5 | 6 | /** 7 | * Statitics Factory 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface StatisticsFactory { 12 | 13 | /** 14 | * Gets the instance for a given {@link Stat} name 15 | * 16 | * @param nmsName 17 | * the name of the stat 18 | * 19 | * @return {@link Stat} instance 20 | */ 21 | Stat getStat(String nmsName); 22 | 23 | Achievement getAchievement(String nmsName); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/gui/GUIControl.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.gui; 2 | 3 | /** 4 | * GUI Control intereface 5 | * 6 | * @author Larry (Larry1123) 7 | */ 8 | public interface GUIControl { 9 | 10 | /** 11 | * Used when the GUI is to be replaced. 12 | * Should be used to Close your GUI with out stopping the server 13 | */ 14 | void closeWindow(); 15 | 16 | /** 17 | * Called to start the GUI 18 | */ 19 | void start(); 20 | 21 | /** 22 | * The name of the GUI 23 | * 24 | * @return GUI name 25 | */ 26 | String getName(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/AnimalInventory.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | import net.canarymod.api.entity.living.animal.EntityAnimal; 4 | 5 | /** 6 | * Animal Inventory wrapper interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface AnimalInventory extends Inventory { 11 | 12 | /** 13 | * Gets the {@link EntityAnimal} that the inventory is for 14 | * 15 | * @return the {@link EntityAnimal} owner 16 | */ 17 | EntityAnimal getOwner(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/BaseItem.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | /** 4 | * Base Item to retrieve Item statistics 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public interface BaseItem { 9 | 10 | /** 11 | * Get the maximum Stack size for this item 12 | * 13 | * @return max stack size 14 | */ 15 | int getMaxStackSize(); 16 | 17 | /** 18 | * Return the amount of damage this item can take before it breaks 19 | * 20 | * @return max damage 21 | */ 22 | int getMaxDamage(); 23 | 24 | /** 25 | * Set the max amount of damage this item can take before it breaks 26 | * 27 | * @param damage 28 | * the damage max to set 29 | */ 30 | void setMaxDamage(int damage); 31 | 32 | /** 33 | * Check if this item is damageable 34 | * 35 | * @return {@code true} if damageable; {@code false} if not 36 | */ 37 | boolean isDamageable(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/CraftingMatrix.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | /** 4 | * Crafting Matrix sharer interface 5 | * This interface is so Workbench and PlayerCraftingMatrix can be sent the same 6 | * 7 | * @author Jason (darkdiplomat) 8 | */ 9 | public interface CraftingMatrix extends Inventory { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/CustomStorageInventory.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | import net.canarymod.api.nbt.CompoundTag; 4 | import net.canarymod.api.nbt.ListTag; 5 | 6 | /** 7 | * Custom Inventory wrapper interface 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface CustomStorageInventory extends Inventory { 12 | 13 | ListTag saveInventoryNBT(); 14 | 15 | void loadInventoryNBT(ListTag listTag); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/EnderChestInventory.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Human; 4 | 5 | /** 6 | * Enderchest inventory interface 7 | * 8 | * @author Jos Kuijpers 9 | */ 10 | public interface EnderChestInventory extends Inventory { 11 | 12 | /** 13 | * Get the owner of this ender chest inventory 14 | * 15 | * @return {@link Human} owner (NPC or Player) 16 | */ 17 | Human getInventoryOwner(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/InventoryType.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | /** 4 | * Inventory Type enum 5 | *

6 | * List of all inventory types 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public enum InventoryType { 11 | 12 | ANIMAL, 13 | ANVIL, 14 | BEACON, 15 | BREWING, 16 | CHEST, 17 | CRAFTMATRIX, 18 | CUSTOM, 19 | DISPENSER, 20 | ENCHANTMENT, 21 | FURNACE, 22 | HOPPER, 23 | MINECART_CHEST, 24 | MINECART_HOPPER, 25 | PLAYER, 26 | WORKBENCH, 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/ItemTypeException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | /** 4 | * Thrown when trying to create an invalid ItemType 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class ItemTypeException extends RuntimeException { 9 | 10 | private static final long serialVersionUID = -7320498855475606423L; 11 | 12 | public ItemTypeException(String str) { 13 | super(str); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/PlayerCraftingMatrix.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | /** 4 | * The Player's crafting space 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface PlayerCraftingMatrix extends CraftingMatrix { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/VillagerInventory.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory; 2 | 3 | import net.canarymod.api.VillagerTrade; 4 | import net.canarymod.api.entity.living.humanoid.Player; 5 | import net.canarymod.api.entity.living.humanoid.Villager; 6 | 7 | /** 8 | * Villager inventory interface 9 | * 10 | * @author Almog (Swift) 11 | */ 12 | public interface VillagerInventory extends Inventory { 13 | 14 | /** 15 | * Get the {@link Villager} involved with this trade 16 | * 17 | * @return The {@link Villager} owning this inventory 18 | */ 19 | Villager getOwner(); 20 | 21 | /** 22 | * Get the {@link Player} who is trading with this Villager 23 | * 24 | * @return The {@link Player} trading this Villager 25 | */ 26 | Player getPlayer(); 27 | 28 | /** 29 | * Get the {@link VillagerTrade} in the inventory window 30 | * 31 | * @return the {@link VillagerTrade} in the inventory 32 | */ 33 | VillagerTrade getTrade(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/recipes/ShapedRecipe.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory.recipes; 2 | 3 | import net.canarymod.api.inventory.Item; 4 | 5 | /** 6 | * ShapedRecipes wrapper interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface ShapedRecipe extends Recipe { 11 | 12 | /** 13 | * Gets the width of the Recipe 14 | * 15 | * @return the recipe width 16 | */ 17 | int getWidth(); 18 | 19 | /** 20 | * Gets the height of the Recipe 21 | * 22 | * @return the recipe height 23 | */ 24 | int getHeight(); 25 | 26 | /** 27 | * Gets the {@link Item}s that make up the recipe.
28 | * Index are left to right, top to bottom and do not specify actual shape of the recipe 29 | * 30 | * @return an array of {@link Item} 31 | */ 32 | Item[] getRecipeItems(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/inventory/recipes/ShapelessRecipe.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.inventory.recipes; 2 | 3 | import net.canarymod.api.inventory.Item; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * ShapelessRecipes wrapper interface 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public interface ShapelessRecipe extends Recipe { 13 | 14 | /** 15 | * Gets a list of {@link Item} that make up this recipe 16 | * 17 | * @return a list of {@link Item} 18 | */ 19 | List getRecipeItems(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/BaseTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * Base for all NBT storage tags. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface BaseTag { 9 | 10 | /** 11 | * Returns the ID number of the type of tag this is. 12 | * 13 | * @return the tag id 14 | */ 15 | byte getTypeId(); 16 | 17 | /** 18 | * Gets the Enum version of the id 19 | * 20 | * @return The {@link NBTTagType} for the given id 21 | */ 22 | NBTTagType getType(); 23 | 24 | /** 25 | * Copies the Tag 26 | * 27 | * @return a new instance of the tag being copied 28 | */ 29 | T copy(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/ByteArrayTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores an array of bytes. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface ByteArrayTag extends BaseTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the byte array value 14 | */ 15 | byte[] getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the byte array value 22 | */ 23 | void setValue(byte[] value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/ByteTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a byte. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface ByteTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the byte value 14 | */ 15 | byte getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the byte value 22 | */ 23 | void setValue(byte value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/DoubleTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a double. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface DoubleTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the double value 14 | */ 15 | double getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the double value 22 | */ 23 | void setValue(double value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/FloatTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a float. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface FloatTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the float value 14 | */ 15 | float getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the float value 22 | */ 23 | void setValue(float value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/IntArrayTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores an array of integers. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface IntArrayTag extends BaseTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the int array value 14 | */ 15 | int[] getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the int array value 22 | */ 23 | void setValue(int[] value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/IntTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores an integer. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface IntTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the integer value 14 | */ 15 | int getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the integer value 22 | */ 23 | void setValue(int value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/ListTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * An NBT tag that stores a list of other NBT tags of the same type. 7 | * 8 | * @param 9 | * the {@link BaseTag} object type for the list 10 | * 11 | * @author gregthegeek 12 | */ 13 | public interface ListTag extends BaseTag>, List { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/LongTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a long. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface LongTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the long value 14 | */ 15 | long getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the long value 22 | */ 23 | void setValue(long value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/PrimitiveTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * @author Jason (darkdiplomat) 5 | */ 6 | public interface PrimitiveTag extends BaseTag { 7 | 8 | long getLongValue(); 9 | 10 | int getIntValue(); 11 | 12 | short getShortValue(); 13 | 14 | byte getByteValue(); 15 | 16 | double getDoubleValue(); 17 | 18 | float getFloatValue(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/ShortTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a short. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface ShortTag extends PrimitiveTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the short value 14 | */ 15 | short getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the short value 22 | */ 23 | void setValue(short value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/nbt/StringTag.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.nbt; 2 | 3 | /** 4 | * An NBT tag that stores a string. 5 | * 6 | * @author gregthegeek 7 | */ 8 | public interface StringTag extends BaseTag { 9 | 10 | /** 11 | * Returns the value associated with this tag. 12 | * 13 | * @return the String value 14 | */ 15 | String getValue(); 16 | 17 | /** 18 | * Sets the value associated with this tag. 19 | * 20 | * @param value 21 | * the String value 22 | */ 23 | void setValue(String value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/packet/InvalidPacketConstructionException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.packet; 2 | 3 | /** 4 | * Called when a Packet that cannot be constructed is attempted to be constructed 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public class InvalidPacketConstructionException extends Exception { 9 | 10 | private static final long serialVersionUID = -7450608024867618509L; 11 | private final static String construct_fail = "Cannot construct Packet %d [%s] (%s). %s"; 12 | 13 | public InvalidPacketConstructionException(int packetID, String name, String extra) { 14 | super(String.format(construct_fail, packetID, Integer.toHexString(packetID), name, extra)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/packet/Packet.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.packet; 2 | 3 | /** 4 | * Packet interface. 5 | * This interface is not automatically applied to packets, 6 | * for performance reason packets should be wrapped on demand only! 7 | * 8 | * @author Chris (damagefilter) 9 | */ 10 | public interface Packet { 11 | 12 | /** 13 | * Get the packet size 14 | * 15 | * @return the packet's size 16 | */ 17 | int getPacketSize(); 18 | 19 | /** 20 | * Returns the ID for this packet.
21 | * For example the Id of packet3Chat is 3 22 | * 23 | * @return the packet's id 24 | */ 25 | int getPacketId(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/scoreboard/ScoreDummyCriteria.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.scoreboard; 2 | 3 | /** 4 | * @author Somners 5 | */ 6 | public interface ScoreDummyCriteria extends ScoreObjectiveCriteria { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/scoreboard/ScoreHealthCriteria.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.scoreboard; 2 | 3 | /** 4 | * Wrapper Interface for Health Score Criteria 5 | * 6 | * @author Somners 7 | */ 8 | public interface ScoreHealthCriteria extends ScoreDummyCriteria { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/scoreboard/ScoreObjectiveCriteria.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.scoreboard; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * ScoreObjectiveCriteria wrapper 7 | * 8 | * @author Somners 9 | */ 10 | public interface ScoreObjectiveCriteria { 11 | 12 | /** 13 | * Gets the protocol name assigned to this {@link ScoreObjectiveCriteria}. 14 | * 15 | * @return The internal protocol name. 16 | */ 17 | String getProtocolName(); 18 | 19 | /** 20 | * Used to get a score based on this criteria
21 | * This method is used primarily for readOnly 22 | * 23 | * @param list 24 | * List of parameters. 25 | * 26 | * @return The score. 27 | */ 28 | int getScore(List list); 29 | 30 | /** 31 | * Is read only? If this is true you cannot add or remove to the score. 32 | * The score can only be set by {@link Score#setReadOnlyScore} 33 | * 34 | * @return true if read only, false otherwise. 35 | */ 36 | boolean isReadOnly(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/statistics/Achievement.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.statistics; 2 | 3 | /** 4 | * Achievement 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Achievement extends Stat { 9 | 10 | /** 11 | * Gets the description of the achievement 12 | * 13 | * @return achievement description 14 | */ 15 | String getDescription(); 16 | 17 | /** 18 | * Gets the achievement required to get this achievement 19 | * 20 | * @return parent achievement 21 | */ 22 | Achievement getParent(); 23 | 24 | /** 25 | * Gets whether the achievement is special 26 | *

27 | * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to 28 | * achieve. 29 | * 30 | * @return {@code true} if special; {@code false} if not 31 | */ 32 | boolean isSpecial(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/statistics/Stat.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.statistics; 2 | 3 | /** 4 | * Stat wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Stat { 9 | 10 | /** 11 | * Get the id of this stat. 12 | * 13 | * @return the Stat ID 14 | */ 15 | String getId(); 16 | 17 | /** 18 | * Gets the name of the stat. 19 | * NOTE: This has gone through Minecraft's string translate to get a readable form 20 | * 21 | * @return the name of the Stat 22 | */ 23 | String getName(); 24 | 25 | /** 26 | * Return is this stat is independent (i.e., lacking prerequisites for being updated) 27 | * 28 | * @return {@code true} if independent; {@code false} if not 29 | */ 30 | boolean isIndependent(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/TreeType.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world; 2 | 3 | /** 4 | * Tree Types 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public enum TreeType { 9 | 10 | BIGOAK, 11 | SWAMPOAK, 12 | DARKOAK, 13 | BIRCH, 14 | TALLBIRCH, 15 | SPRUCE, 16 | TALLSPRUCE, 17 | MEGASPRUCE, 18 | JUNGLE, 19 | TALLJUNGLE, 20 | JUNGLEBUSH, 21 | MEGAJUNGLE, 22 | ACACIA, 23 | 24 | /* I know, these technically aren't trees, but the Bukkit API has them and people will complain if these are here... */ 25 | REDMUSHROOM, 26 | BROWNMUSHROOM, 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/UnknownWorldException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world; 2 | 3 | /** 4 | * Thrown when a needed world is non-existent or not loaded 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class UnknownWorldException extends IllegalArgumentException { 9 | private static final long serialVersionUID = -6910387258523508711L; 10 | 11 | public UnknownWorldException(String str) { 12 | super(str); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/BrewingStand.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * BrewingStand interface 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface BrewingStand extends LockableTileEntity { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Chest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.inventory.Inventory; 4 | 5 | /** 6 | * Chest interface 7 | * 8 | * @author Chris (damagefilter) 9 | */ 10 | public interface Chest extends LockableTileEntity, Inventory { 11 | 12 | /** 13 | * Check if this chest has an attached chest (is a double chest) 14 | * 15 | * @return {@code true} if attached chest; {@code false} if not 16 | */ 17 | boolean hasAttachedChest(); 18 | 19 | /** 20 | * Gets the DoubleChest that results from this chest and its attached chest. 21 | * Returns null if there is no attached chest 22 | * 23 | * @return {@link DoubleChest} if found; {@code null} if not 24 | */ 25 | DoubleChest getDoubleChest(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/CommandBlock.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.CommandBlockLogic; 4 | 5 | /** 6 | * CommandBlock wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface CommandBlock extends TileEntity, CommandBlockLogic { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Comparator.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * Comparator wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Comparator extends TileEntity { 9 | 10 | /** 11 | * Gets the output signal of the Comparator 12 | * 13 | * @return output signal 14 | */ 15 | int getOutputSignal(); 16 | 17 | /** 18 | * Sets the output signal of the Comparator 19 | * 20 | * @param signal 21 | * the output signal 22 | */ 23 | void setOutputSignal(int signal); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/CustomBlockTypeException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * Thrown when dealing with custom BlockTypes that don't exist or already exist 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class CustomBlockTypeException extends RuntimeException { 9 | 10 | private static final long serialVersionUID = -1135339551333207850L; 11 | 12 | public CustomBlockTypeException(String str) { 13 | super(str); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/DaylightDetector.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * DaylightDetector wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface DaylightDetector extends TileEntity { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Dispenser.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | 5 | /** 6 | * Dispenser interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Dispenser extends LockableTileEntity { 11 | 12 | /** 13 | * Activate the dispenser: spawns an item from a random slot. 14 | * 15 | * @return the entity spawned 16 | */ 17 | Entity activate(); 18 | 19 | /** 20 | * Dispense the item from the given slot. 21 | * 22 | * @param slot 23 | * the slot to dispend from 24 | * 25 | * @return the entity spawned 26 | */ 27 | Entity dispenseFromSlot(int slot); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/DoubleChest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * DoubleChest interface 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public interface DoubleChest extends Chest { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Dropper.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * Dropper wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface Dropper extends Dispenser { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/EnderChest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Player; 4 | import net.canarymod.api.inventory.Inventory; 5 | 6 | /** 7 | * An EnderChest is not treated as a regular chest by extending Container 8 | * as one block does not have an inventory attached. The inventory visible 9 | * to the player is attached to the player instead. 10 | * 11 | * @author Jos Kuijpers 12 | */ 13 | public interface EnderChest extends TileEntity { 14 | 15 | /** 16 | * Get this chests inventory 17 | * 18 | * @param player 19 | * The player to get the ender inventory from 20 | * 21 | * @return EnderChest inventory 22 | */ 23 | Inventory getInventory(Player player); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Jukebox.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.inventory.Item; 4 | 5 | /** 6 | * Wrap a TileEntityNote etc 7 | * 8 | * @author Chris (damagefilter) 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public interface Jukebox extends TileEntity { 12 | 13 | /** 14 | * Get the disc that is in this jukebox. null if no disc 15 | * inside 16 | * 17 | * @return the Disc or {@code null} if no disc 18 | */ 19 | Item getDisc(); 20 | 21 | /** 22 | * Setting the disc that is played. This may activate the jukebox 23 | * 24 | * @param disc 25 | * the {@link Item} music disc 26 | */ 27 | void setDisc(Item disc); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/LockableTileEntity.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import com.google.common.annotations.Beta; 4 | import net.canarymod.api.inventory.Inventory; 5 | 6 | /** 7 | * TileEntityLockable wrapper 8 | * 9 | * @author Jason Jones (darkdiplomat) 10 | */ 11 | public interface LockableTileEntity extends TileEntity, Inventory { 12 | 13 | String getCode(); 14 | 15 | @Beta 16 | void setCode(String code);// Unknown yet if changing a code will work 17 | 18 | boolean hasCodeSet(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/MapColor.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * Map Color wrapper 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface MapColor { 9 | 10 | int getIndex(); 11 | 12 | int getValue(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/MapColorList.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import com.google.common.annotations.Beta; 4 | 5 | /** 6 | * MapColor listings 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | @Beta 11 | public enum MapColorList { 12 | 13 | AIR, 14 | GRASS, 15 | SAND, 16 | CLOTH, 17 | TNT, 18 | ICE, 19 | IRON, 20 | FOLIAGE, 21 | SNOW, 22 | CLAY, 23 | DIRT, 24 | STONE, 25 | WATER, 26 | WOOD, 27 | QUARTZ, 28 | ADOBE, 29 | MAGENTA, 30 | LIGHTBLUE, 31 | YELLOW, 32 | LIME, 33 | PINK, 34 | GRAY, 35 | SILVER, 36 | CYAN, 37 | PURPLE, 38 | BLUE, 39 | BROWN, 40 | GREEN, 41 | RED, 42 | BLACK, 43 | GOLD, 44 | DIAMOND, 45 | LAPIS, 46 | EMERALD, 47 | OBSIDIAN, 48 | NETHERRACK, 49 | /* New colors should be placed above */ 50 | OTHER,; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/MobSpawner.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.MobSpawnerLogic; 4 | 5 | /** 6 | * MobSpawner Wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface MobSpawner extends TileEntity { 11 | 12 | /** 13 | * Get the Logic instance for this MobSpawner. 14 | * 15 | * @return The Logic Instance. 16 | */ 17 | MobSpawnerLogic getLogic(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/NoteBlock.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | /** 4 | * Wrap a TileEntityNote etc 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public interface NoteBlock extends TileEntity { 9 | 10 | /** 11 | * Get the current note pitch 12 | * 13 | * @return note pitch 14 | */ 15 | byte getNote(); 16 | 17 | /** 18 | * Set the note pitch 19 | * 20 | * @param note 21 | * the note pitch 22 | */ 23 | void setNote(byte note); 24 | 25 | /** 26 | * Emit a sound from this note block 27 | */ 28 | void play(); 29 | 30 | /** 31 | * Returns the instrument for this note block as byte value
32 | * Wood based blocks = 4 (Bass Guitar)
33 | * Sand/Gravel blocks = 2 (Snare Drum)
34 | * Glass blocks = 3 (Clicks / Rimshots))
35 | * Stone/rocks based blocks = 1 (Bassdrum)
36 | * all other blocks = 0 (Piano) 37 | * 38 | * @return instrument byte 39 | */ 40 | byte getInstrument(); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/Workbench.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import net.canarymod.api.inventory.CraftingMatrix; 4 | 5 | /** 6 | * Workbench interface 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface Workbench extends TileEntity, CraftingMatrix { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/BlockBooleanProperty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties; 2 | 3 | /** 4 | * PropertyBool wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface BlockBooleanProperty extends BlockProperty { 9 | 10 | /** 11 | * Tests if a given value can be applied to the Property 12 | * 13 | * @param value 14 | * the value to test 15 | * 16 | * @return {@code true} if can apply; {@code false} if not 17 | */ 18 | boolean canApply(Boolean value); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/BlockDirectionProperty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties; 2 | 3 | /** 4 | * PropertyDirection wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface BlockDirectionProperty extends BlockEnumProperty { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/BlockEnumProperty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties; 2 | 3 | /** 4 | * PropertyEnum wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface BlockEnumProperty extends BlockProperty { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/BlockIntegerProperty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties; 2 | 3 | /** 4 | * PropertyInteger wrapper 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface BlockIntegerProperty extends BlockProperty { 9 | 10 | /** 11 | * Tests if a given value can be applied to the Property 12 | * 13 | * @param value 14 | * the value to test 15 | * 16 | * @return {@code true} if can apply; {@code false} if not 17 | */ 18 | boolean canApply(Integer value); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/BlockProperty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * Block IProperty/PropertyHelper wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public interface BlockProperty { 11 | 12 | /** 13 | * Gets the Property's name 14 | * 15 | * @return property name 16 | */ 17 | String getName(); 18 | 19 | /** 20 | * Gets the collection of allowed values 21 | * 22 | * @return allowed values 23 | */ 24 | Collection getAllowedValues(); 25 | 26 | /** 27 | * Gets the Class type of the allowed values 28 | * 29 | * @return class type 30 | */ 31 | Class getValueClass(); 32 | 33 | /** 34 | * Tests if a given value can be applied to the Property 35 | * 36 | * @param value 37 | * the value to test 38 | * 39 | * @return {@code true} if can apply; {@code false} if not 40 | */ 41 | boolean canApply(Comparable value); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/api/world/blocks/properties/helpers/WoodProperties.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks.properties.helpers; 2 | 3 | /** 4 | * Intermediary for Wood variants 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public interface WoodProperties { 9 | 10 | /** 11 | * Wood variants 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | enum Variant { 16 | OAK, 17 | SPRUCE, 18 | BIRCH, 19 | JUNGLE, 20 | ACACIA, 21 | DARK_OAK; 22 | 23 | public static Variant valueOf(int ordinal) { 24 | if (ordinal < 0 || ordinal >= values().length) { 25 | throw new IllegalArgumentException(); 26 | } 27 | return values()[ordinal]; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/backbone/Backbone.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.backbone; 2 | 3 | /** 4 | * The backbone system. 5 | * 6 | * @author Chris (damagefilter) 7 | * @author Jason (darkdiplomat) 8 | */ 9 | public class Backbone { 10 | 11 | private System system; 12 | 13 | public Backbone(System system) { 14 | this.system = system; 15 | } 16 | 17 | public enum System { 18 | BANS, 19 | GROUPS, 20 | WARPS, 21 | KITS, 22 | PERMISSIONS, 23 | USERS, 24 | WHITELIST, 25 | OPERATORS, 26 | RESERVELIST; 27 | } 28 | 29 | /** 30 | * Get the System of this backbone 31 | * 32 | * @return The System instance. 33 | */ 34 | public System getSystem() { 35 | return system; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/backbone/OperatorsDataAccess.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.backbone; 2 | 3 | import net.canarymod.config.Configuration; 4 | import net.canarymod.database.Column; 5 | import net.canarymod.database.Column.DataType; 6 | import net.canarymod.database.DataAccess; 7 | 8 | /** 9 | * Operators Data Access 10 | * 11 | * @author Jason (darkdiplomat) 12 | */ 13 | public class OperatorsDataAccess extends DataAccess { 14 | 15 | public OperatorsDataAccess() { 16 | super(Configuration.getDbConfig().getOpertatorsTableName()); 17 | } 18 | 19 | /** 20 | * Playername for this operator entry 21 | */ 22 | @Column(columnName = "player", dataType = DataType.STRING) 23 | public String player; 24 | 25 | @Override 26 | public DataAccess getInstance() { 27 | return new OperatorsDataAccess(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/backbone/ReservelistDataAccess.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.backbone; 2 | 3 | import net.canarymod.config.Configuration; 4 | import net.canarymod.database.Column; 5 | import net.canarymod.database.Column.DataType; 6 | import net.canarymod.database.DataAccess; 7 | 8 | /** 9 | * Reserve List Data Access 10 | * 11 | * @author Jason (darkdiplomat) 12 | */ 13 | public class ReservelistDataAccess extends DataAccess { 14 | 15 | public ReservelistDataAccess() { 16 | super(Configuration.getDbConfig().getReservelistTableName()); 17 | } 18 | 19 | /** 20 | * UUID for this reservelist entry 21 | */ 22 | @Column(columnName = "uuid", dataType = DataType.STRING) 23 | public String uuid; 24 | 25 | /** 26 | * Playername for this reservelist entry 27 | */ 28 | @Column(columnName = "player", dataType = DataType.STRING) 29 | public String player; 30 | 31 | @Override 32 | public DataAccess getInstance() { 33 | return new ReservelistDataAccess(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/backbone/WhitelistDataAccess.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.backbone; 2 | 3 | import net.canarymod.config.Configuration; 4 | import net.canarymod.database.Column; 5 | import net.canarymod.database.Column.DataType; 6 | import net.canarymod.database.DataAccess; 7 | 8 | /** 9 | * Permission Data Access 10 | * 11 | * @author Chris (damagefilter) 12 | */ 13 | public class WhitelistDataAccess extends DataAccess { 14 | 15 | public WhitelistDataAccess() { 16 | super(Configuration.getDbConfig().getWhitelistTableName()); 17 | } 18 | 19 | /** 20 | * UUID for this reservelist entry 21 | */ 22 | @Column(columnName = "uuid", dataType = DataType.STRING) 23 | public String uuid; 24 | 25 | /** 26 | * Playername for this 27 | *

28 | * /** Playername for this whitelist entry 29 | */ 30 | @Column(columnName = "player", dataType = DataType.STRING) 31 | public String player; 32 | 33 | @Override 34 | public DataAccess getInstance() { 35 | return new WhitelistDataAccess(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/bansystem/BanType.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.bansystem; 2 | 3 | /** 4 | * The enum of ban types 5 | * 6 | * @author Jamie (jamierocks) 7 | */ 8 | public enum BanType { 9 | /** 10 | * A ban applied to a UUID 11 | */ 12 | UUID, 13 | 14 | /** 15 | * A ban applied to an IP 16 | */ 17 | IP 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/channels/ChannelListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.channels; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Player; 4 | 5 | /** 6 | * @author Somners 7 | */ 8 | public abstract class ChannelListener { 9 | 10 | /** 11 | * Receives the input from Packet250CustomPayload on the registered channels. 12 | * 13 | * @param channel 14 | * The name of the channel. 15 | * @param player 16 | * The client who sent this byte stream. 17 | * @param byteStream 18 | * The data send by the client. 19 | */ 20 | public abstract void onChannelInput(String channel, Player player, byte[] byteStream); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/channels/CustomPayloadChannelException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.channels; 2 | 3 | /** 4 | * @author Somners 5 | */ 6 | public class CustomPayloadChannelException extends Exception { 7 | 8 | private static final long serialVersionUID = 5665326099228188167L; 9 | 10 | public CustomPayloadChannelException(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/channels/RegisteredChannelListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.channels; 2 | 3 | import net.canarymod.plugin.Plugin; 4 | 5 | /** 6 | * @author Somners 7 | */ 8 | public class RegisteredChannelListener { 9 | 10 | private Plugin plugin; 11 | private ChannelListener listener; 12 | 13 | public RegisteredChannelListener(Plugin plugin, ChannelListener listener) { 14 | this.plugin = plugin; 15 | this.listener = listener; 16 | } 17 | 18 | /** 19 | * Get the plugin associated with this registered channel listener. 20 | * 21 | * @return plugin 22 | */ 23 | public Plugin getPlugin() { 24 | return this.plugin; 25 | } 26 | 27 | /** 28 | * Get the ChannelListener instance associated with this registered channel listener. 29 | * 30 | * @return {@link ChannelListener} 31 | */ 32 | public ChannelListener getChannelListener() { 33 | return this.listener; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/chat/ReceiverType.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.chat; 2 | 3 | /** 4 | * Message Receiver Types 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public enum ReceiverType { 9 | SERVER, 10 | PLAYER, 11 | COMMANDBLOCK, 12 | COMMANDBLOCKENTITY 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/CommandDependencyException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | /** 4 | * Thrown when a commands parent command is not registered upon attempting 5 | * to register the child command 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class CommandDependencyException extends Exception { 10 | 11 | private static final long serialVersionUID = 6961878125185151847L; 12 | 13 | public CommandDependencyException(String str) { 14 | super(str); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/CommandListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | /** 4 | * Listener interface to mark a class a command class. 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public interface CommandListener { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/CommandOwner.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | /** 4 | * This interface mandates methods for command ownership. 5 | * A command owner can be the server or a plugin. 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public interface CommandOwner { 10 | 11 | /** 12 | * Get the name of this command owner 13 | * 14 | * @return The name 15 | */ 16 | String getName(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/DuplicateCommandException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | /** 4 | * Used to yell at a plugin developer for not checking their commands. 5 | * 6 | * @author Willem (l4mRh4X0r) 7 | */ 8 | public class DuplicateCommandException extends CommandException { 9 | private static final long serialVersionUID = 1L; 10 | 11 | /** 12 | * Creates a new DuplicateCommandException. 13 | * 14 | * @param command 15 | * The offending command 16 | */ 17 | public DuplicateCommandException(String command) { 18 | super("The command " + command + " already exists!"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/DynamicTabCompleteAnnotation.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | import java.lang.annotation.Annotation; 4 | 5 | /** 6 | * A dynamic TabComplete annotation, used by the non-java based command system 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public class DynamicTabCompleteAnnotation implements TabComplete { 11 | private final String[] commands; 12 | 13 | public DynamicTabCompleteAnnotation(String... commands) { 14 | this.commands = commands; 15 | } 16 | 17 | @Override 18 | public String[] commands() { 19 | return commands; 20 | } 21 | 22 | @Override 23 | public Class annotationType() { 24 | return TabComplete.class; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/NativeCommand.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Marks a command as a Canary native one 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface NativeCommand { 11 | 12 | void execute(MessageReceiver caller, String[] parameters); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/TabComplete.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.METHOD; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | /** 10 | * Annotation intended to help distinguish what methods are autoComplete methods in a {@link net.canarymod.commandsys.CommandListener} 11 | * 12 | * @author Jason (darkdiplomat) 13 | * @author Chris (damagefilter) 14 | */ 15 | @Retention(RUNTIME) 16 | @Target(METHOD) 17 | public @interface TabComplete { 18 | 19 | /** 20 | * List of commands (or command aliases) to which this tab completion applies 21 | * 22 | * @return list of commands or command aliases 23 | */ 24 | String[] commands() default {}; // Empty as legacy 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/TabCompleteDispatch.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * {@link net.canarymod.commandsys.TabComplete} method wrapper 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public interface TabCompleteDispatch { 13 | List complete(MessageReceiver msgrec, String[] args) throws TabCompleteException; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/TabCompleteException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys; 2 | 3 | /** 4 | * Exception thrown if a {@link net.canarymod.commandsys.TabComplete} method fails 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public class TabCompleteException extends Exception { 9 | public TabCompleteException(String msg, Throwable thrown) { 10 | super(msg, thrown); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/groupmod/GroupBase.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.groupmod; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | /** 8 | * Command to show help for the groupmod command 9 | * 10 | * @author Chris (damagefilter) 11 | */ 12 | public class GroupBase implements NativeCommand { 13 | 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | if (parameters.length == 0) { 16 | Canary.help().getHelp(caller, "groupmod"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/groupmod/GroupList.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.groupmod; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.ChatFormat; 5 | import net.canarymod.chat.MessageReceiver; 6 | import net.canarymod.commandsys.NativeCommand; 7 | import net.canarymod.user.Group; 8 | 9 | /** 10 | * Command to list all the groups defined 11 | * 12 | * @author Chris (damagefilter) 13 | */ 14 | public class GroupList implements NativeCommand { 15 | // group) list 16 | public void execute(MessageReceiver caller, String[] args) { 17 | for (Group g : Canary.usersAndGroups().getGroups()) { 18 | StringBuilder line = new StringBuilder(); 19 | line.append(ChatFormat.YELLOW).append("Name: ").append(ChatFormat.WHITE).append(g.getName()); 20 | if (g.hasParent()) { 21 | line.append(", ").append(ChatFormat.YELLOW).append("Parent: ").append(ChatFormat.WHITE).append(g.getParent().getName()); 22 | } 23 | caller.message(line.toString()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/groupmod/GroupPermissionList.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.groupmod; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | import net.canarymod.user.Group; 7 | 8 | import static net.canarymod.Translator.sendTranslatedNotice; 9 | 10 | /** 11 | * Command to list all permissions of a group 12 | * 13 | * @author Chris (damagefilter) 14 | */ 15 | public class GroupPermissionList implements NativeCommand { 16 | // groupmod permission add group value 17 | public void execute(MessageReceiver caller, String[] args) { 18 | Group group = Canary.usersAndGroups().getGroup(args[0]); 19 | if (group == null || !group.getName().equals(args[0])) { 20 | sendTranslatedNotice(caller, "unknown group", args[0]); 21 | return; 22 | } 23 | group.getPermissionProvider().printPermissionsToCaller(caller); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/Motd.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.Translator; 5 | import net.canarymod.chat.MessageReceiver; 6 | import net.canarymod.commandsys.CommandException; 7 | import net.canarymod.commandsys.NativeCommand; 8 | 9 | /** 10 | * Command to view the Message Of The Day 11 | * 12 | * @author Chris (damagefilter) 13 | */ 14 | public class Motd implements NativeCommand { 15 | 16 | public void execute(MessageReceiver caller, String[] parameters) { 17 | if (caller == null) { 18 | throw new CommandException(Translator.translateAndFormat("unknown messagereceiver", "null")); 19 | } 20 | Canary.motd().sendMOTD(caller); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/ReloadCommand.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Translator.sendTranslatedNotice; 8 | 9 | /** 10 | * Command to reload the server (config, perms player data, etc.) 11 | * 12 | * @author Chris (damagefilter) 13 | * @see Canary#reload() 14 | */ 15 | public class ReloadCommand implements NativeCommand { 16 | 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | sendTranslatedNotice(caller, "reload reloading"); 19 | Canary.instance().reload(); 20 | sendTranslatedNotice(caller, "reload reloading done"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/StopServer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.Translator; 5 | import net.canarymod.chat.MessageReceiver; 6 | import net.canarymod.commandsys.NativeCommand; 7 | import net.visualillusionsent.utils.StringUtils; 8 | 9 | /** 10 | * Command to stop Canary 11 | * 12 | * @author Chris (damagefilter) 13 | */ 14 | public class StopServer implements NativeCommand { 15 | 16 | public void execute(MessageReceiver caller, String[] parameters) { 17 | Canary.getServer().notice(Translator.translateAndFormat("stop console", caller.getName())); 18 | Canary.getServer().initiateShutdown(parameters.length > 1 ? StringUtils.joinString(parameters, " ", 1) : null); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/kits/KitDelete.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.kits; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.ChatFormat; 5 | import net.canarymod.chat.MessageReceiver; 6 | import net.canarymod.commandsys.NativeCommand; 7 | import net.canarymod.kit.Kit; 8 | 9 | import static net.canarymod.Translator.sendTranslatedNotice; 10 | 11 | /** 12 | * /kit delete 13 | * 14 | * @author Jason Jones (darkdiplomat) 15 | */ 16 | public class KitDelete implements NativeCommand { 17 | 18 | @Override 19 | public void execute(MessageReceiver caller, String[] args) { 20 | Kit kat = Canary.kits().getKit(args[0]); 21 | if (kat != null) { 22 | Canary.kits().removeKit(kat); 23 | caller.notice(String.format("Kit '%s%s%s' deleted", ChatFormat.YELLOW, args[0], ChatFormat.RED)); 24 | } 25 | else { 26 | sendTranslatedNotice(caller, "kit invalid", args[0]); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/reservelist/ReservelistAdd.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.reservelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Canary.reservelist; 8 | import static net.canarymod.Translator.sendTranslatedMessage; 9 | 10 | /** 11 | * ReserveList Add Command 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | public class ReservelistAdd implements NativeCommand { 16 | 17 | @Override 18 | public void execute(MessageReceiver caller, String[] args) { 19 | reservelist().addPlayer(args[0]); 20 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "reservelist player added", args[0]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/reservelist/ReservelistRemove.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.reservelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Canary.reservelist; 8 | import static net.canarymod.Translator.sendTranslatedMessage; 9 | 10 | /** 11 | * Reserve Remove Command 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | public class ReservelistRemove implements NativeCommand { 16 | 17 | @Override 18 | public void execute(MessageReceiver caller, String[] args) { 19 | reservelist().removePlayer(args[0]); 20 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "reservelist player removed", args[0]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/whitelist/WhitelistAdd.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.whitelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Canary.whitelist; 8 | import static net.canarymod.Translator.sendTranslatedMessage; 9 | 10 | /** 11 | * Whitelist Add Command 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | public class WhitelistAdd implements NativeCommand { 16 | 17 | @Override 18 | public void execute(MessageReceiver caller, String[] args) { 19 | whitelist().addPlayer(args[0]); 20 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "whitelist player added", args[0]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/whitelist/WhitelistDisable.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.whitelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | import net.canarymod.config.Configuration; 7 | import net.visualillusionsent.utils.PropertiesFile; 8 | 9 | import static net.canarymod.Translator.sendTranslatedMessage; 10 | 11 | /** 12 | * Whitelist Disable (Off) Command 13 | * 14 | * @author Jason Jones (darkdiplomat) 15 | */ 16 | public class WhitelistDisable implements NativeCommand { 17 | 18 | @Override 19 | public void execute(MessageReceiver caller, String[] args) { 20 | PropertiesFile srvcfg = Configuration.getServerConfig().getFile(); 21 | srvcfg.setBoolean("whitelist-enabled", false); 22 | srvcfg.save(); 23 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "whitelist disabled"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/whitelist/WhitelistEnable.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.whitelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | import net.canarymod.config.Configuration; 7 | import net.visualillusionsent.utils.PropertiesFile; 8 | 9 | import static net.canarymod.Translator.sendTranslatedMessage; 10 | 11 | /** 12 | * Whitelist Enable (On) Command 13 | * 14 | * @author Jason Jones (darkdiplomat) 15 | */ 16 | public class WhitelistEnable implements NativeCommand { 17 | 18 | @Override 19 | public void execute(MessageReceiver caller, String[] args) { 20 | PropertiesFile srvcfg = Configuration.getServerConfig().getFile(); 21 | srvcfg.setBoolean("whitelist-enabled", true); 22 | srvcfg.save(); 23 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "whitelist enabled"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/whitelist/WhitelistReload.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.whitelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Canary.whitelist; 8 | import static net.canarymod.Translator.sendTranslatedMessage; 9 | 10 | /** 11 | * Whitelist Remove Command 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | public class WhitelistReload implements NativeCommand { 16 | 17 | @Override 18 | public void execute(MessageReceiver caller, String[] args) { 19 | whitelist().reload(); 20 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "whitelist reload"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/system/whitelist/WhitelistRemove.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.system.whitelist; 2 | 3 | import net.canarymod.chat.ChatFormat; 4 | import net.canarymod.chat.MessageReceiver; 5 | import net.canarymod.commandsys.NativeCommand; 6 | 7 | import static net.canarymod.Canary.whitelist; 8 | import static net.canarymod.Translator.sendTranslatedMessage; 9 | 10 | /** 11 | * Whitelist Remove Command 12 | * 13 | * @author Jason Jones (darkdiplomat) 14 | */ 15 | public class WhitelistRemove implements NativeCommand { 16 | 17 | @Override 18 | public void execute(MessageReceiver caller, String[] args) { 19 | whitelist().removePlayer(args[0]); 20 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "whitelist player removed", args[0]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Achievement.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.ACHIEVEMENT$OTHER; 7 | 8 | /** 9 | * Achievement command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class Achievement extends VanillaCommandWrapper { 14 | // achievement give [player] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (parameters.length > 2) { 19 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(ACHIEVEMENT$OTHER)) { 20 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 21 | return; 22 | } 23 | } 24 | passOn(caller, "achievement", parameters); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/BlockData.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * BlockData command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class BlockData extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "blockdata", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Broadcast.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Broadcast command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Broadcast extends VanillaCommandWrapper { 11 | // say | alias broadcast 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "say", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Clone.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Clone command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Clone extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "clone", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Debug.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Debug command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Debug extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "debug", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/DefaultGameMode.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Default GameMode command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class DefaultGameMode extends VanillaCommandWrapper { 11 | // defaultgamemode 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "defaultgamemode", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/DefaultSpawnpoint.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Default GameMode command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class DefaultSpawnpoint extends VanillaCommandWrapper { 11 | // setworldspawn [ ] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "setworldspawn", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Difficulty.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Difficulty command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Difficulty extends VanillaCommandWrapper { 11 | // difficulty [world] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "difficulty", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Effect.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.EFFECT$OTHER; 7 | 8 | /** 9 | * Effect command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class Effect extends VanillaCommandWrapper { 14 | // effect [seconds] [amplifier] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(EFFECT$OTHER)) { 19 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 20 | return; 21 | } 22 | passOn(caller, "effect", parameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Emote.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Emote command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Emote extends VanillaCommandWrapper { 11 | // emote | alias me 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "me", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Enchant.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.ENCHANT$OTHER; 7 | 8 | /** 9 | * Enchant command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class Enchant extends VanillaCommandWrapper { 14 | // enchant [level] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(ENCHANT$OTHER)) { 19 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 20 | return; 21 | } 22 | passOn(caller, "enchant", parameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/EntityData.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * EntityData command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class EntityData extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "entitydata", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Execute.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Execute command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Execute extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "execute", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Fill.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Fill command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Fill extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "fill", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/GameMode.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.GAMEMODE$OTHER; 7 | 8 | /** 9 | * GameMode command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class GameMode extends VanillaCommandWrapper { 14 | // gamemode | alias mode 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(GAMEMODE$OTHER)) { 19 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 20 | return; 21 | } 22 | passOn(caller, "gamemode", parameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/GameRule.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * GameRule command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class GameRule extends VanillaCommandWrapper { 11 | // gamerule [value] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "gamerule", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Give.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.GIVE$OTHER; 7 | 8 | /** 9 | * Give command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class Give extends VanillaCommandWrapper { 14 | // give [amount] [data] [dataTag] | alias i item 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(GIVE$OTHER)) { 19 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 20 | return; 21 | } 22 | passOn(caller, "give", parameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Kill.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.KILL$OTHER; 7 | 8 | /** 9 | * Kill command wrapper 10 | * 11 | * @author Almog (Swift) 12 | */ 13 | public final class Kill extends VanillaCommandWrapper { 14 | 15 | @Override 16 | public void execute(MessageReceiver caller, String[] parameters) { 17 | if (parameters.length > 0 && isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(KILL$OTHER)) { 18 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 19 | return; 20 | } 21 | passOn(caller, "kill", parameters); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Message.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Message command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Message extends VanillaCommandWrapper { 11 | // tell | alias m msg 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "tell", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/MessageRaw.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Message Raw command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class MessageRaw extends VanillaCommandWrapper { 11 | // tellraw 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "tellraw", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Particle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Particle command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Particle extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "particle", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/PlaySound.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.PLAYSOUND$OTHER; 7 | 8 | /** 9 | * PlaySound command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class PlaySound extends VanillaCommandWrapper { 14 | // playsound [x] [y] [z] [volume] [pitch] [minimumVolume] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (isNotSelfOrServer(caller, parameters[1]) && !caller.hasPermission(PLAYSOUND$OTHER)) { 19 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 20 | return; 21 | } 22 | passOn(caller, "playsound", parameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/ReplaceItem.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * ReplaceItem command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class ReplaceItem extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "replaceitem", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SaveAll.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Save-All command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class SaveAll extends VanillaCommandWrapper { 11 | // save-all 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "save-all", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SaveOff.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Save-Off command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class SaveOff extends VanillaCommandWrapper { 11 | // save-off 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "save-off", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SaveOn.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Save-On command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class SaveOn extends VanillaCommandWrapper { 11 | // save-on 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "save-on", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Scoreboard.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Scoreboard command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Scoreboard extends VanillaCommandWrapper { 11 | // scoreboard 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "scoreboard", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SetBlock.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * SetBlock command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class SetBlock extends VanillaCommandWrapper { 11 | // setblock [dataValue] [oldBlockHandling] [dataTag] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "setblock", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SpawnPoint.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.SPAWNPOINT$OTHER; 7 | 8 | /** 9 | * SetSpawnPoint command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class SpawnPoint extends VanillaCommandWrapper { 14 | // spawnpoint [player [ ]] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (parameters.length > 0) { 19 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(SPAWNPOINT$OTHER)) { 20 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 21 | return; 22 | } 23 | } 24 | passOn(caller, "spawnpoint", parameters); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/SpreadPlayers.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * SpreadPlayers command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class SpreadPlayers extends VanillaCommandWrapper { 11 | // spreadplayers 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "spreadplayers", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Stats.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Stats command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Stats extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "stats", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Summon.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Summon command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Summon extends VanillaCommandWrapper { 11 | // summon [x] [y] [z] [dataTag] | "mobspawn", "mspawn", "spawnmob" 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "summon", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/TestFor.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * TestFor command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class TestFor extends VanillaCommandWrapper { 11 | // testfor 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "testfor", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/TestForBlock.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * TestForBlock command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class TestForBlock extends VanillaCommandWrapper { 11 | // testforblock [dataValue] [dataTag] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "testforblock", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/TestForBlocks.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * TestForBlocks command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class TestForBlocks extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "testforblocks", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Time.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Time command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Time extends VanillaCommandWrapper { 11 | // time 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "time", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Title.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Title command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Title extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "title", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/ToggleDownfall.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * ToggleDownfall command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class ToggleDownfall extends VanillaCommandWrapper { 11 | 12 | @Override 13 | public void execute(MessageReceiver caller, String[] parameters) { 14 | passOn(caller, "toggledownfall", parameters); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Trigger.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Trigger command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class Trigger extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "trigger", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/Weather.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Weather command wrapper 7 | * 8 | * @author Jason Jones (darkdiplomat) 9 | */ 10 | public final class Weather extends VanillaCommandWrapper { 11 | // weather [duration in seconds] 12 | 13 | @Override 14 | public void execute(MessageReceiver caller, String[] parameters) { 15 | passOn(caller, "weather", parameters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/WorldBorder.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * WorldBorder command wrapper 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public final class WorldBorder extends VanillaCommandWrapper { 11 | @Override 12 | public void execute(MessageReceiver caller, String[] parameters) { 13 | passOn(caller, "worldborder", parameters); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/vanilla/XP.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.vanilla; 2 | 3 | import net.canarymod.Translator; 4 | import net.canarymod.chat.MessageReceiver; 5 | 6 | import static net.canarymod.commandsys.CanaryCommandPermissions.XP$OTHER; 7 | 8 | /** 9 | * XP command wrapper 10 | * 11 | * @author Jason Jones (darkdiplomat) 12 | */ 13 | public final class XP extends VanillaCommandWrapper { 14 | // xp [player] 15 | 16 | @Override 17 | public void execute(MessageReceiver caller, String[] parameters) { 18 | if (parameters.length > 1) { 19 | if (isNotSelfOrServer(caller, parameters[0]) && !caller.hasPermission(XP$OTHER)) { 20 | caller.notice(Translator.nativeTranslate("commands.generic.permission")); 21 | return; 22 | } 23 | } 24 | passOn(caller, "xp", parameters); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/commandsys/commands/warp/WarpRemove.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.commandsys.commands.warp; 2 | 3 | import net.canarymod.Canary; 4 | import net.canarymod.chat.ChatFormat; 5 | import net.canarymod.chat.MessageReceiver; 6 | import net.canarymod.commandsys.NativeCommand; 7 | import net.canarymod.warp.Warp; 8 | 9 | import static net.canarymod.Translator.sendTranslatedMessage; 10 | import static net.canarymod.Translator.sendTranslatedNotice; 11 | 12 | /** 13 | * Command to remove a warp 14 | * 15 | * @author Chris (damagefilter) 16 | */ 17 | public class WarpRemove implements NativeCommand { 18 | public void execute(MessageReceiver caller, String[] args) { 19 | if (Canary.warps().warpExists(args[0])) { 20 | Warp target = Canary.warps().getWarp(args[0]); 21 | Canary.warps().removeWarp(target); 22 | sendTranslatedMessage(caller, ChatFormat.YELLOW, "warp removed", target.getName()); 23 | } 24 | else { 25 | sendTranslatedNotice(caller, "warp unknown", args[0]); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/config/ConfigurationContainer.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.config; 2 | 3 | import net.visualillusionsent.utils.PropertiesFile; 4 | 5 | /** 6 | * This is an access container for ConfigurationFile objects 7 | * to make access more convenient 8 | * 9 | * @author Chris Ksoll 10 | */ 11 | public interface ConfigurationContainer { 12 | 13 | /** 14 | * Reloads the configuration 15 | */ 16 | void reload(); 17 | 18 | /** 19 | * Get the configuration file 20 | * 21 | * @return ConfigurationFile 22 | */ 23 | PropertiesFile getFile(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/LocationDataAccess.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database; 2 | 3 | /** 4 | * Location assistant DataAccess object 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public abstract class LocationDataAccess extends PositionDataAccess { 9 | 10 | public LocationDataAccess(String tableName) { 11 | super(tableName); 12 | } 13 | 14 | public LocationDataAccess(String tableName, String tableSuffix) { 15 | super(tableName, tableSuffix); 16 | } 17 | 18 | // X Y Z from PositionDataAccess 19 | @Column(columnName = "rotation", notNull = true, dataType = Column.DataType.FLOAT) 20 | public float rotation = 0; 21 | 22 | @Column(columnName = "pitch", notNull = true, dataType = Column.DataType.FLOAT) 23 | public float pitch = 0; 24 | 25 | @Column(columnName = "world", notNull = true, dataType = Column.DataType.STRING) 26 | public String world = "default"; 27 | 28 | @Column(columnName = "dimension", notNull = true, dataType = Column.DataType.STRING) 29 | public String dimension = "NORMAL"; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/PositionDataAccess.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database; 2 | 3 | /** 4 | * Position assistant DataAccess object 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public abstract class PositionDataAccess extends DataAccess { 9 | 10 | public PositionDataAccess(String tableName) { 11 | super(tableName); 12 | } 13 | 14 | public PositionDataAccess(String tableName, String tableSuffix) { 15 | super(tableName, tableSuffix); 16 | } 17 | 18 | // Absolute out of world defaults used 19 | @Column(columnName = "posX", notNull = true, dataType = Column.DataType.DOUBLE) 20 | public double posX = 0; 21 | 22 | @Column(columnName = "posY", notNull = true, dataType = Column.DataType.DOUBLE) 23 | public double posY = 0; 24 | 25 | @Column(columnName = "posZ", notNull = true, dataType = Column.DataType.DOUBLE) 26 | public double posZ = 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/exceptions/DatabaseAccessException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database.exceptions; 2 | 3 | /** 4 | * Thrown when there is an error accessing the database 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class DatabaseAccessException extends Exception { 9 | 10 | private static final long serialVersionUID = -6274875008612771399L; 11 | 12 | public DatabaseAccessException(String str) { 13 | super(str); 14 | } 15 | 16 | public DatabaseAccessException(String str, Throwable t) { 17 | super(str, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/exceptions/DatabaseException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database.exceptions; 2 | 3 | /** 4 | * Thrown when trying to register an already registered database 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class DatabaseException extends Exception { 9 | 10 | private static final long serialVersionUID = -6274875008612771399L; 11 | 12 | public DatabaseException(String str) { 13 | super(str); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/exceptions/DatabaseReadException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database.exceptions; 2 | 3 | /** 4 | * Thrown when trying to read data from the database and there is an error 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class DatabaseReadException extends Exception { 9 | 10 | private static final long serialVersionUID = -6274875008612771399L; 11 | 12 | public DatabaseReadException(String str) { 13 | super(str); 14 | } 15 | 16 | public DatabaseReadException(String str, Throwable t) { 17 | super(str, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/exceptions/DatabaseTableInconsistencyException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database.exceptions; 2 | 3 | /** 4 | * Thrown when data is inconsistant, this often occours when you make a mistake 5 | * in your @Column fields. 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class DatabaseTableInconsistencyException extends Exception { 10 | 11 | private static final long serialVersionUID = -6274875008612771399L; 12 | 13 | public DatabaseTableInconsistencyException(String str) { 14 | super(str); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/database/exceptions/DatabaseWriteException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.database.exceptions; 2 | 3 | /** 4 | * Thrown when trying to write data to the database and there is an error 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public class DatabaseWriteException extends Exception { 9 | 10 | private static final long serialVersionUID = -6274875008612771399L; 11 | 12 | public DatabaseWriteException(String str) { 13 | super(str); 14 | } 15 | 16 | public DatabaseWriteException(String str, Throwable t) { 17 | super(str, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/exceptions/InvalidInstanceException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.exceptions; 2 | 3 | /** 4 | * Indicates a interface casting is invalid. See message and cause for more information. 5 | * 6 | * @author Jason Jones (darkdiplomat) 7 | */ 8 | public class InvalidInstanceException extends RuntimeException { 9 | public InvalidInstanceException() { 10 | } 11 | 12 | public InvalidInstanceException(String message) { 13 | super(message); 14 | } 15 | 16 | public InvalidInstanceException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public InvalidInstanceException(Throwable cause) { 21 | super(cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/exceptions/InvalidPluginException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.exceptions; 2 | 3 | /** 4 | * Indicates a plugin is invalid. See message and cause for more information. 5 | * 6 | * @author Pwoootage 7 | */ 8 | public class InvalidPluginException extends Exception { 9 | public InvalidPluginException() { 10 | } 11 | 12 | public InvalidPluginException(String message) { 13 | super(message); 14 | } 15 | 16 | public InvalidPluginException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public InvalidPluginException(Throwable cause) { 21 | super(cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/exceptions/PluginDependencyException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.exceptions; 2 | 3 | /** 4 | * Indicates that a plugin is missing some dependencies. See message for more information. 5 | * 6 | * @author Pwootage 7 | */ 8 | public class PluginDependencyException extends Exception { 9 | public PluginDependencyException() { 10 | } 11 | 12 | public PluginDependencyException(String message) { 13 | super(message); 14 | } 15 | 16 | public PluginDependencyException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public PluginDependencyException(Throwable cause) { 21 | super(cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/exceptions/PluginLoadFailedException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.exceptions; 2 | 3 | /** 4 | * Indicates that a plugin has failed to load. Look at cause for more information. 5 | * 6 | * @author Pwootage 7 | */ 8 | public class PluginLoadFailedException extends Exception { 9 | public PluginLoadFailedException() { 10 | } 11 | 12 | public PluginLoadFailedException(String message) { 13 | super(message); 14 | } 15 | 16 | public PluginLoadFailedException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public PluginLoadFailedException(Throwable cause) { 21 | super(cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/CancelableHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook; 2 | 3 | /** 4 | * A cancelable hook. The calling chain will be broken once this hook has been 5 | * set as cancelled and its current state will be returned to the system. 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public abstract class CancelableHook extends Hook { 10 | protected boolean isCanceled = false; 11 | 12 | public void setCanceled() { 13 | isCanceled = true; 14 | } 15 | 16 | public boolean isCanceled() { 17 | return isCanceled; 18 | } 19 | 20 | /** 21 | * Calls a Hook if not already executed 22 | * 23 | * @return this 24 | */ 25 | public CancelableHook call() { 26 | return (CancelableHook)super.call(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/Dispatcher.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook; 2 | 3 | import net.canarymod.plugin.Plugin; 4 | import net.canarymod.plugin.PluginListener; 5 | import net.canarymod.plugin.Priority; 6 | 7 | /** 8 | * This class invokes a method on a listener. 9 | * It is inline-implemented in {@link HookExecutor#registerHook(PluginListener, Plugin, Class, Dispatcher, Priority)}, 10 | * for each hook separately. 11 | * 12 | * @author Chris (damagefilter) 13 | */ 14 | public abstract class Dispatcher { 15 | public boolean ignoreCanceled; 16 | 17 | public abstract void execute(PluginListener listener, Hook hook); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/HookConsistencyException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook; 2 | 3 | /** 4 | * Thrown when a hook can not be passed to a listener due to the method 5 | * signature being incorrect 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class HookConsistencyException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 5665326099228188167L; 12 | 13 | public HookConsistencyException(String message) { 14 | super(message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/HookExecutionException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook; 2 | 3 | /** 4 | * Thrown when an exception propagates up to the hook dispatcher 5 | * The exception is wrapped in this exception 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class HookExecutionException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 5665326099228188167L; 12 | 13 | public HookExecutionException(String message) { 14 | super(message); 15 | } 16 | 17 | public HookExecutionException(String msg, Throwable t) { 18 | super(msg, t); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/HookHandler.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook; 2 | 3 | import net.canarymod.plugin.Priority; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * Annotation to define a method that listens on a hook. 12 | * 13 | * @author Chris (damagefilter) 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target(ElementType.METHOD) 17 | public @interface HookHandler { 18 | Priority priority() default Priority.NORMAL; 19 | 20 | boolean ignoreCanceled() default false; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/EntityDespawnHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Entity despawn hook. Contains information about an entity despawning. 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public final class EntityDespawnHook extends CancelableHook { 12 | 13 | private Entity entity; 14 | 15 | public EntityDespawnHook(Entity entity) { 16 | this.entity = entity; 17 | } 18 | 19 | /** 20 | * Gets the {@link Entity} despawning 21 | * 22 | * @return the {@link Entity} despawning 23 | */ 24 | public Entity getEntity() { 25 | return entity; 26 | } 27 | 28 | @Override 29 | public final String toString() { 30 | return String.format("%s[Entity=%s]", getHookName(), entity); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/EntitySpawnHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.Entity; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Entity spawn hook. Contains information about an entity spawning. 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public final class EntitySpawnHook extends CancelableHook { 12 | 13 | private Entity entity; 14 | 15 | public EntitySpawnHook(Entity entity) { 16 | this.entity = entity; 17 | } 18 | 19 | /** 20 | * Gets the {@link Entity} spawning 21 | * 22 | * @return {@link Entity} 23 | */ 24 | public Entity getEntity() { 25 | return entity; 26 | } 27 | 28 | @Override 29 | public final String toString() { 30 | return String.format("%s[Entity=%s]", getHookName(), entity); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/ItemTouchGroundHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.EntityItem; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * ItemTouchGroundHook
8 | * Called when an {@link EntityItem} hits the ground 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public class ItemTouchGroundHook extends CancelableHook { 13 | private EntityItem item; 14 | 15 | /** 16 | * Constructs a new ItemTouchGroundHook 17 | * 18 | * @param item 19 | * the {@link EntityItem} hitting the ground 20 | */ 21 | public ItemTouchGroundHook(EntityItem item) { 22 | this.item = item; 23 | } 24 | 25 | /** 26 | * Gets the {@link EntityItem} hitting the ground 27 | * 28 | * @return the {@link EntityItem} 29 | */ 30 | public EntityItem getEntityItem() { 31 | return item; 32 | } 33 | 34 | @Override 35 | public final String toString() { 36 | return String.format("%s[EntityItem=%s]", getHookName(), item); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/VehicleDestroyHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.vehicle.Vehicle; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * VehicleDestoryHook
8 | * Called when a Minecart or Boat is destroyed 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public class VehicleDestroyHook extends Hook { 13 | private Vehicle vehicle; 14 | 15 | public VehicleDestroyHook(Vehicle vehicle) { 16 | this.vehicle = vehicle; 17 | } 18 | 19 | /** 20 | * The {@link Vehicle} being destoryed 21 | * 22 | * @return the {@link Vehicle} 23 | */ 24 | public Vehicle getVehicle() { 25 | return vehicle; 26 | } 27 | 28 | @Override 29 | public final String toString() { 30 | return String.format("%s[Vehicle=%s]", getHookName(), vehicle); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/VehicleEnterHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.living.LivingBase; 4 | import net.canarymod.api.entity.vehicle.Vehicle; 5 | import net.canarymod.hook.CancelableHook; 6 | 7 | /** 8 | * Is called when a LivingEntity enters a vehicle 9 | * 10 | * @author Chris (damagefilter) 11 | */ 12 | public final class VehicleEnterHook extends CancelableHook { 13 | private Vehicle vehicle; 14 | private LivingBase enteringEntity; 15 | 16 | public VehicleEnterHook(Vehicle vehicle, LivingBase entity) { 17 | this.vehicle = vehicle; 18 | this.enteringEntity = entity; 19 | } 20 | 21 | /** 22 | * @return the vehicle 23 | */ 24 | public Vehicle getVehicle() { 25 | return vehicle; 26 | } 27 | 28 | /** 29 | * @return the enteringEntity 30 | */ 31 | public LivingBase getEntity() { 32 | return enteringEntity; 33 | } 34 | 35 | @Override 36 | public final String toString() { 37 | return String.format("%s[Vehicle=%s, Entity=%s]", getHookName(), vehicle, enteringEntity); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/entity/VehicleExitHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.entity; 2 | 3 | import net.canarymod.api.entity.living.LivingBase; 4 | import net.canarymod.api.entity.vehicle.Vehicle; 5 | import net.canarymod.hook.CancelableHook; 6 | 7 | /** 8 | * Is called when a LivingEntity exits a vehicle 9 | * 10 | * @author Chris (damagefilter) 11 | */ 12 | public final class VehicleExitHook extends CancelableHook { 13 | private Vehicle vehicle; 14 | private LivingBase enteringEntity; 15 | 16 | public VehicleExitHook(Vehicle vehicle, LivingBase entity) { 17 | this.vehicle = vehicle; 18 | this.enteringEntity = entity; 19 | } 20 | 21 | /** 22 | * @return the vehicle 23 | */ 24 | public Vehicle getVehicle() { 25 | return vehicle; 26 | } 27 | 28 | /** 29 | * @return the enteringEntity 30 | */ 31 | public LivingBase getEntity() { 32 | return enteringEntity; 33 | } 34 | 35 | @Override 36 | public final String toString() { 37 | return String.format("%s[Vehicle=%s, Entity=%s]", getHookName(), vehicle, enteringEntity); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/player/LevelUpHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.player; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Player; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * LevelUp hook. Called when a {@link Player} levels up 8 | * 9 | * @author Chris (damagefilter) 10 | */ 11 | public final class LevelUpHook extends Hook { 12 | private Player player; 13 | 14 | public LevelUpHook(Player player) { 15 | this.player = player; 16 | } 17 | 18 | /** 19 | * Get the {@link Player} instance 20 | * 21 | * @return the {@link Player} leveling up 22 | */ 23 | public Player getPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public final String toString() { 29 | return String.format("%s[Player=%s]", getHookName(), player); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/player/PlayerArmSwingHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.player; 2 | 3 | import net.canarymod.api.entity.living.humanoid.Player; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * Player Left Click Hook
8 | * Called when a {@link Player} swings their arm with a Left Click 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public class PlayerArmSwingHook extends Hook { 13 | private Player player; 14 | 15 | public PlayerArmSwingHook(Player player) { 16 | this.player = player; 17 | } 18 | 19 | /** 20 | * Gets the {@link Player} clicking 21 | * 22 | * @return the {@link Player} 23 | */ 24 | public Player getPlayer() { 25 | return player; 26 | } 27 | 28 | @Override 29 | public final String toString() { 30 | return String.format("%s[Player=%s]", getHookName(), player); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/LoadWorldHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.api.world.World; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * Load World Hook 8 | *

9 | * Called when a {@link World} is loaded and initialized 10 | * 11 | * @author Jason (darkdiplomat) 12 | */ 13 | public final class LoadWorldHook extends Hook { 14 | private final World world; 15 | 16 | public LoadWorldHook(World world) { 17 | this.world = world; 18 | } 19 | 20 | /** 21 | * Gets the {@link World} that has loaded 22 | * 23 | * @return the {@link World} that loaded 24 | */ 25 | public World getWorld() { 26 | return world; 27 | } 28 | 29 | /** 30 | * {@inheritDoc} 31 | */ 32 | @Override 33 | public String toString() { 34 | return String.format("%s[World=%s]", getHookName(), world); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/PluginDisableHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.hook.Hook; 4 | import net.canarymod.plugin.Plugin; 5 | 6 | /** 7 | * Called when a plugin is disabled 8 | * 9 | * @author greatman 10 | */ 11 | public final class PluginDisableHook extends Hook { 12 | 13 | private Plugin plugin; 14 | 15 | public PluginDisableHook(Plugin plugin) { 16 | this.plugin = plugin; 17 | } 18 | 19 | /** 20 | * Retrieve the plugin that is disabled 21 | * 22 | * @return The plugin that is disabled 23 | */ 24 | public Plugin getPlugin() { 25 | return plugin; 26 | } 27 | 28 | public final String toString() { 29 | return String.format("%s[Plugin=%s]", getHookName(), plugin); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/PluginEnableHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.hook.Hook; 4 | import net.canarymod.plugin.Plugin; 5 | 6 | /** 7 | * Called when a plugin is enabled. 8 | * 9 | * @author greatman 10 | */ 11 | public class PluginEnableHook extends Hook { 12 | 13 | private Plugin plugin; 14 | 15 | public PluginEnableHook(Plugin plugin) { 16 | this.plugin = plugin; 17 | } 18 | 19 | /** 20 | * Retrieve the plugin that is enabled 21 | * 22 | * @return The plugin that is enabled 23 | */ 24 | public Plugin getPlugin() { 25 | return plugin; 26 | } 27 | 28 | public final String toString() { 29 | return String.format("%s[Plugin=%s]", getHookName(), plugin); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/ServerGuiStartHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.api.gui.GUIControl; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * Called when a GUI is started 8 | * 9 | * @author Larry (Larry1123) 10 | */ 11 | public class ServerGuiStartHook extends Hook { 12 | 13 | private GUIControl gui; 14 | 15 | public ServerGuiStartHook(GUIControl gui) { 16 | this.setGui(gui); 17 | } 18 | 19 | public GUIControl getGui() { 20 | return gui; 21 | } 22 | 23 | public void setGui(GUIControl gui) { 24 | this.gui = gui; 25 | } 26 | 27 | public final String toString() { 28 | return String.format("%s[GUI=%s]", getHookName(), gui); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/ServerShutdownHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.hook.Hook; 4 | 5 | /** 6 | * Server shutdown hook. Contains information about the reason the server is 7 | * shutting down 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public final class ServerShutdownHook extends Hook { 12 | 13 | private String reason; 14 | 15 | public ServerShutdownHook(String reason) { 16 | this.reason = reason; 17 | } 18 | 19 | /** 20 | * Get the reason for disconnect (if applicable) 21 | * 22 | * @return reason if disconnecting, null otherwise 23 | */ 24 | public String getReason() { 25 | return reason; 26 | } 27 | 28 | /** 29 | * Set the reason for disconnection that will be displayed 30 | * 31 | * @param reason 32 | */ 33 | public void setReason(String reason) { 34 | this.reason = reason; 35 | } 36 | 37 | @Override 38 | public final String toString() { 39 | return String.format("%s[Reason=%s]", getHookName(), reason); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/ServerTickHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.hook.Hook; 4 | 5 | /** 6 | * Called in the servers tick loop, before world processing. 7 | * For informational use 8 | * 9 | * @author Chris (damagefilter) 10 | */ 11 | public final class ServerTickHook extends Hook { 12 | private long deltaTime; 13 | 14 | public ServerTickHook(long deltaTime) { 15 | this.deltaTime = deltaTime; 16 | } 17 | 18 | /** 19 | * @return the deltaTime 20 | */ 21 | public long getDeltaTime() { 22 | return deltaTime; 23 | } 24 | 25 | /** 26 | * @param deltaTime 27 | * the deltaTime to set 28 | */ 29 | public void setDeltaTime(long deltaTime) { 30 | this.deltaTime = deltaTime; 31 | } 32 | 33 | @Override 34 | public final String toString() { 35 | return String.format("%s[DeltaTime=%d]", getHookName(), deltaTime); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/system/UnloadWorldHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.system; 2 | 3 | import net.canarymod.api.world.World; 4 | import net.canarymod.hook.Hook; 5 | 6 | /** 7 | * Called before a world is unloaded.
8 | * Before a world is unloaded, it will be saved! 9 | * After a world is unloaded it will not be processed in the tick loop anymore. 10 | * A world can not be unloaded if it still has players on it. 11 | * For informational use - to give plugins a chance to null their references to that world, if they have any. 12 | * 13 | * @author Chris (damagefilter) 14 | */ 15 | public final class UnloadWorldHook extends Hook { 16 | 17 | private World world; 18 | 19 | public UnloadWorldHook(World world) { 20 | this.world = world; 21 | } 22 | 23 | /** 24 | * Returns the world that is about to be unloaded 25 | * 26 | * @return the world 27 | */ 28 | public World getWorld() { 29 | return world; 30 | } 31 | 32 | @Override 33 | public final String toString() { 34 | return "UnloadWorldHook[World=" + world.getFqName() + "]"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/BlockGrowHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Called when a block "grows" 8 | * 9 | * @author Jason Jones (darkdiplomat) 10 | */ 11 | public class BlockGrowHook extends CancelableHook { 12 | private final Block original, growth; 13 | 14 | public BlockGrowHook(Block original, Block growth) { 15 | this.original = original; 16 | this.growth = growth; 17 | } 18 | 19 | public Block getOriginal() { 20 | return original; 21 | } 22 | 23 | public Block getGrowth() { 24 | return growth; 25 | } 26 | 27 | public String toString() { 28 | return String.format("%s[Original: %s, Growth: %s]", getHookName(), original, growth); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/ChunkCreatedHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.Chunk; 4 | import net.canarymod.api.world.World; 5 | import net.canarymod.hook.Hook; 6 | 7 | /** 8 | * Chunk created hook 9 | * 10 | * @author Chris (damagefilter) 11 | */ 12 | public final class ChunkCreatedHook extends Hook { 13 | 14 | private World world; 15 | private Chunk chunk; 16 | 17 | public ChunkCreatedHook(Chunk chunk, World world) { 18 | this.world = world; 19 | this.chunk = chunk; 20 | } 21 | 22 | /** 23 | * Gets the {@link Chunk} 24 | * 25 | * @return {@link Chunk} created. 26 | */ 27 | public Chunk getChunk() { 28 | return chunk; 29 | } 30 | 31 | /** 32 | * Gets the world that this chunk is a part of. 33 | * 34 | * @return the {@link World} 35 | */ 36 | public World getWorld() { 37 | return world; 38 | } 39 | 40 | @Override 41 | public final String toString() { 42 | return String.format("%s[Chunk=%s, World=%s]", getHookName(), chunk, world); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/ChunkUnloadHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.Chunk; 4 | import net.canarymod.api.world.World; 5 | import net.canarymod.hook.CancelableHook; 6 | 7 | /** 8 | * Chunk unload hook 9 | * 10 | * @author Chris (damagefilter) 11 | */ 12 | public final class ChunkUnloadHook extends CancelableHook { 13 | 14 | private World world; 15 | private Chunk chunk; 16 | 17 | public ChunkUnloadHook(Chunk chunk, World world) { 18 | this.world = world; 19 | this.chunk = chunk; 20 | } 21 | 22 | /** 23 | * Gets the {@link Chunk} 24 | * 25 | * @return The {@link Chunk}. 26 | */ 27 | public Chunk getChunk() { 28 | return chunk; 29 | } 30 | 31 | /** 32 | * Gets the world this chunk is a part of. 33 | * 34 | * @return the world 35 | */ 36 | public World getWorld() { 37 | return world; 38 | } 39 | 40 | @Override 41 | public final String toString() { 42 | return String.format("%s[World=%s, Chunk=%s]", getHookName(), world, chunk); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/FireworkExplodeHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.entity.FireworkRocket; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * FireworkExplodeHook 8 | *

9 | * Called when a Firework Rocket is to explode 10 | * 11 | * @author Jason (darkdiplomat) 12 | */ 13 | public final class FireworkExplodeHook extends CancelableHook { 14 | private FireworkRocket rocket; 15 | 16 | /** 17 | * Constructs a new FireworkExplodeHook 18 | * 19 | * @param rocket 20 | * the {@link FireworkRocket} to explode 21 | */ 22 | public FireworkExplodeHook(FireworkRocket rocket) { 23 | this.rocket = rocket; 24 | } 25 | 26 | /** 27 | * Gets the {@link FireworkRocket} set to explode 28 | * 29 | * @return the {@link FireworkRocket} 30 | */ 31 | public FireworkRocket getFireworkRocket() { 32 | return rocket; 33 | } 34 | 35 | @Override 36 | public final String toString() { 37 | return String.format("%s[FireworkRocket=%s]", getHookName(), rocket); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/FlowHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Flow hook. Contains information about a liquid flowing from one block to another 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public final class FlowHook extends CancelableHook { 12 | 13 | private Block from, to; 14 | 15 | public FlowHook(Block from, Block to) { 16 | this.from = from; 17 | this.to = to; 18 | } 19 | 20 | /** 21 | * Gets the {@link Block} flowing from 22 | * 23 | * @return the {@link Block} 24 | */ 25 | public Block getBlockFrom() { 26 | return from; 27 | } 28 | 29 | /** 30 | * Gets the {@link Block} flowing to 31 | * 32 | * @return the {@link Block} 33 | */ 34 | public Block getBlockTo() { 35 | return to; 36 | } 37 | 38 | @Override 39 | public final String toString() { 40 | return String.format("%s[Block To=%s, Block From=%s]", getHookName(), to, from); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/LeafDecayHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Block update hook. Contains information about a block updating. 8 | * 9 | * @author Jason (darkdiplomat) 10 | */ 11 | public final class LeafDecayHook extends CancelableHook { 12 | 13 | private Block block; 14 | 15 | public LeafDecayHook(Block block) { 16 | this.block = block; 17 | } 18 | 19 | /** 20 | * Get the leaf block that is about to decay 21 | * 22 | * @return the {@link Block} of leaves 23 | */ 24 | public Block getBlock() { 25 | return block; 26 | } 27 | 28 | @Override 29 | public final String toString() { 30 | return String.format("%s[Block=%s]", getHookName(), block); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/PistonExtendHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Piston Extend Hook
8 | * Called when a Piston extends 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public final class PistonExtendHook extends CancelableHook { 13 | 14 | private Block piston, moving; 15 | 16 | public PistonExtendHook(Block piston, Block moving) { 17 | this.piston = piston; 18 | this.moving = moving; 19 | } 20 | 21 | /** 22 | * Gets the piston {@link Block} 23 | * 24 | * @return piston 25 | */ 26 | public Block getPiston() { 27 | return piston; 28 | } 29 | 30 | /** 31 | * Gets the {@link Block} the piston is pushing/pulling 32 | * 33 | * @return {@link Block} 34 | */ 35 | public Block getMoving() { 36 | return moving; 37 | } 38 | 39 | @Override 40 | public final String toString() { 41 | return String.format("%s[Piston=%s, Block=%s]", getHookName(), piston, moving); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/PistonRetractHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Piston Retract hook
8 | * Called when a piston retracts 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | public final class PistonRetractHook extends CancelableHook { 13 | 14 | private Block piston, moving; 15 | 16 | public PistonRetractHook(Block piston, Block moving) { 17 | this.piston = piston; 18 | this.moving = moving; 19 | } 20 | 21 | /** 22 | * Gets the piston {@link Block} 23 | * 24 | * @return piston 25 | */ 26 | public Block getPiston() { 27 | return piston; 28 | } 29 | 30 | /** 31 | * Gets the {@link Block} the piston is pushing/pulling 32 | * 33 | * @return the {@link Block} 34 | */ 35 | public Block getMoving() { 36 | return moving; 37 | } 38 | 39 | @Override 40 | public final String toString() { 41 | return String.format("%s[Piston=%s, Moving=%s]", getHookName(), piston, moving); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/hook/world/TreeGrowHook.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.hook.world; 2 | 3 | import net.canarymod.api.world.blocks.Block; 4 | import net.canarymod.hook.CancelableHook; 5 | 6 | /** 7 | * Tree Grow Hook 8 | *

9 | * Called with a sapling attempts to become a Tree
10 | * This does not signal that a tree can grow or how it would grow. 11 | * 12 | * @author Jason (darkdiplomat) 13 | */ 14 | public final class TreeGrowHook extends CancelableHook { 15 | private Block sapling; 16 | 17 | /** 18 | * Constructs a new TreeGrowHook 19 | * 20 | * @param sapling 21 | * the sapling trying to grow 22 | */ 23 | public TreeGrowHook(Block sapling) { 24 | this.sapling = sapling; 25 | } 26 | 27 | /** 28 | * Gets the sapling trying to grow 29 | * 30 | * @return the sapling 31 | */ 32 | public Block getSapling() { 33 | return sapling; 34 | } 35 | 36 | /** 37 | * {@inheritDoc} 38 | */ 39 | public final String toString() { 40 | return String.format("%s[Sapling=%s]", getHookName(), sapling); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/metrics/CanaryMetrics.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.metrics; 2 | 3 | import net.canarymod.Canary; 4 | import org.mcstats.Metrics; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | 9 | /** 10 | * Canary implementation of Metrics 11 | * 12 | * @author Jason Jones (darkdiplomat) 13 | */ 14 | public final class CanaryMetrics extends Metrics { 15 | private static final File CONFIG_FILE = new File("config/metrics.cfg"); 16 | 17 | private final String fsv = String.format("%s %s (MC: %s)", Canary.getSpecificationTitle(), Canary.getSpecificationVersion(), Canary.getServer().getServerVersion()); 18 | 19 | public CanaryMetrics(String pluginName, String pluginVersion) throws IOException { 20 | super(pluginName, pluginVersion); 21 | } 22 | 23 | @Override 24 | public final String getFullServerVersion() { 25 | return fsv; 26 | } 27 | 28 | @Override 29 | public final int getPlayersOnline() { 30 | return Canary.getServer().getNumPlayersOnline(); 31 | } 32 | 33 | @Override 34 | public File getConfigFile() { 35 | return CONFIG_FILE; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/motd/MOTDKey.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.motd; 2 | 3 | import net.canarymod.plugin.Plugin; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.Target; 7 | 8 | import static java.lang.annotation.ElementType.METHOD; 9 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 10 | 11 | /** 12 | * The {@link Plugin} {@link net.canarymod.motd.MessageOfTheDay} key/value replacement @interface. 13 | * 14 | * @author Jason (darkdiplomat) 15 | */ 16 | @Retention(RUNTIME) 17 | @Target(METHOD) 18 | public @interface MOTDKey { 19 | 20 | /** 21 | * The key to be replaced in the MessageOfTheDay (ie: {name} ) 22 | * 23 | * @return the key to be replaced 24 | */ 25 | String key(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/motd/MOTDOwner.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.motd; 2 | 3 | /** 4 | * Message Of The Day Owner interface

5 | * Used to associate either the Server or a Plugin as the owner of a MOTDListener 6 | * 7 | * @author Jason (darkdiplomat) 8 | */ 9 | public interface MOTDOwner { 10 | 11 | String getName(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/motd/MOTDParser.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.motd; 2 | 3 | import net.canarymod.chat.MessageReceiver; 4 | 5 | /** 6 | * Message Of The Day parser

7 | * Calls the logic of the key to be replaced

8 | * *INTERNAL USE* 9 | * 10 | * @author Jason (darkdiplomat) 11 | */ 12 | abstract class MOTDParser { 13 | private final String key; 14 | private final MOTDOwner owner; 15 | 16 | MOTDParser(String key, MOTDOwner owner) { 17 | this.key = key; 18 | this.owner = owner; 19 | } 20 | 21 | final String key() { 22 | return key; 23 | } 24 | 25 | final MOTDOwner getOwner() { 26 | return owner; 27 | } 28 | 29 | abstract String parse(MessageReceiver receiver) throws Exception; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/motd/MessageOfTheDayListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.motd; 2 | 3 | /** 4 | * Plugin Message Of The Day Listener 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public interface MessageOfTheDayListener { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/PluginException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin; 2 | 3 | /* 4 | * Thrown when an exception occurs in a plugin. The exception is wrapped 5 | * in this exception. // TODO Correct? 6 | * 7 | * @author Chris (damagefilter) 8 | */ 9 | public class PluginException extends RuntimeException { 10 | private static final long serialVersionUID = -8544875171002713131L; 11 | 12 | public PluginException(String str) { 13 | super(str); 14 | } 15 | 16 | public PluginException(String msg, Throwable t) { 17 | super(msg, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/PluginLifecycle.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin; 2 | 3 | import net.canarymod.exceptions.PluginLoadFailedException; 4 | 5 | /** 6 | * Defines lifecycle methods for a plugin - load, enable, disable. Implemented by individual {@link PluginManager}s 7 | * 8 | * @author Pwootage 9 | */ 10 | public interface PluginLifecycle { 11 | /** 12 | * Enables the plugin. 13 | * 14 | * @return {@code true} if successfully enabled, {@code false} otherwise. 15 | */ 16 | boolean enable(); 17 | 18 | /** 19 | * Disables the plugin. 20 | * 21 | * @return {@code true} if successfully disabled, {@code false} otherwise. 22 | */ 23 | boolean disable(); 24 | 25 | /** 26 | * Loads the {@link Plugin}. 27 | * 28 | * @return Newly loaded plugin. 29 | * 30 | * @throws PluginLoadFailedException 31 | * If an error occurred loading the plugin. 32 | */ 33 | Plugin load() throws PluginLoadFailedException; 34 | 35 | /** 36 | * Unloads the plugin. 37 | */ 38 | void unload(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/PluginListener.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin; 2 | 3 | /** 4 | * Plugin listener. Plugins can implement this to listen to specific events 5 | * 6 | * @author Chris (damagefilter) 7 | * @author Jason (darkdiplomat) 8 | */ 9 | public interface PluginListener { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/PluginState.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin; 2 | 3 | /** 4 | * Indicates a plugin's current state. 5 | * 6 | * @author Pwootage 7 | */ 8 | public enum PluginState { 9 | /** 10 | * Indicates the plugin is known, but not yet loaded 11 | */ 12 | KNOWN, 13 | /** 14 | * Indicates the plugin is loaded and enabled 15 | */ 16 | ENABLED, 17 | /** 18 | * Inidcates the plugin is loaded and disabled 19 | */ 20 | DISABLED 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/Priority.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin; 2 | 3 | /** 4 | * The Plugin Priority or "Execution order" 5 | * 6 | * @author Chris (damagefilter) 7 | */ 8 | public enum Priority { 9 | 10 | /** 11 | * For Plugins that monitor actions but do not interfere 12 | */ 13 | PASSIVE(100), 14 | /** 15 | * Low level stuff like process player walking etc. 16 | */ 17 | LOW(300), 18 | /** 19 | * Preferred Priority. This is the usual thing for blocking/altering actions 20 | */ 21 | NORMAL(500), 22 | /** 23 | * Executed after critical. 24 | */ 25 | HIGH(700), 26 | /** 27 | * Extremely critical. Will be executed as the very first Plugin. 28 | */ 29 | CRITICAL(900); 30 | 31 | final int value; 32 | 33 | Priority(int priority) { 34 | this.value = priority; 35 | } 36 | 37 | public int getPriorityValue() { 38 | return this.value; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/plugin/lifecycle/InvalidPluginLifecycleException.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.plugin.lifecycle; 2 | 3 | /** 4 | * Indicates a plugin lifecycle is invalid. See message and cause for more information. 5 | * 6 | * @author Jason (darkdiplomat) 7 | */ 8 | public class InvalidPluginLifecycleException extends Exception { 9 | public InvalidPluginLifecycleException() { 10 | } 11 | 12 | public InvalidPluginLifecycleException(String message) { 13 | super(message); 14 | } 15 | 16 | public InvalidPluginLifecycleException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public InvalidPluginLifecycleException(Throwable cause) { 21 | super(cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/tasks/TaskOwner.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.tasks; 2 | 3 | /** 4 | * Interface for defining a {@link ServerTask} owner 5 | *

6 | * Has no other use outside of the {@link ServerTask} 7 | * 8 | * @author Jason (darkdiplomat) 9 | */ 10 | public interface TaskOwner { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/net/canarymod/util/JsonNBTUtility.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.util; 2 | 3 | import com.mojang.authlib.GameProfile; 4 | import net.canarymod.api.nbt.BaseTag; 5 | import net.canarymod.api.nbt.CompoundTag; 6 | 7 | /** 8 | * Json to/from NBT Utility 9 | *

10 | * Instance of this should be retrieved using {@link net.canarymod.Canary#jsonNBT()} 11 | * 12 | * @author Jason Jones (darkdiplomat) 13 | */ 14 | public interface JsonNBTUtility { 15 | 16 | BaseTag jsonToNBT(String rawJson); 17 | 18 | String baseTagToJSON(BaseTag baseTag); 19 | 20 | GameProfile gameProfileFromNBT(CompoundTag tag); 21 | 22 | CompoundTag gameProfileToNBT(GameProfile profile); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/resources/lang/en_GB.lang: -------------------------------------------------------------------------------- 1 | mobspawn info=animals or other things" 2 | modify group set (failed)=Group has failed to set: {0} 3 | plugin disabled fail=check server log" 4 | plugin enabled fail=check server log" 5 | plugin reloaded fail=check server log" 6 | setspawn console=there is no need for a spawn point." 7 | spawn failed=sorry." 8 | -------------------------------------------------------------------------------- /src/main/resources/resources/lang/languages.txt: -------------------------------------------------------------------------------- 1 | ;# This file NEEDS to be in UTF-8 format! 2 | ;# This file tells VIUtils which languages are supported 3 | ;# locale => .lang 4 | 5 | # English (this key needs to exist) 6 | en_US=en_US 7 | en_GB=en_US 8 | en_AU=en_US 9 | en_CA=en_US 10 | 11 | # Dannish 12 | da_DK=da_DK 13 | 14 | # Dutch 15 | nl_NL=nl_NL 16 | 17 | # Finnish 18 | fi_FI=fi_FI 19 | 20 | # French 21 | fr_FR=fr_FR 22 | 23 | # German - Germany 24 | de_DE=de_DE 25 | 26 | # German - Switzerland 27 | de_CH=de_CH 28 | 29 | # Italian 30 | it_IT=it_IT 31 | 32 | # Latin 33 | la_LA=la_LA 34 | 35 | # Norwegian 36 | no_NO=no_NO 37 | 38 | # Polish 39 | pl_PL=pl_PL 40 | 41 | # Pirate English 42 | en_PT=en_PT 43 | 44 | # Russian 45 | ru_RU=ru_RU 46 | 47 | # Spanish 48 | es_ES=es_ES 49 | 50 | # Swedish 51 | sv_SE=sv_SE 52 | -------------------------------------------------------------------------------- /src/test/java/net/canarymod/api/world/blocks/VanillaBlockTest.java: -------------------------------------------------------------------------------- 1 | package net.canarymod.api.world.blocks; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * VanillaBlock translations test 9 | * 10 | * @author Jason Jones (darkdiplomat) 11 | */ 12 | public final class VanillaBlockTest { 13 | 14 | @Test 15 | public void testVanillaBlockTranslations() { 16 | for (VanillaBlock vanillaBlock : VanillaBlock.values()) { 17 | BlockType blockType = vanillaBlock.getType(); 18 | if (vanillaBlock.equals(VanillaBlock.NULL)) { 19 | assertNull(blockType); 20 | assertEquals(VanillaBlock.NULL, VanillaBlock.enumerate(blockType)); 21 | continue; 22 | } 23 | assertNotNull("BlockType failure with VanillaBlock." + vanillaBlock.name(), blockType); 24 | assertEquals("Enumerate failure with VanillaBlock." + vanillaBlock.name(), vanillaBlock, VanillaBlock.enumerate(blockType)); 25 | } 26 | } 27 | } 28 | --------------------------------------------------------------------------------