Merge pull request #278 from Glitchfinder/master

Basic update for 1.4.2
This commit is contained in:
Grant 2012-10-29 10:25:29 -07:00
commit fa96a6beec
5 changed files with 76 additions and 0 deletions

View File

@ -165,6 +165,8 @@ public class Config extends ConfigLoader {
public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); } public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); } public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
public int getHerbalismXPCocoa() { return config.getInt("Experience.Herbalism.Cocoa",30); } public int getHerbalismXPCocoa() { return config.getInt("Experience.Herbalism.Cocoa",30); }
public int getHerbalismXPCarrot() { return config.getInt("Experience.Herbalism.Carrot",30); }
public int getHerbalismXPPotato() { return config.getInt("Experience.Herbalism.Potato",30); }
public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); } public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); }
public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); } public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); }
@ -183,6 +185,8 @@ public class Config extends ConfigLoader {
public boolean getWaterLiliesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Water_Lilies", true); } public boolean getWaterLiliesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Water_Lilies", true); }
public boolean getYellowFlowersDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Yellow_Flowers", true); } public boolean getYellowFlowersDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Yellow_Flowers", true); }
public boolean getCocoaDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cocoa", true); } public boolean getCocoaDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cocoa", true); }
public boolean getCarrotDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Carrot", true); }
public boolean getPotatoDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Potato", true); }
public boolean herbalismDoubleDropsDisabled() { public boolean herbalismDoubleDropsDisabled() {
ConfigurationSection section = config.getConfigurationSection("Double_Drops.Herbalism"); ConfigurationSection section = config.getConfigurationSection("Double_Drops.Herbalism");

View File

@ -284,6 +284,35 @@ public class EntityListener implements Listener {
rankChange = 200; rankChange = 200;
break; break;
case CARROT_ITEM:
/* CARROT RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @ 1000 */
rankChange = 200;
break;
case POTATO_ITEM:
/* POTATO RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
rankChange = 400;
break;
case BAKED_POTATO:
/* BAKED POTATO RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ 1000 */
rankChange = 200;
break;
case POISONOUS_POTATO:
/* POISONOUS POTATO RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
rankChange = 400;
break;
case GOLDEN_CARROT:
/* GOLDEN CARROT RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ 1000 */
rankChange = 200;
break;
case PUMPKIN_PIE:
/* PUMPKIN PIE RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ 1000 */
rankChange = 200;
break;
default: default:
return; return;
} }

View File

@ -201,6 +201,20 @@ public class Herbalism {
} }
break; break;
case CARROT:
if (((byte) data) == 0x3) {
mat = Material.CARROT;
xp = Config.getInstance().getHerbalismXPCarrot();
}
break;
case POTATO:
if (((byte) data) == 0x3) {
mat = Material.POTATO;
xp = Config.getInstance().getHerbalismXPPotato();
}
break;
default: default:
if (Config.getInstance().getBlockModsEnabled() && CustomBlocksConfig.getInstance().customHerbalismBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { if (Config.getInstance().getBlockModsEnabled() && CustomBlocksConfig.getInstance().customHerbalismBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) {
customPlant = true; customPlant = true;
@ -223,6 +237,13 @@ public class Herbalism {
if (mat == Material.COCOA) { if (mat == Material.COCOA) {
is = new ItemStack(Material.INK_SACK, 1, (short) 3); is = new ItemStack(Material.INK_SACK, 1, (short) 3);
} }
else if (mat == Material.COCOA) {
is = new ItemStack(Material.CARROT_ITEM, 1, (short) 0);
}
else if (mat == Material.COCOA) {
is = new ItemStack(Material.POTATO_ITEM, 1, (short) 0);
}
else { else {
is = new ItemStack(mat); is = new ItemStack(mat);
} }
@ -306,6 +327,18 @@ public class Herbalism {
} }
break; break;
case CARROT:
if (configInstance.getCarrotDoubleDropsEnabled()) {
Misc.dropItem(location, is);
}
break;
case POTATO:
if (configInstance.getPotatoDoubleDropsEnabled()) {
Misc.dropItem(location, is);
}
break;
default: default:
if (customPlant) { if (customPlant) {
CustomBlock customBlock = ModChecks.getCustomBlock(block); CustomBlock customBlock = ModChecks.getCustomBlock(block);

View File

@ -54,6 +54,8 @@ public class BlockChecks {
case YELLOW_FLOWER: case YELLOW_FLOWER:
case COCOA: case COCOA:
case EMERALD_ORE: case EMERALD_ORE:
case CARROT:
case POTATO:
return true; return true;
default: default:
@ -98,6 +100,8 @@ public class BlockChecks {
case WALL_SIGN: case WALL_SIGN:
case WOODEN_DOOR: case WOODEN_DOOR:
case WORKBENCH: case WORKBENCH:
case BEACON:
case ANVIL:
return false; return false;
default: default:
@ -179,6 +183,8 @@ public class BlockChecks {
case WATER_LILY: case WATER_LILY:
case YELLOW_FLOWER: case YELLOW_FLOWER:
case COCOA: case COCOA:
case CARROT:
case POTATO:
return true; return true;
case CROPS: case CROPS:

View File

@ -198,6 +198,8 @@ Double_Drops:
Wheat: true Wheat: true
Yellow_Flowers: true Yellow_Flowers: true
Cocoa: true Cocoa: true
Carrot: true
Potato: true
Mining: Mining:
Coal: true Coal: true
Diamond: true Diamond: true
@ -267,6 +269,8 @@ Experience:
Lily_Pads: 100 Lily_Pads: 100
Vines: 10 Vines: 10
Cocoa: 30 Cocoa: 30
Carrot: 50
Potato: 50
Mining: Mining:
Sandstone: 30 Sandstone: 30
Glowstone: 30 Glowstone: 30