More work on achievements
This commit is contained in:
parent
58a3fd02cd
commit
e810d974cc
7 changed files with 122 additions and 54 deletions
|
@ -25,6 +25,7 @@ import biomesoplenty.eventhandlers.FlipperMovementEventHandler;
|
||||||
import biomesoplenty.eventhandlers.FluidEventHandler;
|
import biomesoplenty.eventhandlers.FluidEventHandler;
|
||||||
import biomesoplenty.eventhandlers.VillageMaterialEventHandler;
|
import biomesoplenty.eventhandlers.VillageMaterialEventHandler;
|
||||||
import biomesoplenty.handlers.BOPCraftHandler;
|
import biomesoplenty.handlers.BOPCraftHandler;
|
||||||
|
import biomesoplenty.handlers.BOPPickupHandler;
|
||||||
import biomesoplenty.handlers.MovementHandler;
|
import biomesoplenty.handlers.MovementHandler;
|
||||||
import biomesoplenty.handlers.SoundHandler;
|
import biomesoplenty.handlers.SoundHandler;
|
||||||
import biomesoplenty.handlers.TickHandlerClient;
|
import biomesoplenty.handlers.TickHandlerClient;
|
||||||
|
@ -81,14 +82,15 @@ public class BiomesOPlenty
|
||||||
BOPEntities.init();
|
BOPEntities.init();
|
||||||
BOPVanillaCompat.init();
|
BOPVanillaCompat.init();
|
||||||
|
|
||||||
|
GameRegistry.registerCraftingHandler(new BOPCraftHandler());
|
||||||
|
GameRegistry.registerPickupHandler(new BOPPickupHandler());
|
||||||
|
|
||||||
// Achievement declaration
|
// Achievement declaration
|
||||||
if (BOPConfigurationMisc.achievements)
|
if (BOPConfigurationMisc.achievements)
|
||||||
{
|
{
|
||||||
BOPAchievements.init();
|
BOPAchievements.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRegistry.registerCraftingHandler(new BOPCraftHandler());
|
|
||||||
|
|
||||||
if (proxy instanceof ClientProxy)
|
if (proxy instanceof ClientProxy)
|
||||||
{
|
{
|
||||||
MinecraftForge.EVENT_BUS.register(new SoundHandler());
|
MinecraftForge.EVENT_BUS.register(new SoundHandler());
|
||||||
|
|
|
@ -5,13 +5,11 @@ import net.minecraft.block.BlockColored;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityCreature;
|
import net.minecraft.entity.EntityCreature;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.monster.EntityEnderman;
|
|
||||||
import net.minecraft.entity.passive.EntityChicken;
|
import net.minecraft.entity.passive.EntityChicken;
|
||||||
import net.minecraft.entity.passive.EntityCow;
|
import net.minecraft.entity.passive.EntityCow;
|
||||||
import net.minecraft.entity.passive.EntityPig;
|
import net.minecraft.entity.passive.EntityPig;
|
||||||
import net.minecraft.entity.passive.EntitySheep;
|
import net.minecraft.entity.passive.EntitySheep;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
import net.minecraft.entity.passive.EntityWolf;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
@ -31,8 +29,6 @@ import biomesoplenty.configuration.BOPAchievements;
|
||||||
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
|
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
|
||||||
import biomesoplenty.entities.ai.EntityAITemptArmour;
|
import biomesoplenty.entities.ai.EntityAITemptArmour;
|
||||||
import biomesoplenty.helpers.TeleporterPromised;
|
import biomesoplenty.helpers.TeleporterPromised;
|
||||||
import biomesoplenty.world.WorldTypeBOP;
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
|
|
||||||
public class EntityEventHandler
|
public class EntityEventHandler
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,22 @@ public class FluidEventHandler
|
||||||
{
|
{
|
||||||
ItemStack filledContainer = FluidContainerRegistry.fillFluidContainer(new FluidStack(Fluids.liquidPoisonFluid.get(), FluidContainerRegistry.BUCKET_VOLUME), event.current);
|
ItemStack filledContainer = FluidContainerRegistry.fillFluidContainer(new FluidStack(Fluids.liquidPoisonFluid.get(), FluidContainerRegistry.BUCKET_VOLUME), event.current);
|
||||||
|
|
||||||
|
if (filledContainer != null)
|
||||||
|
{
|
||||||
|
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
|
||||||
|
|
||||||
|
event.result = filledContainer;
|
||||||
|
event.setResult(Result.ALLOW);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.setResult(Result.DENY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((blockID == Fluids.honey.get().blockID) && meta == 7)
|
||||||
|
{
|
||||||
|
ItemStack filledContainer = FluidContainerRegistry.fillFluidContainer(new FluidStack(Fluids.honeyFluid.get(), FluidContainerRegistry.BUCKET_VOLUME), event.current);
|
||||||
|
|
||||||
if (filledContainer != null)
|
if (filledContainer != null)
|
||||||
{
|
{
|
||||||
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
|
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
|
||||||
|
@ -75,6 +91,13 @@ public class FluidEventHandler
|
||||||
|
|
||||||
return new ItemStack(Fluids.bopBucket.get(), 1, 1);
|
return new ItemStack(Fluids.bopBucket.get(), 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((blockID == Fluids.honey.get().blockID) && meta == 7)
|
||||||
|
{
|
||||||
|
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
|
||||||
|
|
||||||
|
return new ItemStack(Fluids.bopBucket.get(), 1, 3);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -12,52 +12,20 @@ public class BOPCraftHandler implements ICraftingHandler
|
||||||
@Override
|
@Override
|
||||||
public void onCrafting(EntityPlayer var1, ItemStack var2, IInventory var3)
|
public void onCrafting(EntityPlayer var1, ItemStack var2, IInventory var3)
|
||||||
{
|
{
|
||||||
//Scythe
|
//Plant Killer
|
||||||
if (var2 == new ItemStack(Items.scytheAmethyst.get(), 1, 0))
|
if (var2.itemID == Items.scytheAmethyst.get().itemID || var2.itemID == Items.scytheDiamond.get().itemID || var2.itemID == Items.scytheGold.get().itemID || var2.itemID == Items.scytheIron.get().itemID || var2.itemID == Items.scytheStone.get().itemID || var2.itemID == Items.scytheWood.get().itemID || var2.itemID == Items.scytheMud.get().itemID)
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.scytheDiamond.get(), 1, 0))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.scytheGold.get(), 1, 0))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.scytheIron.get(), 1, 0))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.scytheWood.get(), 1, 0))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.scytheMud.get(), 1, 0))
|
|
||||||
{
|
{
|
||||||
var1.addStat(BOPAchievements.achScythe, 1);
|
var1.addStat(BOPAchievements.achScythe, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Dart Blower
|
//Full Auto
|
||||||
if (var2 == new ItemStack(Items.dartBlower.get(), 1, 0))
|
if (var2.itemID == Items.dartBlower.get().itemID)
|
||||||
{
|
{
|
||||||
var1.addStat(BOPAchievements.achDartBlower, 1);
|
var1.addStat(BOPAchievements.achDartBlower, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Flower Band
|
//Flower Power
|
||||||
if (var2 == new ItemStack(Items.flowerBand.get(), 1, 0))
|
if (var2.itemID == Items.flowerBand.get().itemID)
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achFlowerBand, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.flowerBand.get(), 1, 1))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achFlowerBand, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.flowerBand.get(), 1, 2))
|
|
||||||
{
|
|
||||||
var1.addStat(BOPAchievements.achFlowerBand, 1);
|
|
||||||
}
|
|
||||||
if (var2 == new ItemStack(Items.flowerBand.get(), 1, 3))
|
|
||||||
{
|
{
|
||||||
var1.addStat(BOPAchievements.achFlowerBand, 1);
|
var1.addStat(BOPAchievements.achFlowerBand, 1);
|
||||||
}
|
}
|
||||||
|
|
72
common/biomesoplenty/handlers/BOPPickupHandler.java
Normal file
72
common/biomesoplenty/handlers/BOPPickupHandler.java
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
package biomesoplenty.handlers;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import biomesoplenty.api.Blocks;
|
||||||
|
import biomesoplenty.api.Fluids;
|
||||||
|
import biomesoplenty.api.Items;
|
||||||
|
import biomesoplenty.configuration.BOPAchievements;
|
||||||
|
import cpw.mods.fml.common.IPickupNotifier;
|
||||||
|
|
||||||
|
public class BOPPickupHandler implements IPickupNotifier
|
||||||
|
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void notifyPickup(EntityItem item, EntityPlayer player)
|
||||||
|
{
|
||||||
|
//Flower Child
|
||||||
|
if (item.getEntityItem().itemID == Blocks.flowers.get().blockID || item.getEntityItem().itemID == Blocks.flowers2.get().blockID || item.getEntityItem().itemID == Block.plantRed.blockID || item.getEntityItem().itemID == Block.plantYellow.blockID)
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achFlower, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Berry Picking
|
||||||
|
if (item.getEntityItem().itemID == Items.food.get().itemID && (item.getEntityItem().getItemDamage() == 0))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achBerry, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Rather Thorny
|
||||||
|
if (item.getEntityItem().itemID == Blocks.plants.get().blockID && (item.getEntityItem().getItemDamage() == 5))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achThorn, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//A Rolling Stone
|
||||||
|
if (item.getEntityItem().itemID == Blocks.moss.get().blockID)
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achMoss, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Nutritious
|
||||||
|
if (item.getEntityItem().itemID == Blocks.coral.get().blockID && (item.getEntityItem().getItemDamage() > 3))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achCoral, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Decay
|
||||||
|
if (item.getEntityItem().itemID == Blocks.plants.get().blockID && (item.getEntityItem().getItemDamage() == 13))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achWitherWart, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Gravedigger
|
||||||
|
if (item.getEntityItem().itemID == Blocks.grave.get().blockID)
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achGrave, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Phantom Menace
|
||||||
|
if (item.getEntityItem().itemID == Items.miscItems.get().itemID && (item.getEntityItem().getItemDamage() == 16))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achPhantom, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Blue Sky
|
||||||
|
if (item.getEntityItem().itemID == Items.miscItems.get().itemID && (item.getEntityItem().getItemDamage() == 4))
|
||||||
|
{
|
||||||
|
player.addStat(BOPAchievements.achCelestial, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -172,6 +172,10 @@ public class ItemBOPBucket extends Item
|
||||||
par1World.spawnParticle("largesmoke", par8 + Math.random(), par9 + Math.random(), par10 + Math.random(), 0.0D, 0.0D, 0.0D);
|
par1World.spawnParticle("largesmoke", par8 + Math.random(), par9 + Math.random(), par10 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (isFull == Fluids.honey.get().blockID)
|
||||||
|
{
|
||||||
|
par1World.setBlock(par8, par9, par10, isFull, 7, 3);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
par1World.setBlock(par8, par9, par10, isFull, 0, 3);
|
par1World.setBlock(par8, par9, par10, isFull, 0, 3);
|
||||||
|
|
|
@ -371,12 +371,15 @@ item.bop.flippers.name=Flippers
|
||||||
item.bop.bopBucket.amethyst_empty.name=Amethyst Bucket
|
item.bop.bopBucket.amethyst_empty.name=Amethyst Bucket
|
||||||
item.bop.bopBucket.amethyst_spring_water.name=Spring Water Amethyst Bucket
|
item.bop.bopBucket.amethyst_spring_water.name=Spring Water Amethyst Bucket
|
||||||
item.bop.bopBucket.liquid_poison.name=Liquid Poison Bucket
|
item.bop.bopBucket.liquid_poison.name=Liquid Poison Bucket
|
||||||
|
item.bop.bopBucket.honey.name=Honey Bucket
|
||||||
|
|
||||||
tile.bop.liquidPoison.name=Liquid Poison
|
tile.bop.liquidPoison.name=Liquid Poison
|
||||||
tile.bop.springWater.name=Spring Water
|
tile.bop.springWater.name=Spring Water
|
||||||
|
tile.bop.honey.name=Honey
|
||||||
|
|
||||||
fluid.bop.liquidPoison=Liquid Poison
|
fluid.bop.liquidPoison=Liquid Poison
|
||||||
fluid.bop.springWater=Spring Water
|
fluid.bop.springWater=Spring Water
|
||||||
|
fluid.bop.honey.name=Honey
|
||||||
|
|
||||||
phrase.bop.promisedPortalOverworld=A gateway to the Promised Land has appeared in the sky above.
|
phrase.bop.promisedPortalOverworld=A gateway to the Promised Land has appeared in the sky above.
|
||||||
phrase.bop.promisedPortalOther=A gateway to the Overworld has appeared in the sky above.
|
phrase.bop.promisedPortalOther=A gateway to the Overworld has appeared in the sky above.
|
||||||
|
|
Loading…
Reference in a new issue