HUGE IScriptHandlerPacket merge.

All ScriptHandlers that send packets now directly define their data through the ScriptHandler class itself, NOT through their own GuiScript extended class.
This commit is contained in:
bigguy345 committed 2026-01-22 20:05:07 +02:00
1 parent 3f8373d76f
commit 50e9f1b3e5
18 files changed
+323 -443

No files matched your search

@@ -21,7 +21,9 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
@@ -120,9 +122,8 @@ import noppes.npcs.client.gui.roles.GuiNpcFollowerSetup;
import noppes.npcs.client.gui.roles.GuiNpcItemGiver;
import noppes.npcs.client.gui.roles.GuiNpcTraderSetup;
import noppes.npcs.client.gui.roles.GuiNpcTransporter;
import noppes.npcs.client.gui.script.GuiScriptBlock;
import noppes.npcs.client.gui.script.GuiScriptGlobal;
import noppes.npcs.client.gui.script.GuiScriptItem;
import noppes.npcs.client.gui.script.GuiScriptInterface;
import noppes.npcs.client.gui.util.script.PackageFinder;
import noppes.npcs.client.model.ModelNPCGolem;
import noppes.npcs.client.model.ModelNpcCrystal;
@@ -138,6 +139,7 @@ import noppes.npcs.client.renderer.RenderNpcDragon;
import noppes.npcs.client.renderer.RenderNpcSlime;
import noppes.npcs.client.renderer.RenderProjectile;
import kamkeel.npcs.client.renderer.TelegraphRenderer;
import noppes.npcs.scripted.item.ScriptCustomItem;
import kamkeel.npcs.controllers.data.ability.telegraph.TelegraphManager;
import noppes.npcs.client.renderer.blocks.BlockBannerRenderer;
import noppes.npcs.client.renderer.blocks.BlockBarrelRenderer;
@@ -492,7 +494,7 @@ public class ClientProxy extends CommonProxy {
return new GuiScript(npc);
else if (gui == EnumGuiType.ScriptItem)
return new GuiScriptItem();
return GuiScriptInterface.create(null, new ScriptCustomItem(new ItemStack(CustomItems.scripted_item)));
else if (gui == EnumGuiType.PlayerCarpentryBench)
return new GuiNpcCarpentryBench((ContainerCarpentryBench) container);
@@ -567,7 +569,7 @@ public class ClientProxy extends CommonProxy {
return new GuiCustom((ContainerCustomGui) container);
else if (gui == EnumGuiType.ScriptBlock)
return new GuiScriptBlock(x, y, z);
return getScriptBlockGui(x, y, z);
else if (gui == EnumGuiType.Paintbrush)
return new GuiNpcPaintbrush();
@@ -619,9 +621,22 @@ public class ClientProxy extends CommonProxy {
if (guiscreen != null) {
minecraft.displayGuiScreen((GuiScreen) guiscreen);
}
}
private GuiScreen getScriptBlockGui(int x, int y, int z) {
World world = Minecraft.getMinecraft().theWorld;
if (world == null)
return null;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileScripted))
return null;
return GuiScriptInterface.create(null, (TileScripted) tile);
}
@Override
public void spawnParticle(EntityLivingBase player, String string, Object... ob) {
if (string.equals("Spell")) {