mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-12 16:37:38 +00:00
Fixed smoke particles on redstone torches (bugged in vanilla) Added functions for world and coordinates on parts to clean code Added more placement and world interaction events Properly distinguished converted tiles Fixed tick scheduler to remain in better sync with vanilla
34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
package codechicken.multipart.minecraft;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.multiplayer.NetClientHandler;
|
|
import net.minecraft.client.multiplayer.WorldClient;
|
|
import codechicken.core.packet.PacketCustom;
|
|
import codechicken.core.packet.PacketCustom.IClientPacketHandler;
|
|
import codechicken.core.vec.BlockCoord;
|
|
|
|
public class McMultipartCPH implements IClientPacketHandler
|
|
{
|
|
public static Object channel = MinecraftMultipartMod.instance;
|
|
|
|
@Override
|
|
public void handlePacket(PacketCustom packet, NetClientHandler nethandler, Minecraft mc)
|
|
{
|
|
switch(packet.getType())
|
|
{
|
|
case 1:
|
|
spawnBurnoutSmoke(mc.theWorld, packet.readCoord());
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void spawnBurnoutSmoke(WorldClient world, BlockCoord pos)
|
|
{
|
|
for(int l = 0; l < 5; l++)
|
|
world.spawnParticle("smoke",
|
|
pos.x+world.rand.nextDouble()*0.6+0.2,
|
|
pos.y+world.rand.nextDouble()*0.6+0.2,
|
|
pos.z+world.rand.nextDouble()*0.6+0.2, 0, 0, 0);
|
|
}
|
|
}
|