Git Product home page Git Product logo

sponge's Introduction

Sponge Java CI with Gradle

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms. It is licensed under the MIT License.

Latest Builds

Sponge

Sponge Latest

Sponge 1.16.5

SpongeVanilla

SpongeVanilla Latest

SpongeVanilla 1.16.5

Prerequisites

Clone

The following steps will ensure your project is cloned properly.

  1. git clone --recursive https://github.com/SpongePowered/Sponge.git
  2. cd Sponge
  3. cp scripts/pre-commit .git/hooks

Setup

Note: Sponge uses Gradle as its build system. The repo includes the Gradle wrapper that will automatically download the correct Gradle version. Local installations of Gradle may work (as long as they are using Gradle 6.8+) but are untested. To execute the Gradle wrapper, run the ./gradlew script on Unix systems or only gradlew on Windows systems.

To have browsable sources for use in-IDE, run ./gradlew :decompile. This command will need to be re-ran after any change to Minecraft version or to .accesswidener files. If sources are not appearing properly, an IDE refresh should fix things.

IDE Setup

For Eclipse

  1. Make sure the Buildship plugin is installed (available on the Eclipse Marketplace)
  2. Import the project as an Existing Gradle Project (via File > Import > Gradle)

While we do our best to support any IDE, most of our developers use IntelliJ, so issues may pop up with Eclipse from time to time. We'll be happy to work to resolve those issues if reported via our issues page or fixed via PR.

For IntelliJ

  1. Make sure you have the Gradle plugin enabled (File > Settings > Plugins).
  2. Click File > New > Project from Existing Sources > Gradle and select the root folder for Sponge.
  3. Make sure Use default gradle wrapper is selected. Older/newer Gradle versions may work but we only test using the wrapper.

For both Eclipse and IntelliJ, a variety of run configurations will be generated which allow running the client and server in development. These run configurations will be re-generated on each project import, so any desired modifications should be done on copies of the configurations.

While these run configurations have Java versions attached to them, be aware that IntelliJ ignores that information entirely, and Eclipse will only be able to align those java versions with whatever JREs it is aware of.

Building

In order to build Sponge you simply need to run the gradlew build command. On Windows systems you should run gradlew build instead of ./gradlew build to invoke the Gradle wrapper. You can find the compiled JAR files in ./build/libs and ./vanilla/build/libs.

Updating your Clone

The following steps will update your clone with the official repo.

  1. git pull
  2. git submodule update --recursive
  3. ./gradlew build --refresh-dependencies

Contributing

Are you a talented programmer looking to contribute some code? We'd love the help!

  • Open a pull request with your changes, following our guidelines.
  • Please follow the above guidelines for your pull request(s) to be accepted.

sponge's People

Contributors

aaron1011 avatar aromaa avatar bloodmc avatar clienthax avatar cybermaxke avatar ddos avatar deamon5550 avatar dualspiral avatar faithcaio avatar gabizou avatar grinch avatar i509vcb avatar immorpheus avatar itsdoot avatar jamierocks avatar jbyoshi avatar kashike avatar lignium avatar me4502 avatar mumfrey avatar parlough avatar rednesto avatar simon816 avatar st-ddt avatar stephan-gh avatar vectrixdevelops avatar windy1 avatar yeregorix avatar zidane avatar zml2008 avatar

Stargazers

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

Watchers

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

sponge's Issues

Discussion: Procedures for managing Overwrite methods in mixins

(Moved into common)

Calling @SpongePowered/developers for comments.

It is my belief that we need to put a procedure (or at least some reasonably strict guidelines) in place for managing @Overwrite methods in mixins. This thought is largely triggered by these two behemoths which just present a maintenance nightmare as they stand.

We currently have no standard for marking @Overwrite methods, meaning that determining the purpose of an @Overwrite and the specific code which has changed is an excercise left up to the observer. I think this needs to change before we create too much unmaintainable code.

Suggestions for things we should encode in an @Overwrite procedure:

  • All @Overwrite methods should be decorated with a (javadoc?) comment which at minimum contains who added the @Overwrite method and why, for example:

    /**
    * @auhor Mumfrey
    * Adds custom logic for summoning Cthulu
    */
    @Overwrite
    public void doSomething() {
    // etc

    This will make it possible to quickly determine whether an @Overwrite is needed any more, whether it can be replaced with an injection when someone has more time, etc. etc. and in extreme cases, who to go and ask when the inevitable "what the hell does this code even do" comes up :)

  • Where an @Overwrite method is being employed to only change certain blocks of code within a method (eg. it began as a copy/paste of the target method and was subsequently modified). The changed blocks should be marked with some standard comment a la // CraftBukkit start and // CraftBukkit end of old. Where new code replaces old code, the old code should be left behind and commented out:

    // Sponge start
    // this.baz = false; // old code
    this.baz = this.getFoo().isBar();
    // Sponge end

    The old code thing is a suggestion, but I think we should do something along those lines mainly so that when we port changes forward it's possible to locate similar code in the new class?

  • Where an @Overwrite method entirely differs from its target counterpart (eg. when replacing a hard-coded accessor with some custom logic) the // Sponge start and //Sponge end could be omitted and the method description can cover it.

  • Things we might also want to insist upon/recommend in the method comment might be:

    • Usage of the @since tag to designate the forge/mc version at time of adding/last modification?
    • Usage of the @category tag with some pre-defined categories indicating purposes of the @Overwrite
    • Usage of something like TODO: inject if the person adding the @Overwrite isn't sure if (for example) an injector is actually a more suitable way of achieving the same goal but isn't experienced enough with injectors to actually write one.

Inviting discussion on what the procedure should be, I think the fact that we ought to put something in place is pretty obvious (for future sanity purposes), but how strict we want to be and what the guidelines themselves should actually be is something we need to decide. Whatever we decide it should go into the contribution guidelines and a review of current @Overwrites undertaken to make them compliant.

As an example, we could make a javadoc comment a "must have" and everything else be optional, or we could go full strict-mode and send people to the firing squad if they don't comment their additions :)

Okay, </ramble>.

Event PlayerDropItemEvent is not triggered upon death.

Event PlayerDropItemEvent is not triggered upon death.
Behavior is for player death to drop all items at once.
CODE:

   @Subscribe
    public void drop (PlayerDropItemEvent event){
        Player player = event.getPlayer();
        Collection<ItemStack> droppedItems = event.getDroppedItems();
        int size = droppedItems.size();
        player.sendMessage(Texts.of("Drop - " + size));}

Correct biomes matching dimensions rather than terrain.

Currently when you create a world with a certain GeneratorType and a different Dimension Type (for example overworld terrain in a nether dimension), the final biomes of the world match the dimension rather than the terrain. This should be the reverse with the biomes matching the terrain.

This is easy to see using the WorldTest and traveling to any of the mixed worlds (netherend, endnether, overend, endover, netherover, overnether).

BungeeCord support

Restore Pre-1.8 Server Spawn Protection Behavior

As some may know, in 1.8 the server disables spawn point protection if the server has no known OPs. In my opinion, this is an incredibly stupid design decision and, as evidenced by looking at various forum posts, many server admins were under a false impression that spawn protection broke.

Put simply, you shouldn't HAVE to have an OP specified for spawn protection work. Its an easy change to DedicatedServer to remove the if check.

@SpongePowered/developers thoughts?

PlayerInteractBlockEvent performed twice.

PlayerInteractBlockEvent performed twice.
This occurs when:
I hold in my hand the subject;
The reason for the event - use.

CODE

    @Subscribe
    public void interact (PlayerInteractBlockEvent event){
        String interactionType = event.getInteractionType().getName();
        Text startEvent = Texts.of("Start PlayerInteractBlockEvent");
        Text inter = Texts.of("Cause: " + interactionType);
        Player player = event.getPlayer();
        player.sendMessage(inter);}

Job CODE
2015-05-03_22 07 45

AsyncScheduler groups tasks' delay

Hello!

I execute this:

final int INTERVAL = 2;
int timeElapsed; //In seconds
for (int i = 0; i < 5; i++) {

        timeElapsed = i*INTERVAL;

        logger.debug("Delay: " + timeElapsed);

        asyncScheduler.runTaskAfter(plugin, new Runnable() {
            @Override
            public void run() {
                logger.debug("Run");
            }
        }, TimeUnit.SECONDS, timeElapsed);
    }

I get the following output:

[21:53:14] [Server thread/DEBUG] [QuickStartTourRandomByte]: Delay: 0
[21:53:14] [Server thread/DEBUG] [QuickStartTourRandomByte]: Delay: 2
[21:53:14] [Server thread/DEBUG] [QuickStartTourRandomByte]: Delay: 4
[21:53:14] [pool-2-thread-1/DEBUG] [QuickStartTourRandomByte]: Run
[21:53:14] [Server thread/DEBUG] [QuickStartTourRandomByte]: Delay: 6
[21:53:14] [Server thread/DEBUG] [QuickStartTourRandomByte]: Delay: 8
[21:53:20] [pool-2-thread-1/DEBUG] [QuickStartTourRandomByte]: Run
[21:53:20] [pool-2-thread-2/DEBUG] [QuickStartTourRandomByte]: Run
[21:53:20] [pool-2-thread-3/DEBUG] [QuickStartTourRandomByte]: Run
[21:53:28] [pool-2-thread-3/DEBUG] [QuickStartTourRandomByte]: Run

The first Runnable runs at the right time. The next three are grouped together and are executed with the delay of the last Task in this "group"(6 seconds delay). And the forth Task runs at a completely wrong time: It starts the delay from the last Task(20 seconds, see the log time) and counts up to 28 seconds but it should start at 14 and count up to 22.
I hope you understand.

I think my code can't be the fault. So, am I understanding the AsyncScheduler wrong? I tried this with different values and they always group together in some way.

Event Implementation Progress Tracker

NOTE: THIS IS WILDLY OUT OF DATE

Event Progress Trackers: SpongeForge | SpongeCommon | SpongeVanilla

Progress tracker for events

Please keep this updated Sponge devs!

achievement.GrantAchievementEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

achievement.GrantAchievementEvent.TargetPlayer
Refer to SpongeForge or SpongeVanilla

action.FishingEvent.HookEntity

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.FishingEvent.Start

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.FishingEvent.Stop

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.LightningEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.LightningEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.LightningEvent.Strike
Refer to SpongeForge or SpongeVanilla

action.SleepingEvent.Finish
Refer to SpongeForge or SpongeVanilla

action.SleepingEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

action.SleepingEvent.Pre
Refer to SpongeForge or SpongeVanilla

action.SleepingEvent.Tick

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.ChangeBlockEvent.Break
Refer to SpongeForge or SpongeVanilla

