Fixed stuff and did stuff and i forgot sorry to anyone reading this
This commit is contained in:
1 parent
861d3ea2a3
commit
d45c2f9ace
13 files changed
+64
-58
No files matched your search
@@ -57,20 +57,27 @@ public class EconUser {
|
||||
{
|
||||
if (points == 0)
|
||||
return;
|
||||
if (points > 0)
|
||||
if (points > 0) {
|
||||
if (points < remove)
|
||||
points = 0;
|
||||
else
|
||||
points -= remove;
|
||||
else
|
||||
if (-points < remove)
|
||||
points = 0;
|
||||
else
|
||||
points += remove;
|
||||
} else {
|
||||
if (-points < remove)
|
||||
points = 0;
|
||||
else
|
||||
points += remove;
|
||||
}
|
||||
pointsMap.put(villagerType, points);
|
||||
if (Config.DEBUG)
|
||||
Logger.info("Removed % points from villagerType: % for %",
|
||||
String.valueOf(points), villagerType, uuid.toString());
|
||||
String.valueOf(remove), villagerType, uuid.toString());
|
||||
}
|
||||
|
||||
private void setPoints(String villagerType, int points) {
|
||||
if (pointsMap.get(villagerType) < 0)
|
||||
points *= -1;
|
||||
pointsMap.put(villagerType, points);
|
||||
}
|
||||
|
||||
public void removePoints(int remove) {
|
||||
@@ -84,7 +91,8 @@ public class EconUser {
|
||||
int remove = points;
|
||||
if (remove < 0)
|
||||
remove *= -1;
|
||||
removePoints(villagerType, points, (int) (0.9 * remove) - 10);
|
||||
int i = (int) (0.9 * remove) - 10;
|
||||
setPoints(villagerType, i < 10 && i > -10 ? 0 : i);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ public final class Price {
|
||||
private final int points;
|
||||
|
||||
private static final double[] xMult = {Integer.MIN_VALUE, -4000, -2000, -500, 500, 2000, 4000, Integer.MAX_VALUE};
|
||||
private static final double[] yMultBuy = {2.5, 1.75, 1.25, 1, 1.5, 2.5, 5};
|
||||
private static final double[] yMultSell = {5, 2.5, 1.5, 1, 1.25, 1.75, 2.5};
|
||||
private static final double[] yMultBuy = {0.4, 0.65, 0.85, 1, 1.5, 2.5, 5};
|
||||
private static final double[] yMultSell = {5, 2.5, 1.5, 1, 0.85, 0.65, 0.4};
|
||||
|
||||
public Price(double price) {
|
||||
this.price = price;
|
||||
|
||||
@@ -28,15 +28,13 @@ public class VillagerType {
|
||||
private final String displayName;
|
||||
private final Set<ItemStack> buying;
|
||||
private final Set<ItemStack> selling;
|
||||
private final double priceModifier;
|
||||
private final Villager.Profession profession;
|
||||
|
||||
public VillagerType(String name, String displayName, Set<ItemStack> buying, Set<ItemStack> selling, double priceModifier, String profession) {
|
||||
public VillagerType(String name, String displayName, Set<ItemStack> buying, Set<ItemStack> selling, String profession) {
|
||||
this.name = name;
|
||||
this.displayName = displayName;
|
||||
this.buying = buying;
|
||||
this.selling = selling;
|
||||
this.priceModifier = priceModifier;
|
||||
this.profession = Villager.Profession.valueOf(profession.toUpperCase());
|
||||
}
|
||||
|
||||
@@ -56,10 +54,6 @@ public class VillagerType {
|
||||
return selling;
|
||||
}
|
||||
|
||||
public double getPriceModifier() {
|
||||
return priceModifier;
|
||||
}
|
||||
|
||||
public Villager.Profession getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user