Package com.sk89q.craftbook

Examples of com.sk89q.craftbook.ChangedSign.update()


                    }
                }
                sign.setLine(i++, line);
            }

            sign.update(false);
        }
    }

    boolean defaultToGlobal;
    boolean consoleOverride;
View Full Code Here


        if(SignUtil.isSign(event.getBlock())) {
            ChangedSign sign = BukkitUtil.toChangedSign(event.getBlock());
            if(sign.getLine(1).equals("[Area]")) {
                isValidArea(sign); //Perform a conversion,
                sign.update(false);
            }
        }
    }

    @EventHandler(priority = EventPriority.HIGH)
View Full Code Here

                ICManager.removeCachedIC(block.getLocation());
                ic = registration.getFactory().create(sign);
                if(!sign.getLine(0).equals(ic.getSignTitle()) && !sign.getLine(0).startsWith("=")) {
                    sign.setLine(0, ic.getSignTitle());
                    sign.update(false);
                }
                ic.load();
                // add the created ic to the cache
                ICManager.addCachedIC(block.getLocation(), ic);
            }
View Full Code Here

            }
        } else if (create) {
            ic = registration.getFactory().create(sign);
            if(!sign.getLine(0).equals(ic.getSignTitle()) && !sign.getLine(0).startsWith("=")) {
                sign.setLine(0, ic.getSignTitle());
                sign.update(false);
            }
            ic.load();
            // add the created ic to the cache
            ICManager.addCachedIC(block.getLocation(), ic);
        } else
View Full Code Here

                    sign.setLine(1, "[" + registration.getId() + "]" + suffix);
                    if (!shortHand)
                        sign.setLine(0, ic.getSignTitle());

                    sign.update(false);

                    if (ic instanceof SelfTriggeredIC && (event.getLine(1).trim().toUpperCase(Locale.ENGLISH).endsWith("S") || ((SelfTriggeredIC) ic).isAlwaysST()))
                        CraftBookPlugin.inst().getSelfTriggerManager().registerSelfTrigger(block.getLocation());

                    player.print("You've created " + registration.getId() + ": " + ic.getTitle() + ".");
View Full Code Here

        try {
            lastTick = Math.max(0, Integer.parseInt(sign.getLine(2).trim()));
        } catch (Exception e) {
            sign.setLine(2, String.valueOf(0));
            sign.update(false);
        }
        oldTick = lastTick;
        Block b = SignUtil.getBackBlock(event.getBlock());
        Block fire = b.getRelative(0, 1, 0);
        Block cb = b.getRelative(0, 2, 0);
View Full Code Here

                lastTick = 0;
        }

        if(oldTick != lastTick) {
            sign.setLine(2, String.valueOf(lastTick));
            sign.update(false);
        }
    }

    @EventHandler(priority = EventPriority.HIGH)
    public void onRightClick(SignClickEvent event) {
View Full Code Here

                    event.setCancelled(true);
                }
            }

            if(sign.hasChanged())
                sign.update(false);
        } else {
            event.getPlayer().setFireTicks(getMultiplier(sign)+40);
            LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
            player.printError("mech.cook.ouch");
        }
View Full Code Here

        if (event.isOn() && !event.isMinor())
            increaseMultiplier(sign, event.getNewCurrent() - event.getOldCurrent());

        if(sign.hasChanged())
            sign.update(false);
    }

    public void setMultiplier(ChangedSign sign, int amount) {

        if(!cookingPotFuel)
View Full Code Here

            ChangedSign sign = BukkitUtil.toChangedSign(block);

            if(!sign.getLine(1).equals("[Chunk]")) return;

            sign.setLine(3, event.getNewCurrent() > event.getOldCurrent() ? "on" : "off");
            sign.update(false);
        }
    }

    @EventHandler(priority = EventPriority.LOWEST)
    public void onUnload(final ChunkUnloadEvent event) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.