This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package game.content.skilling.fishings.spot; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; | |
| import java.util.Objects; | |
| import game.position.Position; | |
| import game.content.skilling.fishing.Fishing; | |
| import game.npc.Npc; | |
| import game.player.event.CycleEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MuddyChestAndKey implements ObjectClickHandler, NpcClickHandler { | |
| @Hints(index=1, ids=170) | |
| public boolean handle(ObjectClickData clickData) { | |
| // implement obtain reward event | |
| return true; | |
| } | |
| @Hints(index={1,2}, enums=NormalPickpocket.Npcs.class) | |
| public boolean handle(NpcClickData clickData) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Demo { | |
| public static void main(String[] args) { | |
| String sentence = "Hi my name is Billy Bob."; | |
| for(String s : sentence.split(" ")) { | |
| if(s == "Hi") { | |
| System.out.println("No greetings allowed."); | |
| break; | |
| } else { | |
| System.out.println(s); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| public static void main(String[] args) { | |
| String sentence = "Hi my name is Billy Bob."; | |
| String[] words = sentence.split(" "); | |
| for(int i = 0; i < words.length - 1; i++) { | |
| String word = words[i]; | |
| if(word.equals("hi")) | |
| continue: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ItemOnObjectPacket { | |
| public static void handleItemOnItem(Player player, int itemId, int itemSlot, int objectId) { | |
| if(itemId == 995 && objectId == 1000) { | |
| DonationWell.handleDonation(player, itemId, itemSlot, objectId); | |
| } else if(...) { | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Main { | |
| public static void main(String [ ] args) { | |
| ProtocolController pc = new ProtocolController(); | |
| mainWindow mw = new mainWindow(); | |
| } | |
| } | |
| public class ProtocolController { | |
| File protocol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NameFixer { | |
| List<String> fix(List<String> names) { | |
| List<String> fixedNames = new ArrayList<>(); | |
| for(String name : names) { | |
| char firstLetter = name.charAt(0); | |
| char fixedFirstLetter = Character.toUppercase(firstLetter); | |
| String restOfName = name.substring(1); | |
| String fixedRestOfName = restOfName.toLowercase(); | |
| String fixedName = fixedFirstLetter + fixedRestOfName; | |
| fixedNames.add(fixedName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NameFixer { | |
| private Consumer<String> invalidNameReceiver; | |
| /** | |
| * Registers the listener which listens for invalid names. | |
| * | |
| * @param invalidNameListener receives all invalid names found while fixing names | |
| */ | |
| public void onInvalidName(Consumer<String> invalidNameListener) { | |
| this.invalidNameListener = invalidNameListener; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void setPixels(int width, int height, int destPixels[], int srcPixels[], int srcAlpha, int destOffset, | |
| int srcOffset, int destStep, int srcStep) { | |
| for (int y = -height; y < 0; y++) { | |
| for (int x = -width; x < 0; x++) { | |
| int currentColor = myPixels[srcOffset] >> 24; | |
| int currentColorWithAlpha = currentColor & srcAlpha; | |
| int destAlpha = 256 - currentColorWithAlpha; | |
| int srcColor = srcPixels[srcOffset++]; | |
| boolean srcNotBlack = srcColor != 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class ObjectConnection implements Connection<Object> { | |
| private final ObjectInputStream in; | |
| private final ObjectOutputStream out; | |
| private final Socket socket; | |
| private Consumer<Object> objectConsumer; | |
| private Thread dataReadThread; | |
| public Connection(Socket socket) throws IOException { | |
| this.socket = socket; |