diff --git a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java
index 713849848e..6d31021ea4 100644
--- a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java
+++ b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java
@@ -176,11 +176,13 @@ public class BlockSnapshot
IBlockState current = getCurrentBlock();
IBlockState replaced = getReplacedBlock();
+ int flags = notifyNeighbors ? Constants.BlockFlags.DEFAULT : Constants.BlockFlags.SEND_TO_CLIENTS;
+
if (current != replaced)
{
if (force)
{
- world.setBlockState(pos, replaced, notifyNeighbors ? 3 : 2);
+ world.setBlockState(pos, replaced, flags);
}
else
{
@@ -188,8 +190,8 @@ public class BlockSnapshot
}
}
- world.setBlockState(pos, replaced, notifyNeighbors ? 3 : 2);
- world.notifyBlockUpdate(pos, current, replaced, notifyNeighbors ? 3 : 2);
+ world.setBlockState(pos, replaced, flags);
+ world.notifyBlockUpdate(pos, current, replaced, flags);
TileEntity te = null;
if (getNbt() != null)
diff --git a/src/main/java/net/minecraftforge/common/util/Constants.java b/src/main/java/net/minecraftforge/common/util/Constants.java
index 7d6c40bfb1..c66197dc82 100644
--- a/src/main/java/net/minecraftforge/common/util/Constants.java
+++ b/src/main/java/net/minecraftforge/common/util/Constants.java
@@ -19,6 +19,9 @@
package net.minecraftforge.common.util;
+import net.minecraft.block.Block;
+import net.minecraft.entity.ai.attributes.ModifiableAttributeInstance;
+
/**
* A class containing constants for magic numbers used in the minecraft codebase.
* Everything here should be checked each update, and have a comment relating to where to check it.
@@ -26,9 +29,9 @@ package net.minecraftforge.common.util;
public class Constants
{
/**
- * NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
+ * NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
* table used in NBTBase.func_150283_g
- *
+ *
* Main use is checking tag type in NBTTagCompound.contains(String, int)
*
*/
@@ -49,4 +52,170 @@ public class Constants
public static final int TAG_LONG_ARRAY = 12;
public static final int TAG_ANY_NUMERIC = 99;
}
+
+ /**
+ * The world event IDS, used when calling {@link net.minecraft.world.World#playEvent(net.minecraft.entity.player.EntityPlayer, int, net.minecraft.util.math.BlockPos, int)}.
+ * Can be found from {@link net.minecraft.client.renderer.RenderGlobal#playEvent}
+ * Some of the events use the {@code data} parameter. If this is the case, an explanation of what {@code data} does is also provided
+ */
+ public static class WorldEvents {
+ public static final int DISPENSER_DISPENSE_SOUND = 1000;
+ public static final int DISPENSER_FAIL_SOUND = 1001;
+ /**
+ * Like DISPENSER_DISPENSE_SOUND, but for items that are fired (arrows, eggs, snowballs)
+ */
+ public static final int DISPENSER_LAUNCH_SOUND = 1002;
+ public static final int ENDEREYE_LAUNCH_SOUND = 1003;
+ public static final int FIREWORK_SHOOT_SOUND = 1004;
+ public static final int IRON_DOOR_OPEN_SOUND = 1005;
+ public static final int WOODEN_DOOR_OPEN_SOUND = 1006;
+ public static final int WOODEN_TRAPDOOR_OPEN_SOUND = 1007;
+ public static final int FENCE_GATE_OPEN_SOUND = 1008;
+ public static final int FIRE_EXTINGUISH_SOUND = 1009;
+ /**
+ * {@code data} is the item ID of the record you want to play
+ */
+ public static final int PLAY_RECORD_SOUND = 1010;
+ public static final int IRON_DOOR_CLOSE_SOUND = 1011;
+ public static final int WOODEN_DOOR_CLOSE_SOUND = 1012;
+ public static final int WOODEN_TRAPDOOR_CLOSE_SOUND = 1013;
+ public static final int FENCE_GATE_CLOSE_SOUND = 1014;
+ public static final int GHAST_WARN_SOUND = 1015;
+ public static final int GHAST_SHOOT_SOUND = 1016;
+ public static final int ENDERDRAGON_SHOOT_SOUND = 1017;
+ public static final int BLAZE_SHOOT_SOUND = 1018;
+ public static final int ZOMBIE_ATTACK_DOOR_WOOD_SOUND = 1019;
+ public static final int ZOMBIE_ATTACK_DOOR_IRON_SOUND = 1020;
+ public static final int ZOMBIE_BREAK_DOOR_WOOD_SOUND = 1021;
+ public static final int WITHER_BREAK_BLOCK_SOUND = 1022;
+ public static final int WITHER_BREAK_BLOCK = 1023;
+ public static final int WITHER_SHOOT_SOUND = 1024;
+ public static final int BAT_TAKEOFF_SOUND = 1025;
+ public static final int ZOMBIE_INFECT_SOUND = 1026;
+ public static final int ZOMBIE_VILLAGER_CONVERTED_SOUND = 1027;
+ public static final int ANVIL_DESTROYED_SOUND = 1029;
+ public static final int ANVIL_USE_SOUND = 1030;
+ public static final int ANVIL_LAND_SOUND = 1031;
+ public static final int PORTAL_TRAVEL_SOUND = 1032;
+ public static final int CHORUS_FLOWER_GROW_SOUND = 1033;
+ public static final int CHORUS_FLOWER_DEATH_SOUND = 1034;
+ public static final int BREWING_STAND_BREW_SOUND = 1035;
+ public static final int IRON_TRAPDOOR_CLOSE_SOUND = 1036;
+ public static final int IRON_TRAPDOOR_OPEN_SOUND = 1037;
+ /**
+ * {@code data} is the direction of the smoke, as a grid around the dispenser as follows (with 4 being the position of the dispenser):
+ *
+ * N + * 0 | 1 | 2 + * ---------- + * W 3 | 4 | 5 E + * ---------- + * 6 | 7 | 8 + * S + *+ * Setting the {@code data} to 4 will mean the particles won't spawn + */ + public static final int DISPENSER_SMOKE = 2000; + + /** + * {@code data} is the {@link net.minecraft.block.Block#getStateId state id} of the block broken + */ + public static final int BREAK_BLOCK_EFFECTS = 2001; + /** + * {@code data} is the rgb color int that should be used for the potion particles + */ + public static final int SPLASH_POTION_EFFECT = 2002; + public static final int ENDER_EYE_SHATTER = 2003; + public static final int MOB_SPAWNER_PARTICLES = 2004; + /** + * {@code data} is the amount of particles to spawn. If {@code data} is 0 then there will be 15 particles spawned + */ + public static final int BONEMEAL_PARTICLES = 2005; + public static final int DRAGON_FIREBALL_HIT = 2006; + /** + * {@code data} is the rgb color int that should be used for the potion particles + */ + public static final int LINGERING_POTION_EFFECT = 2007; + public static final int GATEWAY_SPAWN_EFFECTS = 3000; + public static final int ENDERMAN_GROWL_SOUND = 3001; + } + + + /** + * The flags used when calling {@link net.minecraft.world.World#setBlockState}