mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 19:39:14 +00:00
Merge branch 'master' of https://github.com/CrazyPants/EnderIO.git
This commit is contained in:
commit
7cee0971cb
4 files changed
+31
-44
No files matched your search
@@ -555,7 +555,7 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
return false; //not in copy paste mode
|
||||
}
|
||||
RaytraceResult rr = doRayTrace(world, x, y, z, player);
|
||||
if(rr.component == null) {
|
||||
if(rr == null || rr.component == null) {
|
||||
return false;
|
||||
}
|
||||
return ItemConduitProbe.copyPasteSettings(player, stack, bundle, rr.component.dir);
|
||||
|
||||
@@ -121,7 +121,10 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
return doRightClickItemPlace(player, world, x, y, z, side, par8, par9, par10);
|
||||
if(!isTravelUpgradeActive(player, item)) {
|
||||
return doRightClickItemPlace(player, world, x, y, z, side, par8, par9, par10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean doRightClickItemPlace(EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
|
||||
@@ -383,7 +383,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
}
|
||||
|
||||
if(notifyNeighbours) {
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
notifyNeighbours = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,53 +1,33 @@
|
||||
package crazypants.enderio.machine.attractor;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLeashKnot;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.monster.EntityBlaze;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.entity.monster.EntitySilverfish;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.entity.monster.EntitySpider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathNavigate;
|
||||
import net.minecraft.profiler.Profiler;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.management.ItemInWorldManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.sf.cglib.proxy.Enhancer;
|
||||
import net.sf.cglib.proxy.MethodInterceptor;
|
||||
import net.sf.cglib.proxy.MethodProxy;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.enderface.PacketOpenRemoteUi.PlayerProxy;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
@@ -276,8 +256,7 @@ public class TileAttractor extends AbstractMachineEntity {
|
||||
PathEntity pathentity = worldObj.getPathEntityToEntity(ent, getTarget(), getRange(), true, false, false, true);
|
||||
((EntityCreature) ent).setPathToEntity(pathentity);
|
||||
return true;
|
||||
}
|
||||
else if(ent instanceof EntityBlaze) {
|
||||
} else if(ent instanceof EntityBlaze) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -308,24 +287,26 @@ public class TileAttractor extends AbstractMachineEntity {
|
||||
}
|
||||
ent.motionZ += z / distance * speed;
|
||||
}
|
||||
} else if(ent instanceof EntityPigZombie || ent instanceof EntitySpider) {
|
||||
|
||||
double x = (xCoord + 0.5D - ent.posX);
|
||||
double y = (yCoord + 1D - ent.posY);
|
||||
double z = (zCoord + 0.5D - ent.posZ);
|
||||
double distance = Math.sqrt(x * x + y * y + z * z);
|
||||
if(distance > 2) {
|
||||
EntityMob mod = (EntityMob) ent;
|
||||
mod.faceEntity(getTarget(), 180, 0);
|
||||
mod.moveEntityWithHeading(0, 1);
|
||||
if(mod.posY < yCoord) {
|
||||
mod.setJumping(true);
|
||||
} else {
|
||||
mod.setJumping(false);
|
||||
}
|
||||
}
|
||||
} else if(ent instanceof EntityPigZombie || ent instanceof EntitySpider) {
|
||||
forceMove(ent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private void forceMove(EntityLiving ent) {
|
||||
double x = (xCoord + 0.5D - ent.posX);
|
||||
double y = (yCoord + 1D - ent.posY);
|
||||
double z = (zCoord + 0.5D - ent.posZ);
|
||||
double distance = Math.sqrt(x * x + y * y + z * z);
|
||||
if(distance > 2) {
|
||||
EntityMob mod = (EntityMob) ent;
|
||||
mod.faceEntity(getTarget(), 180, 0);
|
||||
mod.moveEntityWithHeading(0, 1);
|
||||
if(mod.posY < yCoord) {
|
||||
mod.setJumping(true);
|
||||
} else {
|
||||
mod.setJumping(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean useSetTarget(EntityLiving ent) {
|
||||
@@ -340,7 +321,7 @@ public class TileAttractor extends AbstractMachineEntity {
|
||||
super(MinecraftServer.getServer().worldServerForDimension(getWorldObj().provider.dimensionId), new GameProfile(null,
|
||||
ModObject.blockAttractor.unlocalisedName + ":" + getLocation()));
|
||||
posX = xCoord + 0.5;
|
||||
posY = yCoord + 0.5;
|
||||
posY = yCoord + 1.5;
|
||||
posZ = zCoord + 0.5;
|
||||
}
|
||||
}
|
||||
@@ -395,7 +376,10 @@ public class TileAttractor extends AbstractMachineEntity {
|
||||
started = true;
|
||||
int speed = 1;
|
||||
mob.getNavigator().setAvoidsWater(false);
|
||||
mob.getNavigator().tryMoveToEntityLiving(target, speed);
|
||||
boolean res = mob.getNavigator().tryMoveToEntityLiving(target, speed);
|
||||
if(!res) {
|
||||
mob.getNavigator().tryMoveToXYZ(target.posX, target.posY +1, target.posZ, speed);
|
||||
}
|
||||
updatesSincePathing = 0;
|
||||
} else {
|
||||
updatesSincePathing++;
|
||||
|
||||
Reference in new issue
Block a user