Air Orb no longer allows fall damage when in inventory. Trying to get it to only do so when held, couldn't :c
This commit is contained in:
parent
a577c3bcd0
commit
ff0ea9f5cb
5 changed files with 24 additions and 6 deletions
|
|
@ -1,10 +1,9 @@
|
|||
package MysticOres;
|
||||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
|
||||
public class IridiumFuel implements IFuelHandler {
|
||||
public class IridiumFuelHandler implements IFuelHandler {
|
||||
public int getBurnTime(ItemStack fuel)
|
||||
{
|
||||
if(fuel.getItemDamage() == 4)
|
||||
|
|
@ -7,6 +7,7 @@ import MysticOres.Blocks.BlockHandler;
|
|||
import MysticOres.Blocks.BlockOres;
|
||||
import MysticOres.Blocks.BlockReinforcedGlass;
|
||||
import MysticOres.Blocks.ItemBlockOres;
|
||||
import MysticOres.Items.IridiumFuelHandler;
|
||||
import MysticOres.Items.ItemAxes;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import MysticOres.Items.ItemHoes;
|
||||
|
|
@ -75,7 +76,7 @@ public class MysticOres
|
|||
{
|
||||
BlockHandler.init();
|
||||
ItemHandler.init();
|
||||
GameRegistry.registerFuelHandler(new IridiumFuel());
|
||||
GameRegistry.registerFuelHandler(new IridiumFuelHandler());
|
||||
RecipeManager.init();
|
||||
OreDictManager.init();
|
||||
WorldGenHandler.init();
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ public class ItemOrbAir extends Item {
|
|||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
world.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
|
||||
|
||||
if (entityPlayer.onGround)
|
||||
{
|
||||
entityPlayer.addVelocity(0, 2.5, 0);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,20 +12,24 @@ import MysticWorld.WorldGen.*;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.Mod.ServerStarted;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
|
|
@ -62,7 +66,7 @@ public class MysticWorld
|
|||
proxy.registerRenders();
|
||||
|
||||
this.tickHandler = new TickHandler();
|
||||
|
||||
|
||||
TickRegistry.registerTickHandler(this.tickHandler, Side.SERVER);
|
||||
VillagerRegistry.instance().registerVillagerType(98943, "/mods/MysticTextures/textures/mob/MysticVillager.png");
|
||||
VillagerRegistry.instance().registerVillageTradeHandler(98943, new MysticVillagerTrades());
|
||||
|
|
@ -79,4 +83,13 @@ public class MysticWorld
|
|||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
@ServerStarted
|
||||
public void startedInit(FMLServerStartedEvent event, EntityPlayer player)
|
||||
{
|
||||
if (player.username.equals("oitsjustjose") || !player.username.equals("oitsjustjose"))
|
||||
{
|
||||
player.addChatMessage("Welcome " + player.username + " to your world!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ public class TickHandler implements IScheduledTickHandler
|
|||
if (inventory.hasItem(ItemHandler$1.fireOrb.itemID) && player.isBurning()){
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||
}
|
||||
|
||||
if (inventory.hasItem(ItemHandler$1.airOrb.itemID) && player.getHeldItem() == new ItemStack(ItemHandler$1.airOrb)){
|
||||
player.fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData){
|
||||
|
|
|
|||
Loading…
Reference in a new issue