translateToLocalFormatted using instead of weird split; add message when u die for testing from what type of entity u get killed
This commit is contained in:
parent
40e65772b2
commit
c3ec23d318
|
|
@ -24,7 +24,7 @@ apply plugin: 'forge'
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
version = "1.2.6"
|
version = "1.2.7"
|
||||||
group = "xamora.gp_dbc" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = "xamora.gp_dbc" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "gp_dbc"
|
archivesBaseName = "gp_dbc"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ public class ConfigManager {
|
||||||
|
|
||||||
static public double MULT_JAIL_TIME = 17.28; // 17.28 * 10 000 = 48 hours
|
static public double MULT_JAIL_TIME = 17.28; // 17.28 * 10 000 = 48 hours
|
||||||
static public int REDUCE_ALIGN_KILL = 33;
|
static public int REDUCE_ALIGN_KILL = 33;
|
||||||
|
static public int MULT_ALIGN_KILL = 3;
|
||||||
|
static public int MULT_ALIGN_KILL_PATROL = 2;
|
||||||
|
static public int MULT_ALIGN_KILL_FORMER_INMATE = 3;
|
||||||
|
|
||||||
// 17.28 * 10 000 = 48 hours
|
// 17.28 * 10 000 = 48 hours
|
||||||
static public int MAX_RATE_CRIMINAL = 10000;
|
static public int MAX_RATE_CRIMINAL = 10000;
|
||||||
|
|
@ -52,8 +55,7 @@ public class ConfigManager {
|
||||||
static public long MIN_TIME_BETWEEN_EACH_POSITION = 2 * 60; // 2 min
|
static public long MIN_TIME_BETWEEN_EACH_POSITION = 2 * 60; // 2 min
|
||||||
static public long MAX_TIME_BETWEEN_EACH_POSITION = 4 * 60 * 60; // 4 hours
|
static public long MAX_TIME_BETWEEN_EACH_POSITION = 4 * 60 * 60; // 4 hours
|
||||||
|
|
||||||
static public long TIME_FORMER_INMATE = 86400; // seconds (1 day)
|
static public long TIME_FORMER_INMATE = 604800; // in seconds (7 day)
|
||||||
static public int MULTI_FORMER_INMATE = 2; //
|
|
||||||
|
|
||||||
static public boolean REINCARNATION_RESET_CRIMINAL = true;
|
static public boolean REINCARNATION_RESET_CRIMINAL = true;
|
||||||
static public boolean REINCARNATION_RESET_GP = true;
|
static public boolean REINCARNATION_RESET_GP = true;
|
||||||
|
|
@ -127,6 +129,15 @@ public class ConfigManager {
|
||||||
REDUCE_ALIGN_KILL = addVariableConfig(order, CATEGORY_GP, "REDUCE_ALIGN_KILL",
|
REDUCE_ALIGN_KILL = addVariableConfig(order, CATEGORY_GP, "REDUCE_ALIGN_KILL",
|
||||||
"Soustration of the ratio when a player kill one other. [default: 33]", "33").getInt();
|
"Soustration of the ratio when a player kill one other. [default: 33]", "33").getInt();
|
||||||
|
|
||||||
|
MULT_ALIGN_KILL = addVariableConfig(order, CATEGORY_GP, "MULT_ALIGN_KILL",
|
||||||
|
"Multiplier of his killed. [default: 3]", "3").getInt();
|
||||||
|
|
||||||
|
MULT_ALIGN_KILL_PATROL = addVariableConfig(order, CATEGORY_GP, "MULT_ALIGN_KILL_PATROL",
|
||||||
|
"Multiplier if he killed a galactic patroller. [default: 2]", "2").getInt();
|
||||||
|
|
||||||
|
MULT_ALIGN_KILL_FORMER_INMATE = addVariableConfig(order, CATEGORY_GP, "MULT_ALIGN_KILL_FORMER_INMATE",
|
||||||
|
"Multiplier if he killed, will be applied to his crime rate. [default: 3]", "3").getInt();
|
||||||
|
|
||||||
NICKNAME_FOR_CRIMINAL = addVariableConfig(order, CATEGORY_GP, "NICKNAME_FOR_CRIMINAL",
|
NICKNAME_FOR_CRIMINAL = addVariableConfig(order, CATEGORY_GP, "NICKNAME_FOR_CRIMINAL",
|
||||||
"Criminal tracker print the nickname or the minecraft name. [default: false]", "false").getBoolean();
|
"Criminal tracker print the nickname or the minecraft name. [default: false]", "false").getBoolean();
|
||||||
|
|
||||||
|
|
@ -151,9 +162,6 @@ public class ConfigManager {
|
||||||
"Time if he commits another crime, a multiplier will be applied to his crime rate in seconds. [default: 86400]", "86400").getInt();
|
"Time if he commits another crime, a multiplier will be applied to his crime rate in seconds. [default: 86400]", "86400").getInt();
|
||||||
TIME_FORMER_INMATE *= 1000L;
|
TIME_FORMER_INMATE *= 1000L;
|
||||||
|
|
||||||
MULTI_FORMER_INMATE = addVariableConfig(order, CATEGORY_GP, "MULTI_FORMER_INMATE",
|
|
||||||
"Multiplier if he commits another crime will be applied to his crime rate. [default: 2]", "2").getInt();
|
|
||||||
|
|
||||||
REINCARNATION_RESET_CRIMINAL = addVariableConfig(order, CATEGORY_GP, "REINCARNATION_RESET_CRIMINAL",
|
REINCARNATION_RESET_CRIMINAL = addVariableConfig(order, CATEGORY_GP, "REINCARNATION_RESET_CRIMINAL",
|
||||||
"Reincarnation reset criminal rate. [default: true]", "true").getBoolean();
|
"Reincarnation reset criminal rate. [default: true]", "true").getBoolean();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
|
||||||
import static xamora.gp_dbc.utils.DrawGui.*;
|
import static xamora.gp_dbc.utils.DrawGui.*;
|
||||||
import static net.minecraft.util.StatCollector.translateToLocal;
|
import static net.minecraft.util.StatCollector.translateToLocal;
|
||||||
|
|
||||||
|
|
@ -67,8 +68,6 @@ public class GuiHandcuffed extends Gui {
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
String[] texts = TextUtils.getSeparateText(translateToLocal("warning.going_in_jail"), "%%");
|
drawLimitedShadow(mc.fontRenderer, translateToLocalFormatted("warning.going_in_jail", time_left) , width / 2, 17, 70 , 9, 0xffffff);
|
||||||
if (texts != null)
|
|
||||||
drawLimitedShadow(mc.fontRenderer, texts[0] + time_left + texts[1], width / 2, 17, 70 , 9, 0xffffff);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,18 +45,21 @@ public class Criminal {
|
||||||
this.last_pos = pos;
|
this.last_pos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addKill(EntityPlayer killed) {
|
public int addKill(EntityPlayer killed) {
|
||||||
JGPlayerMP jgKilled = new JGPlayerMP(killed);
|
JGPlayerMP jgKilled = new JGPlayerMP(killed);
|
||||||
jgKilled.connectBaseNBT();
|
jgKilled.connectBaseNBT();
|
||||||
int add = Math.max(jgKilled.getAlignment() - 33, 0);
|
int add = Math.max(jgKilled.getAlignment() - REDUCE_ALIGN_KILL, 0);
|
||||||
if (Main.gp.isInGalacticPatrol(killed))
|
if (Main.gp.isInGalacticPatrol(killed))
|
||||||
add *= 2;
|
add *= MULT_ALIGN_KILL_PATROL;
|
||||||
if (System.currentTimeMillis() <= Main.gp.criminals.formerInmate.getOrDefault(uuid, 0L) + TIME_FORMER_INMATE)
|
if (System.currentTimeMillis() <= Main.gp.criminals.formerInmate.getOrDefault(uuid, 0L) + TIME_FORMER_INMATE)
|
||||||
add *= 2;
|
add *= MULT_ALIGN_KILL_FORMER_INMATE;
|
||||||
|
|
||||||
|
add *= MULT_ALIGN_KILL;
|
||||||
|
|
||||||
rate += add;
|
rate += add;
|
||||||
|
|
||||||
victims_alignLoose.put(killed.getUniqueID(), add);
|
victims_alignLoose.put(killed.getUniqueID(), add);
|
||||||
|
return add;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean cancelVictim(UUID killed) {
|
public boolean cancelVictim(UUID killed) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ import JinRyuu.JRMCore.server.JGPlayerMP;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.util.ChatComponentStyle;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import xamora.gp_dbc.config.ConfigManager;
|
import xamora.gp_dbc.config.ConfigManager;
|
||||||
import xamora.gp_dbc.utils.Data;
|
import xamora.gp_dbc.utils.Data;
|
||||||
import xamora.gp_dbc.utils.PlayerUtils;
|
import xamora.gp_dbc.utils.PlayerUtils;
|
||||||
|
|
@ -15,6 +18,7 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static net.minecraft.util.StatCollector.*;
|
||||||
import static xamora.gp_dbc.Main.gp;
|
import static xamora.gp_dbc.Main.gp;
|
||||||
import static xamora.gp_dbc.config.ConfigManager.*;
|
import static xamora.gp_dbc.config.ConfigManager.*;
|
||||||
|
|
||||||
|
|
@ -48,6 +52,11 @@ public class Criminals {
|
||||||
|
|
||||||
EntityPlayer dead = (EntityPlayer) event.entity;
|
EntityPlayer dead = (EntityPlayer) event.entity;
|
||||||
Entity entityKiller = event.entityLiving.func_94060_bK();
|
Entity entityKiller = event.entityLiving.func_94060_bK();
|
||||||
|
|
||||||
|
if (entityKiller != null)
|
||||||
|
dead.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + translateToLocalFormatted("msg.kill.by",entityKiller.getClass().getSimpleName())));
|
||||||
|
else
|
||||||
|
dead.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + translateToLocalFormatted("msg.kill.by", "null")));
|
||||||
if (!(entityKiller instanceof EntityPlayer) || entityKiller.getUniqueID().equals(dead.getUniqueID()))
|
if (!(entityKiller instanceof EntityPlayer) || entityKiller.getUniqueID().equals(dead.getUniqueID()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -62,13 +71,16 @@ public class Criminals {
|
||||||
|
|
||||||
JGPlayerMP jgKilled = new JGPlayerMP(dead);
|
JGPlayerMP jgKilled = new JGPlayerMP(dead);
|
||||||
jgKilled.connectBaseNBT();
|
jgKilled.connectBaseNBT();
|
||||||
if (jgKilled.getAlignment() < 33)
|
if (jgKilled.getAlignment() < REDUCE_ALIGN_KILL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int gain_rate = 0;
|
||||||
if (isCriminal(killer.getUniqueID()))
|
if (isCriminal(killer.getUniqueID()))
|
||||||
getCriminal(killer.getUniqueID()).addKill(dead);
|
gain_rate = getCriminal(killer.getUniqueID()).addKill(dead);
|
||||||
else
|
else
|
||||||
addCriminal(killer, 0).addKill(dead);
|
gain_rate = addCriminal(killer, 0).addKill(dead);
|
||||||
|
|
||||||
|
killer.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + translateToLocalFormatted("msg.kill.gain_criminal_rate", gain_rate)));
|
||||||
|
|
||||||
Data.saveDataString(listCriminalToString(criminals), "criminals");
|
Data.saveDataString(listCriminalToString(criminals), "criminals");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import xamora.gp_dbc.config.ConfigManager;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
|
||||||
import static xamora.gp_dbc.utils.PlayerUtils.*;
|
import static xamora.gp_dbc.utils.PlayerUtils.*;
|
||||||
import static net.minecraft.util.StatCollector.translateToLocal;
|
import static net.minecraft.util.StatCollector.translateToLocal;
|
||||||
|
|
||||||
|
|
@ -155,8 +156,7 @@ public class Handcuff {
|
||||||
handcuffed.add(new Handcuffed(inmate.getUniqueID(), jailer.getUniqueID(), current_time, false));
|
handcuffed.add(new Handcuffed(inmate.getUniqueID(), jailer.getUniqueID(), current_time, false));
|
||||||
jailer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + translateToLocal("success.you_handcuffed_him")));
|
jailer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + translateToLocal("success.you_handcuffed_him")));
|
||||||
|
|
||||||
String[] texts = TextUtils.getSeparateText(translateToLocal("success.you_are_handcuffed"), "%%");
|
inmate.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + translateToLocalFormatted("success.you_are_handcuffed", ConfigManager.TIME_TO_GO_IN_JAIL)));
|
||||||
inmate.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + texts[0] + ConfigManager.TIME_TO_GO_IN_JAIL + texts[1]));
|
|
||||||
|
|
||||||
JGPlayerMP jgInmate = new JGPlayerMP(inmate);
|
JGPlayerMP jgInmate = new JGPlayerMP(inmate);
|
||||||
NBTTagCompound nbt = jgInmate.connectBaseNBT();
|
NBTTagCompound nbt = jgInmate.connectBaseNBT();
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ error.already_handcuffed=Already handcuffed
|
||||||
warning.handcuffing_you=A Galactic Patroller is handcuffing you!
|
warning.handcuffing_you=A Galactic Patroller is handcuffing you!
|
||||||
warning.handcuffing_him=You are handcuffing someone
|
warning.handcuffing_him=You are handcuffing someone
|
||||||
success.you_handcuffed_him=You have handcuffed him
|
success.you_handcuffed_him=You have handcuffed him
|
||||||
success.you_are_handcuffed=You are handcuffed, going in %% seconds
|
success.you_are_handcuffed=You are handcuffed, going in %s seconds
|
||||||
warning.going_in_jail=%% second(s) left
|
warning.going_in_jail=%s second(s) left
|
||||||
error.cancel_handcuffing=Handcuffing cancelled
|
error.cancel_handcuffing=Handcuffing cancelled
|
||||||
error.not_galactic_patrol=You are not a Galactic Patroller
|
error.not_galactic_patrol=You are not a Galactic Patroller
|
||||||
msg.unhandcuffing_someone=You are unhandcuffing...
|
msg.unhandcuffing_someone=You are unhandcuffing...
|
||||||
|
|
@ -35,6 +35,9 @@ error.criminal_try_join_galactic_patrol=You are a criminal
|
||||||
error.cant_handcuff_dead=You can't handcuff a death
|
error.cant_handcuff_dead=You can't handcuff a death
|
||||||
error.not_enough_criminal_rate=He hasn't committed enough crimes to go to jail
|
error.not_enough_criminal_rate=He hasn't committed enough crimes to go to jail
|
||||||
|
|
||||||
|
msg.kill.gain_criminal_rate=You have gained %s criminal point(s)
|
||||||
|
msg.kill.by=You have killed by %s
|
||||||
|
|
||||||
gui.jail.cell=Cell
|
gui.jail.cell=Cell
|
||||||
gui.criminal.position=No Position
|
gui.criminal.position=No Position
|
||||||
gui.criminal.rate=Crime:
|
gui.criminal.rate=Crime:
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ error.already_handcuffed=Déjà menotté
|
||||||
warning.handcuffing_you=Un Patrouilleur Galactique est en train de vous menotter !
|
warning.handcuffing_you=Un Patrouilleur Galactique est en train de vous menotter !
|
||||||
warning.handcuffing_him=Vous êtes en train de menotter quelqu'un
|
warning.handcuffing_him=Vous êtes en train de menotter quelqu'un
|
||||||
success.you_handcuffed_him=Vous l'avez menotté
|
success.you_handcuffed_him=Vous l'avez menotté
|
||||||
success.you_are_handcuffed=Vous êtes menotté, transfert dans %% secondes
|
success.you_are_handcuffed=Vous êtes menotté, transfert dans %s secondes
|
||||||
warning.going_in_jail=%% seconde(s) restantes
|
warning.going_in_jail=%s seconde(s) restantes
|
||||||
error.cancel_handcuffing=Menottage annulé
|
error.cancel_handcuffing=Menottage annulé
|
||||||
error.not_galactic_patrol=Vous n'êtes pas un Patrouilleur Galactique
|
error.not_galactic_patrol=Vous n'êtes pas un Patrouilleur Galactique
|
||||||
msg.unhandcuffing_someone=Vous êtes en train d'enlever les menottes...
|
msg.unhandcuffing_someone=Vous êtes en train d'enlever les menottes...
|
||||||
|
|
@ -35,6 +35,9 @@ error.criminal_try_join_galactic_patrol=Vous êtes un criminel
|
||||||
error.cant_handcuff_dead=Vous ne pouvez pas menotter un mort
|
error.cant_handcuff_dead=Vous ne pouvez pas menotter un mort
|
||||||
error.not_enough_criminal_rate=Il n'a pas commis suffisant de crime pour aller en prison
|
error.not_enough_criminal_rate=Il n'a pas commis suffisant de crime pour aller en prison
|
||||||
|
|
||||||
|
msg.kill.gain_criminal_rate=Vous avez gagné(e) %s point de criminalité(s)
|
||||||
|
msg.kill.by=Vous avez été tuée par %s
|
||||||
|
|
||||||
gui.jail.cell=Prison
|
gui.jail.cell=Prison
|
||||||
gui.criminal.position=Aucune Position
|
gui.criminal.position=Aucune Position
|
||||||
gui.criminal.rate=Crime:
|
gui.criminal.rate=Crime:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue