Skip to content

Commit

Permalink
v112.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mayli committed Nov 4, 2020
1 parent e277cca commit 899bf30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: "java"

version '1.0'
version '112.1'

sourceCompatibility = 1.8

Expand All @@ -11,7 +11,7 @@ repositories{

ext{
//the build number that this plugin is made for
mindustryVersion = 'v104.6'
mindustryVersion = 'v112.1'
}

dependencies{
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/rtv/RockTheVotePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

import arc.*;
import arc.util.*;
import mindustry.entities.type.*;
import mindustry.game.Team;
import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.plugin.Plugin;
import mindustry.Vars;
import mindustry.mod.*;

public class RockTheVotePlugin extends Plugin {

Expand All @@ -23,7 +21,7 @@ public RockTheVotePlugin() {
Events.on(PlayerLeave.class, e-> {
Player player = e.player;
int cur = this.votes.size();
int req = (int) Math.ceil(ratio * Vars.playerGroup.size());
int req = (int) Math.ceil(ratio * Groups.player.size());
if(votes.contains(player)) {
votes.remove(player);
Call.sendMessage("RTV: [accent]" + player.name + "[] left, [green]" + cur + "[] votes, [green]" + req + "[] required");
Expand All @@ -42,7 +40,7 @@ public void registerClientCommands(CommandHandler handler){

//register a simple reply command
handler.<Player>register("rtv", "[off]", "Rock the vote to change map", (args, player) -> {
if (player.isAdmin){
if (player.admin()){
if (args.length == 1 && args[0].equals("off")) {
this.enable = false;
} else {
Expand All @@ -55,7 +53,7 @@ public void registerClientCommands(CommandHandler handler){
}
this.votes.add(player);
int cur = this.votes.size();
int req = (int) Math.ceil(ratio * Vars.playerGroup.size());
int req = (int) Math.ceil(ratio * Groups.player.size());
Call.sendMessage("RTV: [accent]" + player.name + "[] wants to change the map, [green]" + cur +
"[] votes, [green]" + req + "[] required");

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"author": "mayli",
"main": "rtv.RockTheVotePlugin",
"description": "A plugin to change map by /rtv.",
"version": 1.2
"version": 112.1
}

0 comments on commit 899bf30

Please sign in to comment.