Quote from thehobomancrew
Thanks for the help! The !world.IsRemote solves the unlimited potion effect but it seems the integer still gives two numbers. Would this be the right way of implementing the code? Sorry if its not, I'm still learning java and the way it works...
protected void onFoodEaten(ItemStack par1ItemStack, World world, EntityPlayer par3)
{
if(!world.isRemote){
int potion = world.rand.nextInt(5)+1;
if(potion == 1){
par3.addPotionEffect(new PotionEffect(Potion.resistance.id, 100, 1, false));
System.out.println(potion);
}
if(potion == 2){
par3.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 1, false));
System.out.println(potion);
}
if(potion == 3){
par3.addPotionEffect(new PotionEffect(Potion.regeneration.id, 100, 1, false));
System.out.println(potion);
}
if(potion == 4){
par3.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 100, 1, false));
System.out.println(potion);
}
if(potion == 5){
System.out.println("No potion effect int = " + potion );
}
}
Yeah, that looks about right, though it is more efficient to either use chained else-if statements or a switch; as you wrote it, it has to check every single if statement each time the food is eaten, whereas else-if or switch it only needs to check until it finds the correct case, then stops checking:
// CHAINED ELSE-IF: if (potion == 1) { // add effect 1; } else if (potion == 2) { // add effect 2; } else if (... etc.) } else { // add last effect (#5, or whatever) } // SWITCH (my personal preference) switch(potion) { case 1: // add effect 1 break; // if you don't break, you will process every case! case 2: // add effect 2 break; // etc. default: // add default or last potion effect }
1
*Note: Topic will soon be reformatted to look better and contain all features*
*****To fix armour textures on mac, unzip mod before placing in mods folder*****
Dimensions:
"Red" Dimension:
The red dimension (doesn't have an official name yet) is a sky world. Red zombies and Chicken spawn there. Also the rare red trees spawn (be careful when walking on their leaves!)
Portal:
Dimension:
Brim Dimension:
Information Coming Soon!
Portal:
Dimension:
Blocks:
Ores:
Arsenic is a fairly common white coloured ore essential in crafting caustic diamonds
Manganite is a pink ore that doesn't have a use (yet)
Blue Lace Agate is a blue ore.
Bog Iron only spawns in Bog biomes and is pretty rare. It is essential in making the Bog armour set.
Lux ore glows in the dark and will have a use relating to XP.
(From Left to Right; Arsenic, Manganite, Blue Lace Agate, Bog Iron and Lux ore)
Other Blocks:
Green Sand spawns as the top layer of Green Beach biomes.
Turbidite is a green rock that spawns as a second layer in the Green Beach biome.
Red Dirt spawns in the "Red" biome with Red Grass (spawns particles).
Grapefruit trees are made up of logs, a sapling and bouncy leaves. They all spawn in the Red biome.
(From Left to Right; Green Sand, Turbidite, Red Dirt, Red Grass, Grapefruit Logs, Grapefruit Leaves)
Crafting & Smelting:
Caustic Sword:
Caustic Diamond:
Bog Iron Ingot:
Marsh Juggernaut Helmet:
Marsh Juggernaut Chestplate:
Marsh Juggernaut Legging:
Marsh Juggernaut Boots:
Images:
Changelog:
Pre-Alpha v1.0
*Additions*
***************
-Added Arsenic ore
-Added Manganese ore
-Added Blue Lace ore
-Added Bog Iron ore
-Added Lux ore
-Added Turbidite stone
-Added Green sand
-Added Grapefruit leaves
-Added Grapefruit log
-Added Grapefruit Sapling
-Added Red dirt
-Added Red grass
-Added Items for each ore
-Added Bog Armor
-Added Arsenic Sword
-Added Bog biome
-Added "Red" biome
-Added "Green" biome
-Added Nether chicken
-Added Ender Eater *To be removed*
-Added ore Generation to the Overworld. Bog iron only found in bogs.
-Added Grapefruit Trees to the Red biome
Downloads:
Alpha v1.1.2: http://adf.ly/nPcXM
Alpha v1.1(The dimension update): http://adf.ly/kYWpz
Pre-Alpha v1.0: http://adf.ly/gnM6L
3
Pics:
Edit: If you allow all biomes you end up with cool spikes like this:
1
Overview:
1st Floor:
2nd Floor:
3rd Floor:
Attic:
Feedback is always appreciated!
3
Front view:
Right side view:
Back view:
Left side view:
Top view:
Interior 1st floor:
2nd floor:
Roof:
Basement top story:
Basement bottom story:
Safe in basement:
Entrance to back of safe:
Escape from safe:
Feedback is always appreciated!
1
case 20:
generateBeige(world, random, chunkX * 16, chunkZ * 16);
will the ores generate properly or does the # of the case have to be 2.
And how would you add multiple biomes?
1
2
Front View
View from the gate
Up-Close of Front
Interior View
View of fountain and chandelier
View from Second story
1
1
2
-4 new blocks (fire orb ore, hotcoal block, coal storage and fire orb storage)
- 2 new armor sets (hotcoal and fire orb)
-2 new tool sets (hotcoal and fire orb) *excluding hoes
-1 new item
you can download it here:http://adf.ly/8WVlO
recipes:
coal storage: XXX,XXX,XXX X=coal
Hotcoal block: XYX,YXY,XYX X=coal Y=Fire orb
Fire orb storage: XXX,XXX,XXX X=Fire orb
Blaze rod: X,X X=Fire orb
The weapons and armor are the same recipes as usual with hotcoal and the fire orbs. The only thing that is different is you use blaze rods for
the hotcoal weapons.
Please give me suggestions .