Small Fixes

This commit is contained in:
Kam committed 2025-02-02 17:49:57 -05:00
1 parent b5d294dd20
commit 57e41412dd
4 files changed
+16 -8

No files matched your search

@@ -53,6 +53,9 @@ public final class ConfigCommandPacket extends AbstractPacket {
EnumConfigOperation configType = EnumConfigOperation.values()[in.readInt()];
if (configType == EnumConfigOperation.FONT) { // Font Configuration
String font = ByteBufUtils.readString(in);
if(font == null)
return;
int size = in.readInt();
if (!font.isEmpty()) {
ConfigClient.FontType = font;
@@ -80,13 +80,15 @@ public final class ParticlePacket extends AbstractPacket {
float yOffset = buffer.readFloat();
String particle = ByteBufUtils.readString(buffer);
World worldObj = Minecraft.getMinecraft().theWorld;
if(particle != null){
World worldObj = Minecraft.getMinecraft().theWorld;
Random rand = worldObj.rand;
if (particle.equals("heal")) {
for (int k = 0; k < 6; k++) {
worldObj.spawnParticle("instantSpell", posX + (rand.nextDouble() - 0.5D) * (double) width, (posY + rand.nextDouble() * (double) height) - (double) yOffset, posZ + (rand.nextDouble() - 0.5D) * (double) width, 0, 0, 0);
worldObj.spawnParticle("spell", posX + (rand.nextDouble() - 0.5D) * (double) width, (posY + rand.nextDouble() * (double) height) - (double) yOffset, posZ + (rand.nextDouble() - 0.5D) * (double) width, 0, 0, 0);
Random rand = worldObj.rand;
if (particle.equals("heal")) {
for (int k = 0; k < 6; k++) {
worldObj.spawnParticle("instantSpell", posX + (rand.nextDouble() - 0.5D) * (double) width, (posY + rand.nextDouble() * (double) height) - (double) yOffset, posZ + (rand.nextDouble() - 0.5D) * (double) width, 0, 0, 0);
worldObj.spawnParticle("spell", posX + (rand.nextDouble() - 0.5D) * (double) width, (posY + rand.nextDouble() * (double) height) - (double) yOffset, posZ + (rand.nextDouble() - 0.5D) * (double) width, 0, 0, 0);
}
}
}
}
@@ -61,6 +61,7 @@ public final class GuiOpenBookPacket extends AbstractPacket {
int z = in.readInt();
NBTTagCompound nbt = ByteBufUtils.readNBT(in);
ItemStack book = ItemStack.loadItemStackFromNBT(nbt);
NoppesUtil.openGUI(player, new GuiBook(player, book, x, y, z));
if(book != null)
NoppesUtil.openGUI(player, new GuiBook(player, book, x, y, z));
}
}
@@ -48,7 +48,9 @@ public final class TransformLoadPacket extends AbstractPacket {
@SideOnly(Side.CLIENT)
@Override
public void sendData(ByteBuf out) throws IOException { }
public void sendData(ByteBuf out) throws IOException {
out.writeBoolean(this.transform);
}
@Override
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {