mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-18 11:19:17 +00:00
- Some rendering adjustments
This commit is contained in:
1 parent
793da041dd
commit
1a2139234e
9 files changed
+35
-12
No files matched your search
@@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
import thaumcraft.client.renderers.entity.RenderPrimalOrb;
|
||||
import thaumcraft.client.renderers.entity.RenderWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -53,7 +54,10 @@ public class FamiliarHandlerClient {
|
||||
if(p == null || p.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer) > 1024) return; //32^2
|
||||
PartialEntityFamiliar fam = clientFamiliars.get(p.getCommandSenderName());
|
||||
if(fam == null) return;
|
||||
Thaumcraft.proxy.nodeBolt(Minecraft.getMinecraft().theWorld, (float) fam.posX, (float) fam.posY, (float) fam.posZ, pkt.targetX, pkt.targetY, pkt.targetZ);
|
||||
FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, (float) fam.posX, (float) fam.posY, (float) fam.posZ, pkt.targetX, pkt.targetY, pkt.targetZ, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(pkt.type);
|
||||
bolt.finalizeBolt();
|
||||
} else if(packet instanceof PacketFamiliar.PacketFamiliarSyncCompletely) {
|
||||
PacketFamiliar.PacketFamiliarSyncCompletely sync = (PacketFamiliar.PacketFamiliarSyncCompletely) packet;
|
||||
familiarPlayers = sync.playerNamesWithFamiliars;
|
||||
|
||||
@@ -106,7 +106,7 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "thaumcraft:zap", 0.8F, 1.0F);
|
||||
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ);
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ, 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32.0D));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class TileNodeManipulator extends TileWandPedestal implements IAspectCont
|
||||
}
|
||||
if(worldObj.rand.nextInt(4) == 0) {
|
||||
Vec3 rel = getRelPillarLoc(worldObj.rand.nextInt(4));
|
||||
PacketTCNodeBolt bolt = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 2.5F, zCoord + 0.5F, (float) (xCoord + 0.5F + rel.xCoord), (float) (yCoord + 2.5F + rel.yCoord), (float) (zCoord + 0.5F + rel.zCoord));
|
||||
PacketTCNodeBolt bolt = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 2.5F, zCoord + 0.5F, (float) (xCoord + 0.5F + rel.xCoord), (float) (yCoord + 2.5F + rel.yCoord), (float) (zCoord + 0.5F + rel.zCoord), 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(bolt, getTargetPoint(32));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -48,7 +48,6 @@ public class ItemFamiliar extends Item implements IBauble {
|
||||
}
|
||||
|
||||
if(stack.getTagCompound().hasKey("AttackUpgrade1") || stack.getTagCompound().hasKey("AttackUpgrade2") || stack.getTagCompound().hasKey("AttackUpgrade3")) {
|
||||
lore.add("");
|
||||
String strength = EnumChatFormatting.DARK_RED + "Strength ";
|
||||
if(stack.getTagCompound().hasKey("AttackUpgrade1")) strength += "I";
|
||||
if(stack.getTagCompound().hasKey("AttackUpgrade2")) strength += "I";
|
||||
@@ -57,12 +56,10 @@ public class ItemFamiliar extends Item implements IBauble {
|
||||
}
|
||||
|
||||
if(stack.getTagCompound().hasKey("RangeUpgrade1")) {
|
||||
lore.add("");
|
||||
lore.add(EnumChatFormatting.GOLD + "Reach I");
|
||||
}
|
||||
|
||||
if(stack.getTagCompound().hasKey("CdUpgrade1")) {
|
||||
lore.add("");
|
||||
lore.add(EnumChatFormatting.AQUA + "Swiftness I");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,15 +22,19 @@ public abstract class PacketFamiliar {
|
||||
public static class PacketFamiliarBolt extends PacketFamiliar implements IMessage, IMessageHandler<PacketFamiliarBolt, IMessage> {
|
||||
|
||||
public float targetX, targetY, targetZ;
|
||||
public int type;
|
||||
public boolean mightGetLong;
|
||||
public String owner;
|
||||
|
||||
public PacketFamiliarBolt() {}
|
||||
|
||||
public PacketFamiliarBolt(String whoseFamiliar, float targetX, float targetY, float targetZ) {
|
||||
public PacketFamiliarBolt(String whoseFamiliar, float targetX, float targetY, float targetZ, int type, boolean mightGetLong) {
|
||||
this.targetX = targetX;
|
||||
this.targetY = targetY;
|
||||
this.targetZ = targetZ;
|
||||
this.owner = whoseFamiliar;
|
||||
this.type = type;
|
||||
this.mightGetLong = mightGetLong;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,6 +43,9 @@ public abstract class PacketFamiliar {
|
||||
this.targetY = buf.readFloat();
|
||||
this.targetZ = buf.readFloat();
|
||||
|
||||
this.type = buf.readInt();
|
||||
this.mightGetLong = buf.readBoolean();
|
||||
|
||||
int length = buf.readInt();
|
||||
byte[] strBytes = new byte[length];
|
||||
buf.readBytes(strBytes, 0, length);
|
||||
@@ -51,6 +58,9 @@ public abstract class PacketFamiliar {
|
||||
buf.writeFloat(targetY);
|
||||
buf.writeFloat(targetZ);
|
||||
|
||||
buf.writeInt(type);
|
||||
buf.writeBoolean(mightGetLong);
|
||||
|
||||
byte[] str = owner.getBytes();
|
||||
buf.writeInt(str.length);
|
||||
buf.writeBytes(str);
|
||||
|
||||
@@ -9,6 +9,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
|
||||
/**
|
||||
@@ -23,16 +24,20 @@ public class PacketTCNodeBolt implements IMessage, IMessageHandler<PacketTCNodeB
|
||||
|
||||
private float x, y, z;
|
||||
private float targetX, targetY, targetZ;
|
||||
private int type;
|
||||
private boolean mightGetLong;
|
||||
|
||||
public PacketTCNodeBolt() {}
|
||||
|
||||
public PacketTCNodeBolt(float x, float y, float z, float targetX, float targetY, float targetZ) {
|
||||
public PacketTCNodeBolt(float x, float y, float z, float targetX, float targetY, float targetZ, int type, boolean mightGetLong) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.targetX = targetX;
|
||||
this.targetY = targetY;
|
||||
this.targetZ = targetZ;
|
||||
this.type = type;
|
||||
this.mightGetLong = mightGetLong;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,6 +48,8 @@ public class PacketTCNodeBolt implements IMessage, IMessageHandler<PacketTCNodeB
|
||||
this.targetX = buf.readFloat();
|
||||
this.targetY = buf.readFloat();
|
||||
this.targetZ = buf.readFloat();
|
||||
this.type = buf.readInt();
|
||||
this.mightGetLong = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,12 +60,17 @@ public class PacketTCNodeBolt implements IMessage, IMessageHandler<PacketTCNodeB
|
||||
buf.writeFloat(targetX);
|
||||
buf.writeFloat(targetY);
|
||||
buf.writeFloat(targetZ);
|
||||
buf.writeInt(type);
|
||||
buf.writeBoolean(mightGetLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IMessage onMessage(PacketTCNodeBolt p, MessageContext ctx) {
|
||||
Thaumcraft.proxy.nodeBolt(Minecraft.getMinecraft().theWorld, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ);
|
||||
FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(p.type);
|
||||
bolt.finalizeBolt();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ public class GrowingNodeBehavior {
|
||||
fixedNode.getWorldObj().spawnEntityInWorld(aspectOrb);
|
||||
|
||||
NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(world.provider.dimensionId, ox + 0.5F, oy + 0.5F, oz + 0.5F, 32);
|
||||
PacketTCNodeBolt bolt = new PacketTCNodeBolt(ox + 0.5F, oy + 0.5F, oz + 0.5F, fx + 0.5F, fy + 0.5F, fz + 0.5F);
|
||||
PacketTCNodeBolt bolt = new PacketTCNodeBolt(ox + 0.5F, oy + 0.5F, oz + 0.5F, fx + 0.5F, fy + 0.5F, fz + 0.5F, 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(bolt, point);
|
||||
|
||||
PacketAnimationAbsorb packet = new PacketAnimationAbsorb(ox, oy, oz, fx, fy, fz, 7);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RegisteredFamiliarAI {
|
||||
|
||||
world.playSoundEffect(mob.posX + 0.5, mob.posY + 0.5, mob.posZ + 0.5, "thaumcraft:zap", 0.8F, 1.0F);
|
||||
|
||||
PacketFamiliar.PacketFamiliarBolt bolt = new PacketFamiliar.PacketFamiliarBolt(parent.getCommandSenderName(), (float) mob.posX, (float) mob.posY, (float) mob.posZ);
|
||||
PacketFamiliar.PacketFamiliarBolt bolt = new PacketFamiliar.PacketFamiliarBolt(parent.getCommandSenderName(), (float) mob.posX, (float) mob.posY, (float) mob.posZ, 6, true);
|
||||
PacketHandler.INSTANCE.sendToAllAround(bolt, new NetworkRegistry.TargetPoint(mob.worldObj.provider.dimensionId, mob.posX, mob.posY, mob.posZ, 32));
|
||||
FamiliarAIController.cleanTargetterList(parent);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ExplosionHelper {
|
||||
if(livingEntity instanceof EntityPlayer && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) continue;
|
||||
if(world.rand.nextInt(16) != 0) continue;
|
||||
livingEntity.attackEntityFrom(DamageSource.magic, 4F);
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(x + 0.5F, y + 0.5F, z + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ);
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(x + 0.5F, y + 0.5F, z + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ, 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user