Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Update to API 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Flibio committed Dec 5, 2017
1 parent e51a373 commit 07c2639
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'eclipse'

sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.2.1'
version = '1.3.0'

jar {
manifest {
Expand All @@ -24,7 +24,7 @@ repositories {
}

dependencies {
compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT'
compile 'org.spongepowered:spongeapi:7.0.0-SNAPSHOT'
compile 'com.github.NucleusPowered.Nucleus:nucleus-api:1.0.0-6.0'
}

Expand Down
14 changes: 8 additions & 6 deletions src/main/java/io/github/hsyyid/payday/PayDay.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.github.hsyyid.payday;

import org.spongepowered.api.event.service.ChangeServiceProviderEvent;

import com.google.inject.Inject;
import io.github.hsyyid.payday.utils.Utils;
import io.github.nucleuspowered.nucleus.api.service.NucleusAFKService;
Expand All @@ -14,12 +12,14 @@
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.event.cause.EventContext;
import org.spongepowered.api.event.game.state.GameInitializationEvent;
import org.spongepowered.api.event.game.state.GamePostInitializationEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.event.service.ChangeServiceProviderEvent;
import org.spongepowered.api.plugin.Dependency;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.scheduler.Task;
import org.spongepowered.api.service.economy.EconomyService;
import org.spongepowered.api.service.economy.account.UniqueAccount;
Expand All @@ -32,7 +32,7 @@
import java.util.Map.Entry;
import java.util.Optional;

@Plugin(id = "payday", name = "PayDay", version = "1.2.1", description = "Pay your players as they play.", dependencies = {@Dependency(
@Plugin(id = "payday", name = "PayDay", version = "1.3.0", description = "Pay your players as they play.", dependencies = {@Dependency(
id = "nucleus", optional = true)})
public class PayDay
{
Expand All @@ -47,6 +47,8 @@ public class PayDay

@Inject private Logger logger;

@Inject private PluginContainer container;

public Logger getLogger()
{
return logger;
Expand Down Expand Up @@ -103,7 +105,7 @@ public void onGameInit(GameInitializationEvent event)
player.sendMessage(Text.of(TextColors.GOLD, "[PayDay]: ", TextColors.GRAY, "It's PayDay! Here is your salary of "
+ pay + " " + name + "! Enjoy!"));
UniqueAccount uniqueAccount = economyService.getOrCreateAccount(player.getUniqueId()).get();
uniqueAccount.deposit(economyService.getDefaultCurrency(), pay, Cause.of(NamedCause.owner(this)));
uniqueAccount.deposit(economyService.getDefaultCurrency(), pay, Cause.of(EventContext.empty(), container));
}
}
}
Expand Down Expand Up @@ -169,7 +171,7 @@ public void onPlayerJoin(ClientConnectionEvent.Join event)
player.sendMessage(Text.of(TextColors.GOLD, "[PayDay]: ", TextColors.GRAY, "Welcome to the server! Here is " + pay + " " + name
+ "! Enjoy!"));
UniqueAccount uniqueAccount = economyService.getOrCreateAccount(player.getUniqueId()).get();
uniqueAccount.deposit(economyService.getDefaultCurrency(), pay, Cause.of(NamedCause.owner(this)));
uniqueAccount.deposit(economyService.getDefaultCurrency(), pay, Cause.of(EventContext.empty(), container));
}
}
}
Expand Down

0 comments on commit 07c2639

Please sign in to comment.