This commit is contained in:
HbmMods 2019-04-12 17:58:01 +02:00
parent 6764c67c0c
commit 00f123977e
3 changed files with 32 additions and 20 deletions

View File

@ -1,7 +1,10 @@
package com.hbm.main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityCloudFX;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.common.MinecraftForge;
@ -427,5 +430,28 @@ public class ClientProxy extends ServerProxy
public void registerTileEntitySpecialRenderer() {
}
@Override
public void particleControl(double x, double y, double z, int type) {
World world = Minecraft.getMinecraft().theWorld;
switch(type) {
case 0:
for(int i = 0; i < 10; i++) {
EntityCloudFX smoke = new EntityCloudFX(world, x + world.rand.nextGaussian(), y + world.rand.nextGaussian(), z + world.rand.nextGaussian(), 0.0, 0.0, 0.0);
Minecraft.getMinecraft().effectRenderer.addEffect(smoke);
}
break;
case 1:
EntityCloudFX smoke = new EntityCloudFX(world, x, y, z, 0.0, 0.1, 0.0);
Minecraft.getMinecraft().effectRenderer.addEffect(smoke);
break;
}
}
}

View File

@ -10,4 +10,8 @@ public class ServerProxy
public void registerTileEntitySpecialRenderer() {
}
public void particleControl(double x, double y, double z, int type) {
}
}

View File

@ -1,5 +1,6 @@
package com.hbm.packet;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
import com.hbm.tileentity.machine.TileEntityMachinePumpjack;
@ -8,9 +9,6 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityCloudFX;
import net.minecraft.client.particle.EntitySmokeFX;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -57,23 +55,7 @@ public class AuxParticlePacket implements IMessage {
try {
World world = Minecraft.getMinecraft().theWorld;
switch(m.type) {
case 0:
for(int i = 0; i < 10; i++) {
EntityCloudFX smoke = new EntityCloudFX(world, m.x + world.rand.nextGaussian(), m.y + world.rand.nextGaussian(), m.z + world.rand.nextGaussian(), 0.0, 0.0, 0.0);
Minecraft.getMinecraft().effectRenderer.addEffect(smoke);
}
break;
case 1:
EntityCloudFX smoke = new EntityCloudFX(world, m.x, m.y, m.z, 0.0, 0.1, 0.0);
Minecraft.getMinecraft().effectRenderer.addEffect(smoke);
break;
}
MainRegistry.proxy.particleControl(m.x, m.y, m.z, m.type);
} catch(Exception x) { }