block.ChangeBlockEvent.Decay

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.ChangeBlockEvent.Grow

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.ChangeBlockEvent.Modify

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.ChangeBlockEvent.Place
Refer to SpongeForge or SpongeVanilla

block.ChangeBlockEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.ChangeBlockEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.CollideBlockEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.CollideBlockEvent.Impact

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.InteractBlockEvent.Primary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.InteractBlockEvent.Primary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.InteractBlockEvent.Secondary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.InteractBlockEvent.Secondary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.NotifyNeighborBlockEvent
Refer to SpongeForge or SpongeVanilla

block.TickBlockEvent.Random

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.TickBlockEvent.Scheduled

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.BrewingEvent.Finish
Refer to SpongeForge or SpongeVanilla

block.tileentity.BrewingEvent.Interrupt

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.BrewingEvent.Start
Refer to SpongeForge or SpongeVanilla

block.tileentity.BrewingEvent.Tick

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.ChangeSignEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.SmeltEvent.ConsumeFuel

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.SmeltEvent.Finish

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.SmeltEvent.Interrupt

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.SmeltEvent.Start

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.SmeltEvent.Tick

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

block.tileentity.TargetTileEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

command.SendCommandEvent
Refer to SpongeForge or SpongeVanilla

command.TabCompleteEvent.Chat

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

command.TabCompleteEvent.Command

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

data.ChangeDataHolderEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

data.ChangeDataHolderEvent.ValueChange

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

economy.EconomyTransactionEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.AttackEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.BreedEntityEvent.Breed

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.BreedEntityEvent.FindMate

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityEquipmentEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityEquipmentEvent.TargetHumanoid

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityEquipmentEvent.TargetLiving

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityEquipmentEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityExperienceEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityPotionEffectEvent.Expire

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityPotionEffectEvent.Gain

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ChangeEntityPotionEffectEvent.Remove

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.CollideEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.CollideEntityEvent.Impact

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ConstructEntityEvent.Post
Refer to SpongeForge or SpongeVanilla

entity.ConstructEntityEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.DamageEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.DestructEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.DestructEntityEvent.Death
Refer to SpongeForge or SpongeVanilla

entity.ExpireEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ExpireEntityEvent.TargetItem
Refer to SpongeForge or SpongeVanilla

entity.HarvestEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.HarvestEntityEvent.TargetHumanoid

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.HarvestEntityEvent.TargetLiving

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.HarvestEntityEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.HealEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.IgniteEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.InteractEntityEvent.Primary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.InteractEntityEvent.Primary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.InteractEntityEvent.Secondary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.InteractEntityEvent.Secondary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.LeashEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.MoveEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.MoveEntityEvent.Teleport

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.MoveEntityEvent.Teleport.Portal

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.RideEntityEvent.Dismount
Refer to SpongeForge or SpongeVanilla

entity.RideEntityEvent.Mount
Refer to SpongeForge or SpongeVanilla

entity.SpawnEntityEvent
Refer to SpongeForge or SpongeVanilla

entity.SpawnEntityEvent.ChunkLoad

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.SpawnEntityEvent.Custom

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.SpawnEntityEvent.Spawner
Refer to SpongeForge or SpongeVanilla

entity.TameEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.UnleashEntityEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ai.AITaskEvent.Add

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.ai.AITaskEvent.Remove

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.explosive.DefuseExplosiveEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.explosive.DefuseExplosiveEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.explosive.DetonateExplosiveEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.explosive.PrimeExplosiveEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.explosive.PrimeExplosiveEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.item.ItemMergeItemEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.AnimateHandEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.ChangeGameModeEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.ChangeGameModeEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.ChangeLevelEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.ChangeLevelEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.player.KickPlayerEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.player.PlayerChangeClientSettingsEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.player.ResourcePackStatusEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

entity.living.humanoid.player.RespawnPlayerEvent
Refer to SpongeForge or SpongeVanilla

entity.projectile.LaunchProjectileEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

game.GameReloadEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

game.state.GameAboutToStartServerEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameConstructionEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameInitializationEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameLoadCompleteEvent
Refer to SpongeForge or SpongeVanilla

game.state.GamePostInitializationEvent
Refer to SpongeForge or SpongeVanilla

game.state.GamePreInitializationEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameStartedServerEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameStartingServerEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameStoppedEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

game.state.GameStoppedServerEvent
Refer to SpongeForge or SpongeVanilla

game.state.GameStoppingEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

game.state.GameStoppingServerEvent
Refer to SpongeForge or SpongeVanilla

item.inventory.ChangeInventoryEvent.Equipment

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ChangeInventoryEvent.Held

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ChangeInventoryEvent.Pickup
Refer to SpongeForge or SpongeVanilla

item.inventory.ChangeInventoryEvent.Transfer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Creative

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Double

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drag.Primary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drag.Secondary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drop.Full

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drop.Outside.Primary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drop.Outside.Secondary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Drop.Single

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Middle

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.NumberPress

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Primary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Secondary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Shift.Primary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.ClickInventoryEvent.Shift.Secondary

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.DropItemEvent.Custom

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.DropItemEvent.Destruct

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.DropItemEvent.Dispense
Refer to SpongeForge or SpongeVanilla

item.inventory.DropItemEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.InteractInventoryEvent.Close

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.InteractInventoryEvent.Open
Refer to SpongeForge or SpongeVanilla

