mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
Inital patch update for 1.7.2, Doesn't compile, not done yet.
This commit is contained in:
1 parent
cd34090eb8
commit
a6c45a7ade
273 files changed
+6887
-8037
No files matched your search
@@ -4,17 +4,19 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingPackSizeEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent.AllowDespawn;
|
||||
@@ -118,4 +120,9 @@ public class ForgeEventFactory
|
||||
MinecraftForge.EVENT_BUS.post(summonEvent);
|
||||
return summonEvent;
|
||||
}
|
||||
|
||||
public static boolean onEntityStruckByLightning(Entity entity, EntityLightningBolt bolt)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new EntityStruckByLightningEvent(entity, bolt));
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,15 @@ package net.minecraftforge.event;
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
@Cancelable
|
||||
public class ServerChatEvent extends Event
|
||||
{
|
||||
public final String message, username;
|
||||
public final EntityPlayerMP player;
|
||||
public ChatMessageComponent component;
|
||||
public ServerChatEvent(EntityPlayerMP player, String message, ChatMessageComponent component)
|
||||
public ChatComponentTranslation component;
|
||||
public ServerChatEvent(EntityPlayerMP player, String message, ChatComponentTranslation component)
|
||||
{
|
||||
super();
|
||||
this.message = message;
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.minecraftforge.event.entity.player;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -20,18 +21,18 @@ public class BonemealEvent extends PlayerEvent
|
||||
*/
|
||||
|
||||
public final World world;
|
||||
public final int ID;
|
||||
public final int X;
|
||||
public final int Y;
|
||||
public final int Z;
|
||||
public final Block block;
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
|
||||
public BonemealEvent(EntityPlayer player, World world, int id, int x, int y, int z)
|
||||
public BonemealEvent(EntityPlayer player, World world, Block block, int x, int y, int z)
|
||||
{
|
||||
super(player);
|
||||
this.world = world;
|
||||
this.ID = id;
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Z = z;
|
||||
this.block = block;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package net.minecraftforge.event.terraingen;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeDecorator;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.event.*;
|
||||
@@ -30,19 +32,6 @@ public class BiomeEvent extends Event
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockReplacement extends BiomeEvent
|
||||
{
|
||||
public final int original;
|
||||
public int replacement;
|
||||
|
||||
public BlockReplacement(BiomeGenBase biome, int original, int replacement)
|
||||
{
|
||||
super(biome);
|
||||
this.original = original;
|
||||
this.replacement = replacement;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BiomeColor extends BiomeEvent
|
||||
{
|
||||
public final int originalColor;
|
||||
@@ -60,14 +49,20 @@ public class BiomeEvent extends Event
|
||||
* This event is fired when the village generator attempts to choose a block ID
|
||||
* based on the village's biome.
|
||||
*
|
||||
* You can set the result to DENY to prevent the default block ID selection.
|
||||
* You can cancel the event to override default values
|
||||
*/
|
||||
@HasResult
|
||||
public static class GetVillageBlockID extends BlockReplacement
|
||||
public static class GetVillageBlockID extends BiomeEvent
|
||||
{
|
||||
public GetVillageBlockID(BiomeGenBase biome, int original, int replacement)
|
||||
public final Block original;
|
||||
public final int type;
|
||||
public Block replacement;
|
||||
|
||||
public GetVillageBlockID(BiomeGenBase biome, Block original, int type)
|
||||
{
|
||||
super(biome, original, replacement);
|
||||
super(biome);
|
||||
this.original = original;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,11 +73,17 @@ public class BiomeEvent extends Event
|
||||
* You can set the result to DENY to prevent the default block metadata selection.
|
||||
*/
|
||||
@HasResult
|
||||
public static class GetVillageBlockMeta extends BlockReplacement
|
||||
public static class GetVillageBlockMeta extends BiomeEvent
|
||||
{
|
||||
public GetVillageBlockMeta(BiomeGenBase biome, int original, int replacement)
|
||||
public final Block original;
|
||||
public final int type;
|
||||
public int replacement;
|
||||
|
||||
public GetVillageBlockMeta(BiomeGenBase biome, Block original, int type)
|
||||
{
|
||||
super(biome, original, replacement);
|
||||
super(biome);
|
||||
this.original = original;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraftforge.event.terraingen;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraftforge.event.*;
|
||||
@@ -26,10 +27,10 @@ public class ChunkProviderEvent extends Event
|
||||
{
|
||||
public final int chunkX;
|
||||
public final int chunkZ;
|
||||
public final byte[] blockArray;
|
||||
public final Block[] blockArray;
|
||||
public final BiomeGenBase[] biomeArray;
|
||||
|
||||
public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, byte[] blockArray, BiomeGenBase[] biomeArray)
|
||||
public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, BiomeGenBase[] biomeArray)
|
||||
{
|
||||
super(chunkProvider);
|
||||
this.chunkX = chunkX;
|
||||
|
||||
@@ -10,20 +10,19 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
public class DeferredBiomeDecorator extends BiomeDecorator {
|
||||
private BiomeDecorator wrapped;
|
||||
|
||||
public DeferredBiomeDecorator(BiomeGenBase biomeGenBase, BiomeDecorator wrappedOriginal)
|
||||
public DeferredBiomeDecorator(BiomeDecorator wrappedOriginal)
|
||||
{
|
||||
super(biomeGenBase);
|
||||
this.wrapped = wrappedOriginal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
public void func_150512_a(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4)
|
||||
{
|
||||
fireCreateEventAndReplace();
|
||||
fireCreateEventAndReplace(biome);
|
||||
// On first call to decorate, we fire and substitute ourselves, if we haven't already done so
|
||||
biome.theBiomeDecorator.decorate(par1World, par2Random, par3, par4);
|
||||
biome.theBiomeDecorator.func_150512_a(par1World, par2Random, biome, par3, par4);
|
||||
}
|
||||
public void fireCreateEventAndReplace()
|
||||
public void fireCreateEventAndReplace(BiomeGenBase biome)
|
||||
{
|
||||
// Copy any configuration from us to the real instance.
|
||||
wrapped.bigMushroomsPerChunk = bigMushroomsPerChunk;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class OreGenEvent extends Event
|
||||
@HasResult
|
||||
public static class GenerateMinable extends OreGenEvent
|
||||
{
|
||||
public static enum EventType { COAL, DIAMOND, DIRT, GOLD, GRAVEL, IRON, LAPIS, REDSTONE, CUSTOM }
|
||||
public static enum EventType { COAL, DIAMOND, DIRT, GOLD, GRAVEL, IRON, LAPIS, REDSTONE, QUARTZ, CUSTOM }
|
||||
|
||||
public final EventType type;
|
||||
public final WorldGenerator generator;
|
||||
|
||||
@@ -4,12 +4,12 @@ import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
public class BlockEvent extends Event {
|
||||
public final int x;
|
||||
@@ -73,14 +73,14 @@ public class BlockEvent extends Event {
|
||||
super(x, y, z, world, block, blockMetadata);
|
||||
this.player = player;
|
||||
|
||||
if (block == null || !player.canHarvestBlock(block) || // Handle empty block or player unable to break block scenario
|
||||
if (block == null || !ForgeHooks.canHarvestBlock(block, player, blockMetadata) || // Handle empty block or player unable to break block scenario
|
||||
block.canSilkHarvest(world, player, x, y, z, blockMetadata) && EnchantmentHelper.getSilkTouchModifier(player)) // If the block is being silk harvested, the exp dropped is 0
|
||||
{
|
||||
this.exp = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int meta = block.getDamageValue(world, x, y, z);
|
||||
int meta = block.func_149643_k(world, x, y, z);
|
||||
int bonusLevel = EnchantmentHelper.getFortuneModifier(player);
|
||||
this.exp = block.getExpDrop(world, meta, bonusLevel);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package net.minecraftforge.event.world;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.management.PlayerInstance;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
public class ChunkWatchEvent extends Event
|
||||
|
||||
@@ -8,7 +8,7 @@ import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
|
||||
|
||||
public class WorldEvent extends Event
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user