This file contains 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
ExtendedBlockStorage blockStorage = storageArrays[pos.getY() >> 4]; | |
if (blockStorage != null) { | |
int x = pos.getX() & 15; | |
int y = pos.getY() & 15; | |
int z = pos.getZ() & 15; | |
return blockStorage.get(x, y, z); | |
} | |
} |
This file contains 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
@Override | |
public void setBlockData(int data, BlockLocation loc) { | |
int x = loc.getX(), y = loc.getY(), z = loc.getZ(); | |
int chunkX = x >> 4, chunkY = y >> 4, chunkZ = z >> 4; | |
int chunkBaseX = chunkX << 4, chunkBaseY = chunkY << 4, chunkBaseZ = chunkZ << 4; | |
Chunk chunk = getChunkAt(new ChunkLocation(chunkX, chunkY, chunkZ)); | |
chunk.getBlocks().set(x - chunkBaseX, y - chunkBaseY, z - chunkBaseZ, data); | |
} |
This file contains 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
case 0x0E: { // PacketPS0ESpawnObject | |
PacketPS0ESpawnObject pso = (PacketPS0ESpawnObject) p; | |
DefaultMinecraftWorld world = context.getWorld(); | |
ObjectEntity objectEntity = world.getObjectEntityFactory().create(pso.getTypeId(), world, pso.getEntityId()); | |
objectEntity.setLocation(pso.getX(), pso.getY(), pso.getZ()); | |
objectEntity.setPitch(pso.getPitch()); | |
objectEntity.setYaw(pso.getYaw()); | |
objectEntity.setMotion(pso.getMotX(), pso.getMotY(), pso.getMotZ()); | |
world.spawnEntity(objectEntity); | |
bus.dispatch(new ObjectEntitySpawnEvent(objectEntity)); |
This file contains 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 static void linearSearch(String[] strings, String finding) { | |
for (int i = 0; i < strings.length; i++) { | |
String s = strings[i]; | |
if (s.equals(finding)) { | |
System.out.println("checked " + i + " words."); | |
System.out.println("Found it at index " + i); | |
} | |
} | |
} |
This file contains 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
import java.util.Scanner; | |
public class SearchMain { | |
public static void main(String args[]) { | |
String[] array = { "Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", | |
"Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-Ray", "Yankee", "Zulu" }; | |
Scanner scanner = new Scanner(System.in); | |
String word = ""; | |
char again; |
This file contains 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 org.topdank.cfide.io.gson; | |
import java.lang.reflect.Type; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.Set; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; |
This file contains 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 static String[] getPackages(String name) { | |
int len = packageLength(name); | |
if (len == 0) | |
return new String[] {}; | |
String[] arr = new String[len]; | |
int k = 0; | |
char[] chars = name.toCharArray(); | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < chars.length; i++) { | |
char c = chars[i]; |
This file contains 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 org.nullbool.api.obfuscation.refactor; | |
import java.lang.reflect.Modifier; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.List; |
This file contains 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 org.nullbool.api.obfuscation; | |
import java.util.HashSet; | |
import java.util.Set; | |
import org.nullbool.api.util.InstructionUtil; | |
import org.objectweb.asm.commons.cfg.tree.NodeVisitor; | |
import org.objectweb.asm.commons.cfg.tree.node.AbstractNode; | |
import org.objectweb.asm.commons.cfg.tree.node.ArithmeticNode; | |
import org.objectweb.asm.commons.cfg.tree.node.NumberNode; |
This file contains 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 NumberNode firstNumber(AbstractNode node) { | |
if(node == null || node.children() == 0) | |
return null; | |
for(AbstractNode n : node) { | |
if(n instanceof NumberNode) | |
return (NumberNode) n; | |
} | |
for(AbstractNode n : node) { |
OlderNewer