Skip to content

Commit

Permalink
Merge pull request #45 from ataranlen/1.76-dev
Browse files Browse the repository at this point in the history
1.76.5 dev
  • Loading branch information
ataranlen committed May 20, 2016
2 parents 01e1ebf + 5f409e9 commit 854ba56
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 17 deletions.
Binary file not shown.
Binary file modified civcraft/bin/com/avrgaming/civcraft/object/Town.class
Binary file not shown.
Binary file modified civcraft/bin/com/avrgaming/civcraft/structure/Market.class
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion civcraft/bin/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CivCraft
main: com.avrgaming.civcraft.main.CivCraft
softdepends: [TitleAPI]
version: 1.76.4
version: 1.76.5

commands:
town:
Expand Down
2 changes: 1 addition & 1 deletion civcraft/data/materials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4217,7 +4217,7 @@ materials:
- name: 'AllowBlockPlace'
ingredients:
- type_id: 0
custom_id: 'mat_carbide_steel_ingot'
custom_id: 'mat_steel_ingot'
data: 0
letter: 's'
- type_id: 54
Expand Down
8 changes: 4 additions & 4 deletions civcraft/data/techs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ techs:
- id: 'tech_taxation'
name: 'Taxation'
beaker_cost: 5000.0
cost: 40000.0
cost: 15000.0
points: 2500
require_techs: 'tech_sailing'
era: 2
Expand Down Expand Up @@ -312,7 +312,7 @@ techs:
beaker_cost: 10000.0
cost: 40000.0
points: 2500
require_techs: 'tech_commerce:tech_artillery'
require_techs: 'tech_commerce:tech_exploration'
era: 2

- id: 'tech_currency'
Expand Down Expand Up @@ -532,8 +532,8 @@ techs:
#Information era
- id: 'tech_enlightenment'
name: 'Enlightenment'
beaker_cost: 7500000.0
cost: 50000000.0
beaker_cost: 3500000.0
cost: 15000000.0
points: 375000
require_techs: 'tech_military_science:tech_refrigeration:tech_plastics'
era: 7
Expand Down
2 changes: 1 addition & 1 deletion civcraft/localization/default_lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Temple: "Temple Rate:"
baseCulture: "base Culture:"
baseUpkeep: "Base Upkeep:"
LastResult: "Last Result:"
hammersPerTile: "hammers per tile:"
hammersPerTile: "hammers added:"
SubTotal: "Sub Total:"
StructureUpkeep: "Structure Upkeep:"
Civilization: "Civilization:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ public void mine_cmd() throws CivException {
out.add(color+CivSettings.localize.localizedString("cmd_town_info_mineName")+" ("+struct.getCorner()+")");
out.add(CivColor.Green+" "+CivSettings.localize.localizedString("Level")+" "+CivColor.Yellow+mine.getLevel()+
CivColor.Green+" "+CivSettings.localize.localizedString("count")+" "+CivColor.Yellow+"("+mine.getCount()+"/"+mine.getMaxCount()+")");
out.add(CivColor.Green+" "+CivSettings.localize.localizedString("hammersPerTile")+" "+CivColor.Yellow+mine.getHammersPerTile()+
CivColor.Green+" "+CivSettings.localize.localizedString("LastResult")+" "+CivColor.Yellow+mine.getLastResult().name());
out.add(CivColor.Green+" "+CivSettings.localize.localizedString("hammersPerTile")+" "+CivColor.Yellow+mine.getBonusHammers());
out.add(CivColor.Green+" "+CivSettings.localize.localizedString("LastResult")+" "+CivColor.Yellow+mine.getLastResult().name());

total += mine.getHammersPerTile()*9; //XXX estimate based on tile radius of 1.
total += mine.getBonusHammers(); //XXX estimate based on tile radius of 1.

}
out.add(CivColor.Green+"----------------------------");
Expand Down
5 changes: 5 additions & 0 deletions civcraft/src/com/avrgaming/civcraft/object/Town.java
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,11 @@ public int getStructureTypeCount(String id) {
count++;
}
}
for (Wonder wonder : this.wonders.values()) {
if (wonder.getConfigId().equalsIgnoreCase(id)) {
count++;
}
}
return count;
}

Expand Down
15 changes: 11 additions & 4 deletions civcraft/src/com/avrgaming/civcraft/structure/Market.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void globalSignUpdate(int id) {
try {
market.setSignText(sign, item);
} catch (ClassCastException e) {
CivLog.error("Can't cast structure sign to sign for market update.");
CivLog.error("Can't cast structure sign to sign for market update. "+sign.getCoord().getX()+" "+sign.getCoord().getY()+" "+sign.getCoord().getZ());
continue;
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public void processSignAction(Player player, StructureSign sign, PlayerInteractE
Market.globalSignUpdate(id);
}

public void setSignText(StructureSign sign, ConfigMarketItem item) {
public void setSignText(StructureSign sign, ConfigMarketItem item) throws ClassCastException {

String itemColor;
switch (item.lastaction) {
Expand All @@ -153,45 +153,52 @@ public void setSignText(StructureSign sign, ConfigMarketItem item) {
Sign s;
switch (sign.getAction().toLowerCase()) {
case "sellbig":
if (sign.getCoord().getBlock().getState() instanceof Sign) {
s = (Sign)sign.getCoord().getBlock().getState();
s.setLine(0, ChatColor.BOLD+CivSettings.localize.localizedString("market_sign_sellBulk"));
s.setLine(1, item.name);
s.setLine(2, itemColor+item.getSellCostForAmount(BULK_AMOUNT)+" "+CivSettings.CURRENCY_NAME);
s.setLine(3, CivSettings.localize.localizedString("var_market_sign_amount",BULK_AMOUNT));
s.update();
}
break;
case "sell":
if (sign.getCoord().getBlock().getState() instanceof Sign) {
s = (Sign)sign.getCoord().getBlock().getState();
s.setLine(0, ChatColor.BOLD+CivSettings.localize.localizedString("market_sign_sell"));
s.setLine(1, item.name);
s.setLine(2, itemColor+item.getSellCostForAmount(1)+" "+CivSettings.CURRENCY_NAME);
s.setLine(3, CivSettings.localize.localizedString("var_market_sign_amount",1));
s.update();
}
break;
case "buy":
if (sign.getCoord().getBlock().getState() instanceof Sign) {
s = (Sign)sign.getCoord().getBlock().getState();
s.setLine(0, ChatColor.BOLD+CivSettings.localize.localizedString("market_sign_buy"));
s.setLine(1, item.name);
s.setLine(2, itemColor+item.getBuyCostForAmount(1)+" "+CivSettings.CURRENCY_NAME);
s.setLine(3, CivSettings.localize.localizedString("var_market_sign_amount",1));
s.update();
}
break;
case "buybig":
if (sign.getCoord().getBlock().getState() instanceof Sign) {
s = (Sign)sign.getCoord().getBlock().getState();
s.setLine(0, ChatColor.BOLD+CivSettings.localize.localizedString("market_sign_buyBulk"));
s.setLine(1, item.name);
s.setLine(2, itemColor+item.getBuyCostForAmount(BULK_AMOUNT)+" "+CivSettings.CURRENCY_NAME);
s.setLine(3, CivSettings.localize.localizedString("var_market_sign_amount",BULK_AMOUNT));
s.update();
}
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}

private void buildSign(String action, Integer id, BlockCoord absCoord,
ConfigMarketItem item, SimpleBlock commandBlock) {
private void buildSign(String action, Integer id, BlockCoord absCoord, ConfigMarketItem item, SimpleBlock commandBlock) {
Block b = absCoord.getBlock();

ItemManager.setTypeIdAndData(b, ItemManager.getId(Material.WALL_SIGN), (byte)commandBlock.getData(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ public void onDestroy() {

@Override
protected void removeBuffs() {
this.removeBuffFromTown(this.getTown(), "buff_notre_dame_no_anarchy");
this.removeBuffFromCiv(this.getCiv(), "buff_notre_dame_no_anarchy");
this.removeBuffFromTown(this.getTown(), "buff_notre_dame_coins_from_peace");
this.removeBuffFromTown(this.getTown(), "buff_notre_dame_extra_war_penalty");
}

@Override
protected void addBuffs() {
this.addBuffToTown(this.getTown(), "buff_notre_dame_no_anarchy");
this.addBuffToCiv(this.getCiv(), "buff_notre_dame_no_anarchy");
this.addBuffToTown(this.getTown(), "buff_notre_dame_coins_from_peace");
this.addBuffToTown(this.getTown(), "buff_notre_dame_extra_war_penalty");

Expand Down
9 changes: 9 additions & 0 deletions civcraft/src/com/avrgaming/sls/SLSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,25 @@ public static void init() throws CivException, InvalidConfiguration {
if (serverName.contains(";")) {
throw new CivException("Cannot have a server name with a ';' in it.");
}
if (serverName.contains("<") && serverName.contains(">")) {
serverName = serverName.replaceAll("[<>]", "");
}

serverDescription = CivSettings.getStringBase("server_description");
if (serverDescription.contains(";")) {
throw new CivException("Cannot have a server description with a ';' in it.");
}
if (serverDescription.contains("<") && serverDescription.contains(">")) {
serverDescription = serverDescription.replaceAll("[<>]", "");
}

serverAddress = CivSettings.getStringBase("server_address");
if (serverAddress.contains(";")) {
throw new CivException("Cannot have a server address with a ';' in it.");
}
if (serverAddress.contains("<") && serverAddress.contains(">")) {
serverAddress = serverAddress.replaceAll("[<>]", "");
}

serverURL = CivSettings.getStringBase("server_url");
if (serverURL.contains(";")) {
Expand Down
2 changes: 1 addition & 1 deletion civcraft/src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CivCraft
main: com.avrgaming.civcraft.main.CivCraft
softdepends: [TitleAPI]
version: 1.76.4
version: 1.76.5

commands:
town:
Expand Down

0 comments on commit 854ba56

Please sign in to comment.