item.inventory.InteractItemEvent.Primary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.InteractItemEvent.Primary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.InteractItemEvent.Secondary.MainHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.InteractItemEvent.Secondary.OffHand

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.UseItemStackEvent.Finish
Refer to SpongeForge or SpongeVanilla

item.inventory.UseItemStackEvent.Replace

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.UseItemStackEvent.Reset

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

item.inventory.UseItemStackEvent.Start
Refer to SpongeForge or SpongeVanilla

item.inventory.UseItemStackEvent.Stop
Refer to SpongeForge or SpongeVanilla

item.inventory.UseItemStackEvent.Tick
Refer to SpongeForge or SpongeVanilla

message.MessageChannelEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

message.MessageChannelEvent.Chat
Refer to SpongeForge or SpongeVanilla

network.BanIpEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.ChannelRegistrationEvent.Register

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.ChannelRegistrationEvent.Unregister

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.ClientConnectionEvent.Auth

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.ClientConnectionEvent.Disconnect
Refer to SpongeForge or SpongeVanilla

network.ClientConnectionEvent.Join
Refer to SpongeForge or SpongeVanilla

network.ClientConnectionEvent.Login

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.PardonIpEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.rcon.RconConnectionEvent.Connect

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.rcon.RconConnectionEvent.Disconnect

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

network.rcon.RconConnectionEvent.Login

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

server.ClientPingServerEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

server.query.QueryServerEvent.Basic

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

server.query.QueryServerEvent.Full

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

service.ChangeServiceProviderEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

statistic.ChangeStatisticEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

statistic.ChangeStatisticEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

user.BanUserEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

user.BanUserEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

user.PardonUserEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

user.PardonUserEvent.TargetPlayer

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChangeWorldGameRuleEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChangeWorldWeatherEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChunkPreGenerationEvent.Cancelled

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChunkPreGenerationEvent.Complete

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChunkPreGenerationEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ChunkPreGenerationEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ConstructPortalEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ConstructWorldPropertiesEvent

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ExplosionEvent.Detonate
Refer to SpongeForge or SpongeVanilla

world.ExplosionEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.ExplosionEvent.Pre
Refer to SpongeForge or SpongeVanilla

world.GenerateChunkEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.GenerateChunkEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.LoadWorldEvent
Refer to SpongeForge or SpongeVanilla

world.SaveWorldEvent
Refer to SpongeForge or SpongeVanilla

world.SaveWorldEvent.Post

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.SaveWorldEvent.Pre

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.UnloadWorldEvent
Refer to SpongeForge or SpongeVanilla

world.chunk.ForcedChunkEvent
Refer to SpongeForge or SpongeVanilla

world.chunk.LoadChunkEvent
Refer to SpongeForge or SpongeVanilla

world.chunk.PopulateChunkEvent.Populate

  • Fired from all relevant parts of the Minecraft/Sponge code
  • In bleeding branch

world.chunk.PopulateChunkEvent.Post
Refer to SpongeForge or SpongeVanilla

world.chunk.PopulateChunkEvent.Pre
Refer to SpongeForge or SpongeVanilla

world.chunk.UnforcedChunkEvent
Refer to SpongeForge or SpongeVanilla

world.chunk.UnloadChunkEvent
Refer to SpongeForge or SpongeVanilla

Inventory implementation

I'm not entirely sure that I'm missing something that's been worked on already. But I started trying to implement recipes and realized before I could do that I needed to convert between sponge and vanilla inventory types. Then I discovered that the Inventory has no implementation that I can see.

I would assume someone is already working on this and I wanted to let them show that before I work too much on my hack job of a inventory implementation.

Default permissions are not applied properly

While op's receive all permissions as proper, when a TRUE (or FALSE) value is assigned to the default permission data, it doesn't effect getPermission on a Subject. The value comes out UNDEFINED every time.

I did see some interesting behavior where when using the console I was able to get a TRUE value the first time and then UNDEFINED after that. It seems from my investigations that when a UserSubject tries to get the default SubjectData the values it gets are somehow not the same as the SubjectData given from the service provider itself.

I've been messing with this for roughly 2 hours now and am not any closer to figuring out the root cause of this issue, so I'll pass on the torch to @zml2008 who wrote it and knows more about it.

CatalogType does not ignore case.

I tried to get a GameMode type from the CatalogType and I noticed the following. When the Type name is in Lower Case the CatalogType can't find the type.

Example:

game.getRegistry().getType(ItemType.class, "SPONGE").orNull(); //returned the SPONGE ItemType.

game.getRegistry().getType(ItemType.class, "sponge").orNull(); //returned null.

Canceling a CommandEvent causes "Command not found" warning in chat

This happens when you cancel the event that refers to a registered command,
and when you cancel an event that refers to an unknown command. Always.

Tested with different event orders (PRE, EARLY, LATE).

Expected behaviour: When you cancel a command event, no "Command not found" message should appear.

Tested with Sponge-1.8-1371-2.1DEV-437

This issue did not appear with old versions of Sponge (Pre 2.0).

I posted it here because both implementations share the command code.

Log with test plugin that cancels command:

/early
Mai 06, 2015 12:39:18 AM com.github.boformer.spongetest.SpongeTestPlugin onCommandEarly
INFORMATION: Cancelling command /early
[00:39:18] [Server thread/INFO]: Unknown command. Try /help for a list of commands

Issues with PlayerBreakBlockEvent vs. BlockBreakEvent

This applies to both Sponge and SpongeVanilla.

The original implementation of PlayerBlockBreakEvent in Sponge is mixed into BlockEvent.Break from Forge. An API change, at some point, landed and changed the interface; it was granted a Direction facing. This presents a problem because:

  • tryHarvestBlock (where Forge fires their event) in ItemInWorldManager has no parameter for the facing direction.
  • tryHarvestBlock is called from multiple spots and therefore cannot be modified in Forge to add that parameter.
  • Forge has no distinct "Break" event for a Player. Not an issue for us except that it has no direction parameter which means we can't just mix this for PlayerBreakBlockEvent.

From my very tired perspective (late here), the best way to move forward is to make BlockEvent.Break implement BlockBreakEvent and add another overwrite to ItemInWorldManager for when we know the EnumFacing to fire the player version.

I welcome all thoughts
@SpongePowered/developers

Load Existing Worlds Whose Plugin No Longer Exists

So, in the past, Bukkit functionality had maintained that a world could be loaded by an external plugin, such as Multiverse, the world would only be loaded if Multiverse was running on the server, otherwise, only the default world as defined by the server.properties file would be loaded. In SpongeAPI implementations, this isn't the case, if a plugin adds a new world, that world will be loaded every server start afterwards, in other words, that world information persists to be loaded regardless whether the plugin requesting that world is loaded by the server or not.

So, my question is simple: Do we want to have implementation where a world is only loaded if the plugin requesting that world is existing on the server? Or do we want to retain loaded worlds once they are requested, only to be removed by the request of a similar "world management" plugin?

OP permission not given in SSP

When running in SSP, even starting a LAN server with "Cheats" enabled doesn't give the overall OP permission. This prevents use of any higher level commands without a permission plugin installed.

Implementation of the InteractEntityEvent

According to this Event Progress Tracker and my Plugin, the PlayerInteractEntityEvent is not jet implemented.
Deamon5550 said here: "Opening issues like these does help us prioritize which events we're implementing." So i thougt i'll open this issue, since this is the last missing event i need to finish my plugin and start my server :)

For the sake of completeness:
Sponge Build: 1.8-1371-2.1DEV-467
Forge Build: forge-1.8-11.14.1.1397
Client Type/Version (Forge/Vanilla and version) : Vanilla 1.8.6
Installed Plugins and/or Mods: Sponge, My Plugin, (and DynmapForge)
Java Version: 1.8.0_40
Operating System: Windows 7 64 bit

(Reopens this Issue)

Re-think world configurations location

Currently, the configurations for each world are in the config directory.
Example:

โ””โ”€โ”€ config
 ย ย  โ”œโ”€โ”€ forge.cfg
 ย ย  โ”œโ”€โ”€ forgeChunkLoading.cfg
 ย   โ”œโ”€โ”€ nether
ย ย   โ”‚ย ย  โ”œโ”€โ”€ dim0
ย ย   โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
ย ย   โ”‚ย ย  โ”œโ”€โ”€ dim-1
ย ย   โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
ย ย   โ”‚ย ย  โ””โ”€โ”€ dimension.conf
ย ย   โ”œโ”€โ”€ overworld
ย ย   โ”‚ย ย  โ”œโ”€โ”€ dim0
ย ย   โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
 ย   โ”‚ย ย  โ””โ”€โ”€ dimension.conf
ย ย   โ”œโ”€โ”€ sponge
ย ย   โ”‚ย ย  โ””โ”€โ”€ global.conf
ย ย   โ””โ”€โ”€ the_end
ย ย       โ”œโ”€โ”€ dim0
ย ย       โ”‚ย ย  โ””โ”€โ”€ world.conf
ย ย       โ”œโ”€โ”€ dim1
ย ย       โ”‚ย ย  โ””โ”€โ”€ world.conf
ย ย       โ””โ”€โ”€ dimension.conf

It makes sense to group them under one folder, does it not? It seems messy right now, and world configurations will be mixed in with mods and plugins.

Revised:

โ””โ”€โ”€ config
 ย ย  โ”œโ”€โ”€ forge.cfg
 ย ย  โ”œโ”€โ”€ forgeChunkLoading.cfg
 ย ย  โ””โ”€โ”€ sponge
 ย ย   ย ย  โ”œโ”€โ”€ global.conf
 ย ย      โ””โ”€โ”€ worlds
 ย ย          โ”œโ”€โ”€ nether
 ย ย          โ”‚ย ย  โ”œโ”€โ”€ dim0
 ย ย          โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
  ย          โ”‚ย ย  โ”œโ”€โ”€ dim-1
 ย ย          โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
 ย ย          โ”‚ย ย  โ””โ”€โ”€ dimension.conf
 ย ย          โ”œโ”€โ”€ overworld
 ย ย          โ”‚ย ย  โ”œโ”€โ”€ dim0
 ย ย          โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ world.conf
 ย ย          โ”‚ย ย  โ””โ”€โ”€ dimension.conf
 ย ย          โ””โ”€โ”€ the_end
 ย ย              โ”œโ”€โ”€ dim0
 ย ย              โ”‚ย ย  โ””โ”€โ”€ world.conf
 ย ย              โ”œโ”€โ”€ dim1
 ย ย              โ”‚ย ย  โ””โ”€โ”€ world.conf
 ย ย              โ””โ”€โ”€ dimension.conf

Convert Text colors to legacy format for sending with ChatTypes.ACTION_BAR

Mojang text handling is inconsistent between different chat types. For all other chat types (mostly the standard player chat), all properties of chat work fine. However, with the action bar colors specified in JSON format do not work, they only work in legacy format. There are probably reasons behind this, but it comes at great inconvenience to plugin developers.

The proposed fix would be to silently convert text sent to ChatTypes.ACTION_BAR to use colors, but this is not trivial. As the example @Minecrell gave in IRC,

Text.Translatable{color: red} -> Text.Literal{text:"ยงc",children:Text.Translatable}

Human Entity Issues

Here are some issues I have found with the human entity

  • = Solved

They don't persist across server restarts. - All mobs

  • When quitting and rejoining the entities lose the skin set originally
  • Setting AI goals on SpongeHuman works, but pathing doesn't so most AI is useless.

The last one might be a mistake of how I'm writing that code.

Scheduled tasks don't throw exception output!

I don't know if it happens everywhere.
But I runned a task with
getAsyncScheduler().runRepeatingTask() And the runnable had an exception. And I spended 2 hours figuring out why the code didn't worked.

Crash on leaf decay

net.minecraft.util.ReportedException: Exception ticking world
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:699) ~[MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:364) ~[po.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598) ~[MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]
Caused by: java.lang.AbstractMethodError: net.minecraft.world.WorldServer.getBlockSnapshot(Lcom/flowpowered/math/vector/Vector3i;)Lorg/spongepowered/api/block/BlockSnapshot;
        at org.spongepowered.api.world.Location.getBlockSnapshot(Location.java:607) ~[Location.class:1.8-1446-2.1DEV-0+unknown-b0.git-unknown]
        at net.minecraft.block.BlockLeaves.callLeafDecay(BlockLeaves.java:70) ~[axg.class:?]
        at net.minecraft.block.BlockLeaves.func_180650_b(BlockLeaves.java:198) ~[axg.class:?]
        at net.minecraft.block.Block.func_180645_a(Block.java:428) ~[atr.class:?]
        at net.minecraft.world.WorldServer.func_147456_g(WorldServer.java:454) ~[qt.class:?]
        at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:221) ~[qt.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:693) ~[MinecraftServer.class:?]
        ... 4 more

Optional.get() cannot be called on an absent value.

[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at com.google.common.base.Absent.get(Absent.java:47)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at me.nikosgram.oglofus.sponge.OglofusHelp.execute(OglofusHelp.java:32)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.util.command.spec.CommandSpec.process(CommandSpec.java:330)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.util.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:342)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.service.command.SimpleCommandService.process(SimpleCommandService.java:231)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:85)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:812)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:791)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.play.client.C01PacketChatMessage.func_180757_a(SourceFile:37)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.util.concurrent.FutureTask.run(Unknown Source)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:655)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:364)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478)
[01:38:47] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.lang.Thread.run(Unknown Source)

Java Version: 1.8
Minecraft Version: 1.8.4
Sponge Version: 1.8-1371-2.1DEV-449
Forge Version: 1.8-11.14.1.1404-universal

My code:

@Override
public CommandResult execute( CommandSource sender, CommandContext context ) throws CommandException
{
    for ( CommandMapping mapping : plugin.getGame().getCommandDispatcher().getAll().values() )
    {
        if ( !mapping.getCallable().testPermission( sender ) )
        {
            continue;
        }
        String command = mapping.getPrimaryAlias() + " ";
        Text usage = mapping.getCallable().getUsage( sender );
        Text description = mapping.getCallable().getShortDescription( sender ).get(); //LINE 32
        sender.sendMessage( Texts.builder( command ).append( usage ).append( Texts.of( " | " ) ).append( description ).build() );
    }
    return CommandResult.success();
}

SyncScheduler has incorrect delay compensation

When using the SynchronousScheduler#runTaskAfter method (implemented by SyncScheduler), the delay given by the command in ticks is sometimes not used. For example, when using this code in a command:

final long st1 = System.currentTimeMillis();
// Start a timeout schedule
plugin.getGame().getSyncScheduler().runTaskAfter(plugin, new Runnable() {
    public void run() {
        source.sendMessage(Texts.of(TextColors.AQUA, (System.currentTimeMillis() - st1)));
    }
}, 200);

Usually a server averages about 20tps, so this delay would be 10 seconds, however this value returns 51 milliseconds.

Doing a similar test with 2000 ticks (which is usually about 100 seconds) gives about 90000 milliseconds, which is closer to the estimated value.

EDIT: After some testing, it's been determined that this issue only persists inside of a command. Running this during ServerStartingEvent or otherwise yields expected values.

Sponge dev version: 1.8-1371-2.1DEV-443
Forge version: 1.8-11.14.1.1371

Broken static colored Text instances

It seems that whenever you build a static Text instance with a color, like the following:

private static final Text MY_TEXT = Texts.of(TextColors.RED, "My red text!");

the TextColor is interpreted as null somewhere, and so when the Text is sent to a player, they would see: nullMy red text! (uncolored).

This is a continuation from #216

AbstractMethodError at EntityPlayerMP.getGameModeData()

