Fix serverside. Closes #28

This commit is contained in:
fewizz committed 2016-09-24 14:29:33 +03:00
1 parent 4d98a5691a
commit 022137be62
7 files changed
+38 -26

No files matched your search

+5 -3
View File
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.Logger;
public class EMT {
public static final String NAME = "Electro-Magic Tools";
public static final String MOD_ID = "EMT";
public static final String VERSION = "1.2.6";
public static final String VERSION = "1.2.6.1";
public static final String TEXTURE_PATH = "emt";
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
@@ -61,7 +61,8 @@ public class EMT {
LOGGER.info("Starting planning the world domination");
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
if(FMLCommonHandler.instance().getSide().isClient())
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
Registry.register();
EMTEssentiasOutputs.addPrimalOutputs();
EMTEssentiasOutputs.addOutputs();
@@ -76,7 +77,8 @@ public class EMT {
proxy.load();
LOGGER.info("Making mobs drop additional items");
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
if(FMLCommonHandler.instance().getSide().isClient())
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
LOGGER.info("Adding dungeon loot");
EMTDungeonChestGenerator.generateLoot();
LOGGER.info("Registering entities");
@@ -3,6 +3,8 @@ package emt.block;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileElectricCloud;
import net.minecraft.block.material.Material;
@@ -32,6 +34,7 @@ public class BlockElectricCloud extends BlockBase {
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
}
@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
FXSparkle ef = new FXSparkle(world, x + 0.5F, y + 0.5F, z + 0.5F, x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, 1.0F, 6, 3);
@@ -116,10 +116,10 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
entities.add(entity);
/** Closer - Harder */
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
entity.performHurtAnimation();
if(worldObj.isRemote)
if(worldObj.isRemote) {
Thaumcraft.proxy.bolt(worldObj, this, entity);
}
}
}
+25 -18
View File
@@ -1,5 +1,8 @@
package emt.tile;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXWisp;
@@ -14,28 +17,32 @@ public class TileElectricCloud extends TileEntity {
@Override
public void updateEntity() {
if (worldObj.isRemote) {
if (worldObj.rand.nextInt(4) == 0) {
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
}
if(FMLCommonHandler.instance().getSide().isClient())
fx();
}
@SideOnly(Side.CLIENT)
public void fx() {
if (worldObj.rand.nextInt(4) == 0) {
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
}
if (worldObj.rand.nextInt(12) == 0) {
if (worldObj.rand.nextInt(12) == 0) {
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
if (worldObj.rand.nextInt(2) == 0) {
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
if (worldObj.rand.nextInt(2) == 0) {
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
}
if (worldObj.rand.nextInt(4) == 0) {
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
}
}
if (worldObj.rand.nextInt(4) == 0) {
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
}
}
if (worldObj.rand.nextInt(3) == 0) {
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
wisp.setGravity(-0.02F);
wisp.setRBGColorF(worldObj.rand.nextInt(40) / 100f, 0, 1);
wisp.setAlphaF(1);
ParticleEngine.instance.addEffect(worldObj, wisp);
}
if (worldObj.rand.nextInt(3) == 0) {
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
wisp.setGravity(-0.02F);
wisp.setRBGColorF(worldObj.rand.nextInt(40) / 100f, 0, 1);
wisp.setAlphaF(1);
ParticleEngine.instance.addEffect(worldObj, wisp);
}
}
}