some changes...

This commit is contained in:
fewizz committed 2015-12-26 22:50:59 +03:00
1 parent 3dcd5c43b6
commit bcc6623337
11 files changed
+50 -49

No files matched your search

@@ -80,7 +80,7 @@ public class RenderShield extends Render {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LIGHTING);
if(!Minecraft.getMinecraft().thePlayer.getDisplayName().equals( ((EntityShield)entityShield).owner.getDisplayName() ))
if(((EntityShield)entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName().equals(((EntityShield)entityShield).owner.getDisplayName() ))
GL11.glTranslated(x, y, z);
for (int v = 0; v < values.length; v += 12) {
@@ -24,9 +24,9 @@ import tombenpotter.emt.common.tile.TileEntityIndustrialWandRecharge;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEMTMachines extends BlockBaseContainer {
public class BlockMachines extends BlockBaseContainer {
public BlockEMTMachines(String name) {
public BlockMachines(String name) {
super(name, Material.iron, soundTypeMetal, 4.0F);
}
@@ -30,9 +30,9 @@ import tombenpotter.emt.common.tile.solar.water.TileEntityWaterSolar;
import java.util.List;
public class BlockEMTSolars extends BlockBaseContainer {
public class BlockSolars extends BlockBaseContainer {
public BlockEMTSolars(String name) {
public BlockSolars(String name) {
super(name, Material.iron, soundTypeMetal, 4.0F);
}
@@ -19,9 +19,9 @@ import tombenpotter.emt.common.tile.solar.earth.TileEntityTripleEarthSolar;
import java.util.List;
public class BlockEMTSolars2 extends BlockBaseContainer {
public class BlockSolars2 extends BlockBaseContainer {
public BlockEMTSolars2(String name) {
public BlockSolars2(String name) {
super(name, Material.iron, soundTypeMetal, 4.0F);
}
@@ -94,7 +94,6 @@ public class EntityLaser extends Entity implements IProjectile {
}
protected void entityInit() {
this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
}
public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) {
@@ -1,9 +1,7 @@
package tombenpotter.emt.common.entity;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.core.IC2;
@@ -18,38 +16,35 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityShield extends Entity implements IProjectile {
public class EntityShield extends Entity {
public EntityPlayer owner;
public boolean needCheck = true;
public EntityShield(World world) {
this(world, Minecraft.getMinecraft().thePlayer);
super(world);
this.ignoreFrustumCheck = true;
}
public EntityShield(World world, EntityPlayer player) {
super(world);
this.setSize(4, 4);
owner = player;
this.dataWatcher.updateObject(11, owner.getDisplayName());
this.setPosition(player.posX, player.posY, player.posZ);
this.ignoreFrustumCheck = true;
}
@Override
protected void entityInit() {
this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) {
this.setPosition(par1, par3, par5);
this.setRotation(par7, par8);
this.dataWatcher.addObject(11, "");
}
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
protected void readEntityFromNBT(NBTTagCompound nbt) {
}
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
protected void writeEntityToNBT(NBTTagCompound nbt) {
}
public AxisAlignedBB getBoundingBox() {
@@ -72,7 +67,17 @@ public class EntityShield extends Entity implements IProjectile {
public void onUpdate() {
super.onUpdate();
if (!this.worldObj.isRemote) {
if(needCheck && owner == null) {
owner = this.worldObj.getPlayerEntityByName(dataWatcher.getWatchableObjectString(11));
needCheck = false;
}
else if(!needCheck && owner == null){
this.setDead();
return;
}
if (!this.worldObj.isRemote && owner != null) {
this.setPosition(owner.posX, owner.posY, owner.posZ);
if (!owner.isUsingItem()) {
this.setDead();
@@ -105,9 +110,7 @@ public class EntityShield extends Entity implements IProjectile {
ePosZ *= 0.05000000074505806D;
ePosX *= (double) (1.0F - this.entityCollisionReduction);
ePosZ *= (double) (1.0F - this.entityCollisionReduction);
this.addVelocity(-ePosX * 100, 0.0D, -ePosZ * 10);
entity.addVelocity(ePosX * 100, 0.0D, ePosZ * 10);
entity.addVelocity(ePosX * 10, 0.0D, ePosZ * 10);
}
}
@@ -116,8 +119,4 @@ public class EntityShield extends Entity implements IProjectile {
public boolean isInRangeToRender3d(double x, double y, double z) {
return true;
}
@Override
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) {
}
}
@@ -8,15 +8,15 @@ import static thaumcraft.api.ThaumcraftApi.*;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.block.BlockEMTMachines;
import tombenpotter.emt.common.block.BlockEMTSolars;
import tombenpotter.emt.common.block.BlockEMTSolars2;
import tombenpotter.emt.common.block.BlockMachines;
import tombenpotter.emt.common.block.BlockSolars;
import tombenpotter.emt.common.block.BlockSolars2;
import tombenpotter.emt.common.block.BlockEssentiaGenerators;
import tombenpotter.emt.common.block.BlockPortableNode;
import tombenpotter.emt.common.block.BlockShield;
import tombenpotter.emt.common.item.block.ItemBlockEMTMachines;
import tombenpotter.emt.common.item.block.ItemBlockEMTSolars;
import tombenpotter.emt.common.item.block.ItemBlockEMTSolars2;
import tombenpotter.emt.common.item.block.ItemBlockMachines;
import tombenpotter.emt.common.item.block.ItemBlockSolars;
import tombenpotter.emt.common.item.block.ItemBlockSolars2;
import tombenpotter.emt.common.item.block.ItemBlockEssentiaGenerator;
import tombenpotter.emt.common.item.block.ItemBlockEssentiaGenerators;
@@ -36,14 +36,14 @@ public class BlockRegistry {
shield = new BlockShield("shield");
GameRegistry.registerBlock(shield, "ShieldBlock");
emtSolars = new BlockEMTSolars("solar");
GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMTSolars");
emtSolars = new BlockSolars("solar");
GameRegistry.registerBlock(emtSolars, ItemBlockSolars.class, "EMTSolars");
emtSolars2 = new BlockEMTSolars2("solar2");
GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMTSolars2");
emtSolars2 = new BlockSolars2("solar2");
GameRegistry.registerBlock(emtSolars2, ItemBlockSolars2.class, "EMTSolars2");
emtMachines = new BlockEMTMachines("machine");
GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMTMachines");
emtMachines = new BlockMachines("machine");
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
@@ -4,9 +4,9 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockEMTMachines extends ItemBlock {
public class ItemBlockMachines extends ItemBlock {
public ItemBlockEMTMachines(Block id) {
public ItemBlockMachines(Block id) {
super(id);
setHasSubtypes(true);
}
@@ -11,9 +11,9 @@ import java.util.List;
import static tombenpotter.emt.common.util.EMTTextHelper.localize;
public class ItemBlockEMTSolars extends ItemBlock {
public class ItemBlockSolars extends ItemBlock {
public ItemBlockEMTSolars(Block id) {
public ItemBlockSolars(Block id) {
super(id);
setHasSubtypes(true);
}
@@ -11,9 +11,9 @@ import java.util.List;
import static tombenpotter.emt.common.util.EMTTextHelper.localize;
public class ItemBlockEMTSolars2 extends ItemBlock {
public class ItemBlockSolars2 extends ItemBlock {
public ItemBlockEMTSolars2(Block id) {
public ItemBlockSolars2(Block id) {
super(id);
setHasSubtypes(true);
}
@@ -3,8 +3,11 @@ package tombenpotter.emt.common.item.focus;
import java.util.ArrayList;
import java.util.LinkedList;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import ic2.core.IC2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;