[01:01:26] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 3974ms behind, skipping 79 tick(s)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.AbstractMethodError: net.minecraft.entity.player.EntityPlayerMP.getGameModeData()Lorg/spongepowered/api/data/manipulator/entity/GameModeData;
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at me.nikosgram.oglofus.sponge.OglofusGamemode.execute(OglofusGamemode.java:111)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.util.command.spec.CommandSpec.process(CommandSpec.java:330)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.util.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:342)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at org.spongepowered.api.service.command.SimpleCommandService.process(SimpleCommandService.java:231)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:85)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:812)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:791)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.play.client.C01PacketChatMessage.func_180757_a(SourceFile:37)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.util.concurrent.FutureTask.run(Unknown Source)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:655)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:364)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478)
[01:01:26] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at java.lang.Thread.run(Unknown Source)

Java Version: 1.8
Minecraft Version: 1.8.4
Sponge Version: 1.8-1371-2.1DEV-449
Forge Version: 1.8-11.14.1.1404-universal

My code in line 111:

player.getGameModeData().setGameMode( GameModes.CREATIVE );

Tasks will not stop if canceled during run()

Both Async and Sync Schedulers use the same similar code to process every task, every run.

boolean bTaskStarted = startTask(task);
if (bTaskStarted) {
    task.setState(ScheduledTask.ScheduledTaskState.RUNNING);

startTask() ends up calling run() on the task as expected but the task is always set to the RUNNING state once completed, which means if task.cancel() is called during run() of the task, it will be ignored and set back to RUNNING, and never stop.

Implement DataManipulators

A Checklist of data manipulators

TileData

  • BannerData
  • BeaconData
  • BrewingData
  • CooldownData
  • FurnaceData
  • LockableData
  • NoteData
  • SignData

EntityData

  • AchievementData
  • AgeableData
  • AgentData
  • AggressiveData
  • AngerableData
  • ArtData
  • BanData
  • BodyPartRotationalData
  • BreathingData
  • BreedableData
  • CareerData
  • ChargedData
  • CriticalHitData
  • DamageableData
  • DamagingData
  • ElderData
  • ExperienceHolderData
  • ExpirableData
  • ExplosiveRadiusData
  • EyeLocationData
  • FallingBlockData
  • FlamableData
  • FlyingData
  • FoodData
  • FuseData
  • GameModeData
  • GriefingData
  • HealingSourceData
  • HealthData
  • HorseData
  • IgniteableData
  • InvisibilityData
  • InvulnerabilityData
  • JoinData
  • KnockbackData
  • LeashData
  • OcelotData
  • OrbData
  • PassengerData
  • PersistingData
  • PersistingData
  • PlayerCreatedData
  • PlayingData
  • RabbitData
  • RespawnLocationData
  • SaddleData
  • ScreamingData
  • ShatteringData
  • ShearedData
  • SittingData
  • SizeData
  • SkeletonData
  • SleepingData
  • SlimeData
  • SneakingData
  • StatisticData
  • TameableData
  • TargetLivingData
  • TradeOfferData
  • VehicleData
  • VelocityData
  • VillagerZombieData
  • WhitelistData

ItemData

  • BlockItemData
  • BreakableData
  • CloneableData
  • CoalItemData
  • CookedFishItemData
  • DurabilityData
  • EnchantmentData
  • FishData
  • GoldenAppleData
  • InventoryItemData
  • LoreData
  • MapItemData
  • PagedData
  • PlaceableData
  • SpawnableData
  • StoredEnchantmentData

BlockData

  • AttachedData
  • AxisData
  • BigMushroomData
  • BrickData
  • ComparisonData
  • ConnectedDirectionData
  • DecayableData
  • DirectionalData
  • DirtData
  • DisarmedData
  • DisguisedBlockData
  • DoublePlantData
  • ExtendedData
  • FilledData
  • FluidLevelData
  • GrowthData
  • HingeData
  • InstrumentData
  • InWallData
  • LayeredData
  • MoistureData
  • NoDropData
  • OccupiedData
  • OpenData
  • PistonData
  • PortionData
  • PoweredData
  • PrismarineData
  • QuartzData
  • RailDirectionData
  • RedstonePoweredData
  • SandData
  • SandstoneData
  • SeamlessData
  • ShrubData
  • SignaledOutputData
  • SlabData
  • SnowedData
  • StairShapeData
  • StoneData
  • SuspendedData
  • TreeData
  • WallData

Common Data

  • AttributeData
  • ColoredData
  • CommandData
  • DisplayNameData
  • DyeableData
  • FireworkData
  • MobSpawnerData
  • OwnableData
  • PotionEffectData
  • RepresentedItemData
  • RotationalData
  • SkullData
  • TargetedLocationData
  • WetData

Common Abstract Data

  • IntData
  • ListData
  • MappedData
  • SingleValueData

Provide a sub-command off /sponge to get a list of plugins

It would be a huge plus to have a command (/sponge plugins or similar) to get a list of plugins currently active. It would be permission-based like the rest of the /sponge commands (currently only implemented in Sponge).
This command is helpful when helping users with issues (conflicting plugins, etc), and is much more reliable than someone manually typing a list of plugins (spelling issues, missing parts of a plugin name, etc)

@Zidane said he wasn't sure about adding this, but didn't specify a reason why (as far as I saw).

(replaces SpongePowered/SpongeAPI#702 (comment))

SqlServiceImpl creates new connection pools even if a pool with such a configurartion already exists

Usage of SqlService.getDataSource(String) leads to creation of new connection pools whenever called, even if a pool has already been created with identical URL and credentials. An example is illustrated here.

I assume this happens, because the SqlServiceImpl.ConnectionInfo, that is used to identify created pools in the cache, is not actually equal to the one created when calling SqlService.getDataSource(String) - both are separated objects and therefore by Java's default behaviour not equal. Fixing the issue is simple: either implement a custom equals() method that actually checks the ConnectionInfo's values or rewrite ConnectionInfo to use a multiton pattern.

The later could also address a potential bottleneck that is caused by the regex pattern parsing that happens when calling ConnectionInfo.fromUrl(String). However this is just a wild guess form side that is not backed by any measurements and might be completely misleading.

Implement DataProcessors

Given that Data API is rather large when it comes to the amount of data it is supposed to handle, this is a checklist of the data that is implemented.

If you'd like to implement one, please follow these guidelines by copy pasting this code block into your PR description and check mark as necessary:


Implementation of REPLACE_WITH_DATA_MANIPULATOR.

  • Registration of field getters and setters
  • Accurately used the appropriate AbstractData implementation

Implementation of REPLACE_WITH_IMMUTABLE_MANIPULATOR

  • Accurately extended the appropriate AbstractImmutableData implementation
  • Accurately instantiating final instance fields with an ImmutableValue counter part for any value getters
  • If necessary, creating a new ImmutableValue for a value that should not be cached, or, using the existing caching utils.

Implementation of the VALUE_PROCESSOR(s):

  • Appropriately extended AbstractSpongeValueProcessor
  • Individual processors for each source type possible (one for ItemStack/TileEntity/Entity as necessary).

Registration:

  • Registered the Key correctly by FIELD_NAME in the KeyRegistry
  • Registered the DataProcessors and DataManipulatorBuilder in SpongeSerializationRegistry
  • Registered the ValueProcessors in the SpongeSerializationRegistry

You should create and include a test plugin in your pull request. Preferably, it should test all possible value related methods with your DataManipulators and also test the serialization and deserialization of your DataManipulators.


The Checklist:

TileData

EntityData

ItemData

BlockData

Common Data

Updated as of January 30, 2018

Update the README.md

Currently, the README file is a copy pasta of the Sponge implementation. We should document what SpongeCommon really is etc.

Ongoing Minor Issue List (Sponge Edition)

SpongeAPI | Sponge

Checkstyle issues should not be reported here as those can be more accurately determined by simply running the checkstyle tool. Examples of good issues to report here are misnamed methods/fields, poorly worded javadocs, formatting issues.

As minor things are resolved, comments will be deleted.

Retrieving Sponge Common from a Repo

Hi

I am aware this is not really an issue and as such does not belong here but can't find anywhere else to currently ask these types of questions. I am trying to use the ItemStackBuilder implementation from sponge common but I can't find the jar in a repo anywhere. Is there a different repo than the one which contains the API that contains sponge common somewhere I can reference in my pom?

Thanks

Placing a decorated banner = Fatal error, FutureTask - optional get()

Upgraded to sponge dev 456 to confirm:

Solid color banners can be placed about just fine. Dye a banner, place it, and the banner does not appear, inventory is decreased to a red 0 in client (which can also go negative as placed more times). Block-update the area with a regular block or solid banner, and all the placed banners (including the ones below 0) appear in client. Other clients will see such blocks appear if they logout and log back in.

The server throws the following error when a dyed banner is placed, but not for solid colored banners:
[code]


[20:00:38] [Server thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
        at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.7.0_71]
        at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.7.0_71]
        at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:710) [FMLCommonHandler.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:655) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:364) [po.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.7.0_71]
Caused by: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
        at com.google.common.base.Absent.get(Absent.java:47) ~[minecraft_server.1.8.jar:?]
        at net.minecraft.tileentity.TileEntityBanner.updatePatterns(SourceFile:87) ~[bci.class:?]
        at net.minecraft.tileentity.TileEntityBanner.onSetItemValues(SourceFile:65) ~[bci.class:?]
        at net.minecraft.tileentity.TileEntityBanner.func_175112_a(SourceFile:284) ~[bci.class:?]
        at net.minecraft.item.ItemBanner.func_180614_a(SourceFile:66) ~[ajs.class:?]
        at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:568) ~[ForgeHooks.class:?]
        at net.minecraft.item.ItemStack.func_179546_a(ItemStack.java:132) ~[amj.class:?]
        at net.minecraft.server.management.ItemInWorldManager.func_180236_a(ItemInWorldManager.java:446) ~[qx.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:595) ~[rj.class:?]
        at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_180769_a(SourceFile:59) ~[mx.class:?]
        at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:10) ~[mx.class:?]
        at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[ih.class:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.7.0_71]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.7.0_71]
        at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) ~[FMLCommonHandler.class:?]
        ... 5 more
[/code]

... 

Have tested only with a few dyed patterns, not exhaustively tested all types of banners, figured the error code would imply a general issue :)

Tab completion issues

Vanilla (and SpongeAPI) commands to not tab-completing correctly.

/scoreboard <TAB>:

<nothing returned>

expected:

<all subcommands for /scoreboard>


/tpworld Kashike <TAB>: (expected)

endover, nether, world, overend, overnether, Farm, endnether, DIM1, end, DIM-1, netherend, netherover


/tpworld Kashike n<TAB>:

/tpworld Kashike nether

expected:

nether, netherend, netherover

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.