Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.journeyman.wurmunlimited.mods.spammod;
- import com.sun.media.jfxmedia.events.PlayerStateListener;
- import com.wurmonline.server.MessageServer;
- import com.wurmonline.server.creatures.Communicator;
- import org.gotti.wurmunlimited.modloader.interfaces.*;
- import java.util.Properties;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- public class SpamMod implements WurmServerMod, Initable, PreInitable, Configurable, PlayerMessageListener {
- private boolean spamChat = false;
- @Override
- public void configure (Properties properties)
- {
- this.spamChat = Boolean.valueOf(properties.getProperty("spamChat", String.valueOf(this.spamChat))).booleanValue();
- Logger.getLogger(SpamMod.class.getName()).log(Level.INFO, "Spamming chat: " + this.spamChat);
- }
- @Override
- public void init() {
- }
- @Override
- public void preInit()
- {
- }
- @Override
- public MessagePolicy onPlayerMessage(Communicator communicator, String message, String title) {
- if (spamChat && message == "/spam")
- {
- MessageServer.broadCastSafe("Spam (stylized as SPAM) is a brand of canned cooked pork made by Hormel Foods Corporation, based in Minnesota. It was first introduced in 1937 and gained popularity worldwide after its use during World War II. By 2003, Spam was sold in 41 countries on six continents and trademarked in over 100 countries (not including the Middle East and North Africa).", (byte)1);
- }
- return null;
- }
- @Override
- public boolean onPlayerMessage(Communicator communicator, String s) {
- if (spamChat && s == "/spam")
- {
- MessageServer.broadCastSafe("Spam (stylized as SPAM) is a brand of canned cooked pork made by Hormel Foods Corporation, based in Minnesota. It was first introduced in 1937 and gained popularity worldwide after its use during World War II. By 2003, Spam was sold in 41 countries on six continents and trademarked in over 100 countries (not including the Middle East and North Africa).", (byte)1);
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement