Renamed MinecraftForge.eventBus to EVENT_BUS as it's constant.
This commit is contained in:
parent
bb0f84925e
commit
2d7deacead
7 changed files with 43 additions and 10 deletions
|
@ -1,8 +1,40 @@
|
|||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.src.*;
|
||||
import net.minecraftforge.common.ForgeHooks.GrassEntry;
|
||||
import net.minecraftforge.common.ForgeHooks.SeedEntry;
|
||||
import net.minecraftforge.event.EventBus;
|
||||
|
||||
public class MinecraftForge
|
||||
{
|
||||
public static final EventBus eventBus = new EventBus();
|
||||
/**
|
||||
* The core Forge EventBus, all events for Forge will be fired on this,
|
||||
* you should use this to register all your listeners.
|
||||
* This replaces every register*Handler() function in the old version of Forge.
|
||||
*/
|
||||
public static final EventBus EVENT_BUS = new EventBus();
|
||||
|
||||
|
||||
/** Register a new plant to be planted when bonemeal is used on grass.
|
||||
* @param block The block to place.
|
||||
* @param metadata The metadata to set for the block when being placed.
|
||||
* @param weight The weight of the plant, where red flowers are
|
||||
* 10 and yellow flowers are 20.
|
||||
*/
|
||||
public static void addGrassPlant(Block block, int metadata, int weight)
|
||||
{
|
||||
ForgeHooks.grassList.add(new GrassEntry(block, metadata, weight));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new seed to be dropped when breaking tall grass.
|
||||
*
|
||||
* @param seed The item to drop as a seed.
|
||||
* @param weight The relative probability of the seeds,
|
||||
* where wheat seeds are 10.
|
||||
*/
|
||||
public static void addGrassSeed(ItemStack seed, int weight)
|
||||
{
|
||||
ForgeHooks.seedList.add(new SeedEntry(seed, weight));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ public class OreDictionary
|
|||
ArrayList<ItemStack> ores = getOres(id);
|
||||
ore = ore.copy();
|
||||
ores.add(ore);
|
||||
MinecraftForge.eventBus.post(new OreRegisterEvent(name, ore));
|
||||
MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore));
|
||||
}
|
||||
|
||||
public static class OreRegisterEvent extends Event
|
||||
|
|
3
eclipse/.metadata/.gitignore
vendored
3
eclipse/.metadata/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
/.mylyn/
|
||||
.lock
|
||||
version.ini
|
||||
version.ini
|
||||
/*.log
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level"));
|
||||
}
|
||||
|
||||
+ MinecraftForge.eventBus.post(new ChunkDataEvent.Load(var5, par4NBTTagCompound));
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(var5, par4NBTTagCompound));
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
|||
var3.setTag("Level", var4);
|
||||
this.writeChunkToNBT(par2Chunk, par1World, var4);
|
||||
this.func_75824_a(par2Chunk.getChunkCoordIntPair(), var3);
|
||||
+ MinecraftForge.eventBus.post(new ChunkDataEvent.Save(par2Chunk, var3));
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(par2Chunk, var3));
|
||||
}
|
||||
catch (Exception var5)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
int var2 = this.item.stackSize;
|
||||
|
||||
+ EntityItemPickupEvent event = new EntityItemPickupEvent(this, par1EntityPlayer);
|
||||
+ MinecraftForge.eventBus.post(event);
|
||||
+ MinecraftForge.EVENT_BUS.post(event);
|
||||
+
|
||||
+ if (delayBeforeCanPickup == 0 && (!event.isCanceled() || item.stackSize <= 0))
|
||||
+ {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
+ int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
+
|
||||
+ ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, var6);
|
||||
+ MinecraftForge.eventBus.post(event);
|
||||
+ MinecraftForge.EVENT_BUS.post(event);
|
||||
+ if (event.isCanceled())
|
||||
+ {
|
||||
+ return;
|
||||
|
@ -36,7 +36,7 @@
|
|||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
+ ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
|
||||
+ MinecraftForge.eventBus.post(event);
|
||||
+ MinecraftForge.EVENT_BUS.post(event);
|
||||
+ if (event.isCanceled())
|
||||
+ {
|
||||
+ return event.getResultStack();
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
List var4 = var1[var3];
|
||||
this.worldObj.addLoadedEntities(var4);
|
||||
}
|
||||
+ MinecraftForge.eventBus.post(new ChunkEvent.Load(this));
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -273,7 +273,7 @@
|
|||
List var4 = var5[var3];
|
||||
this.worldObj.unloadEntities(var4);
|
||||
}
|
||||
+ MinecraftForge.eventBus.post(new ChunkEvent.Unload(this));
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue