mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 20:47:38 +00:00
refactor: disable auto-open GUI for BlockBorder and BlockNpcRedstone
- Removed auto-open GUI logic upon placing BlockBorder and BlockNpcRedstone. - Resolved a race condition where the GUI would open before NBT/Permission data was fully synced from the server, causing "Permission Denied" or empty states. - Fixed a logic bug in SubGuiNpcAvailabilityDialog where 'questId' was incorrectly used instead of 'dialogId' when opening the selection picker. - This change ensures better UX as manual interaction guarantees all data is properly initialized.
This commit is contained in:
1 parent
b2c279feeb
commit
b8d68f771f
3 files changed
+4
-15
No files matched your search
@@ -67,10 +67,6 @@ public class BlockBorder extends BlockContainer {
|
||||
}
|
||||
|
||||
tile.rotation = l;
|
||||
|
||||
if (par5EntityLivingBase instanceof EntityPlayer && par1World.isRemote) {
|
||||
CustomNpcs.proxy.openGui(x, y, z, EnumGuiType.Border, (EntityPlayer) par5EntityLivingBase);
|
||||
}
|
||||
}
|
||||
|
||||
private TileBorder getTile(World world, int x, int y, int z) {
|
||||
|
||||
@@ -49,13 +49,6 @@ public class BlockNpcRedstone extends BlockContainer {
|
||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack item) {
|
||||
if (entityliving instanceof EntityPlayer && world.isRemote) {
|
||||
CustomNpcs.proxy.openGui(i, j, k, EnumGuiType.RedstoneBlock, (EntityPlayer) entityliving);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {
|
||||
onBlockAdded(par1World, par2, par3, par4);
|
||||
|
||||
@@ -112,19 +112,19 @@ public class SubGuiNpcAvailabilityDialog extends SubGuiInterface implements GuiS
|
||||
}
|
||||
if (button.id == 10) {
|
||||
slot = 1;
|
||||
setSubGui(new GuiDialogSelection(availabitily.questId));
|
||||
setSubGui(new GuiDialogSelection(availabitily.dialogId));
|
||||
}
|
||||
if (button.id == 11) {
|
||||
slot = 2;
|
||||
setSubGui(new GuiDialogSelection(availabitily.quest2Id));
|
||||
setSubGui(new GuiDialogSelection(availabitily.dialog2Id));
|
||||
}
|
||||
if (button.id == 12) {
|
||||
slot = 3;
|
||||
setSubGui(new GuiDialogSelection(availabitily.quest3Id));
|
||||
setSubGui(new GuiDialogSelection(availabitily.dialog3Id));
|
||||
}
|
||||
if (button.id == 13) {
|
||||
slot = 4;
|
||||
setSubGui(new GuiDialogSelection(availabitily.quest4Id));
|
||||
setSubGui(new GuiDialogSelection(availabitily.dialog4Id));
|
||||
}
|
||||
if (button.id == 20) {
|
||||
availabitily.dialogId = -1;
|
||||
|
||||
Reference in new issue
Block a user