id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
384bfe0e-1552-4e3d-9f4f-f9c059b6f400 | public double tenFoldCrossValidation() {
System.out.println("Start 10-fold cross validation");
double[] output;
double error = 0;
double[] results = new double[22];
for (int i = 0; i < patterns.size(); i++) {
for (int j = 0; j < patterns.size()-1; j++) {
network.s... |
ace4bada-c76d-4591-9fc1-dd07fb3f8532 | private void lastElemToStart() {
List<Pattern> newList = new LinkedList<Pattern>();
newList.add(patterns.get(patterns.size()-1));
newList.addAll(patterns.subList(0, patterns.size()-1));
patterns.clear();
patterns.addAll(newList);
} |
80f1f6f4-d0f8-4632-bf7e-7a06a80ac4bb | public Connection(Neuron fromN, Neuron toN) {
this.from = fromN;
this.to = toN;
this.id = counter;
counter++;
} |
aeb83c35-fb63-45af-afa0-fa2d751102d0 | public double getWeight() {
return weight;
} |
f8d549f5-6675-4536-b42e-3bc5f214414a | public void setWeight(double w) {
weight = w;
} |
ab2b7287-779f-4513-9761-18802134b1d0 | public void setDeltaWeight(double w) {
prevDeltaWeight = deltaWeight;
deltaWeight = w;
} |
5df22fd6-d654-4d50-8992-08691647b3aa | public double getPrevDeltaWeight() {
return prevDeltaWeight;
} |
e9b35a6b-2c6c-4320-86e5-e67b918d9d78 | public Neuron getFromNeuron() {
return from;
} |
ee494c71-afb2-469f-b1fb-2946e48040a6 | public Neuron getToNeuron() {
return to;
} |
e51a1ea5-040f-4666-a156-e4061e9ab706 | public ShowPanel() {
setTitle("Input Vector");
setSize(new Dimension(500, 520));
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setLocationRelativeTo(null);
img = new BufferedImage(500, 500, BufferedImage.TYPE_INT_RGB);
} |
c0f9dabc-081c-4ced-9447-0cebb5a6d3c6 | @Override
public void paint(Graphics g) {
super.paint(g);
g.drawImage(img, 0, 20, this);
} |
6d708c34-7191-474c-866b-201857a2875c | public void render(Vector<SOMVector> inputs) {
float fl = (float)Math.sqrt(inputs.size());
int qb = Math.round(fl);
if (fl > qb) qb += 1;
float cellWidth = img.getWidth() / qb;
float cellHeight = img.getHeight() / qb;
int imgW = img.getWidth();
int imgH = img.getHeight();
Graphics2D g2 = img... |
a3a8cdfa-e83c-4896-bcef-5e001fa54bd6 | private SOMVector getNone() {
return new SOMVector(1f, 1f, 1f);
} |
9b873070-c403-4929-ac72-8f232bb7ffb1 | public LatticeRenderer(Vector<SOMVector> inputVect) {
setTitle("SOM Map");
setSize(new Dimension(size, size));
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setLocationRelativeTo(null);
this.inputVect = inputVect;
} |
c16c47e1-a218-4197-8ffd-66c60640e102 | @Override
public void paint(Graphics g) {
super.paint(g);
if (img != null) {
g.drawImage(img, 0, 0, this);
} else {
g.setColor(Color.WHITE);
g.fillRect(0, 0, size, size);
}
} |
d849517f-7c7d-44c4-8ecb-deccebb18fd3 | public void render(SOMLattice lattice, int iteration) {
float cellWidth = (float)getWidth() / (float)lattice.getWidth();
float cellHeight = (float)getHeight() / (float)lattice.getHeight();
int imgW = img.getWidth();
int imgH = img.getHeight();
graph.setColor(Color.BLACK);
graph.fillRect(0,0,imgW,imgH)... |
dd42c979-de21-4ff6-9d35-65df763be11f | private Color closest(SOMVector vec, Vector<SOMVector> inputs) { // for better visualization
SOMVector best = inputs.get(0);
double bestDist = vec.euclideanDist(best);
double dist;
for (int i = 0; i < inputs.size(); i++) {
dist = vec.euclideanDist(inputs.get(i));
if (dist < bestDist) {
bestD... |
ab52c794-73be-4887-bf64-49cbf3282235 | public BufferedImage getImage() {
if (img == null) {
img = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
graph = img.createGraphics();
}
return img;
} |
341575ae-b982-4e35-a9be-a306615ff45c | public SOMLattice(int w, int h) {
width = w;
height = h;
matrix = new SOMNode[width][height];
for (int x=0; x<w; x++) {
for (int y=0; y<h; y++) {
matrix[x][y] = new SOMNode(3);
matrix[x][y].setX(x);
matrix[x][y].setY(y);
}
}
} |
bdf45c54-da5e-4054-b1b5-c9f110041f86 | public SOMNode getNode(int x, int y) {
return matrix[x][y];
} |
bf801e30-b925-42e0-8712-b0a68bdcca9b | public void setNode(int x, int y, SOMNode node) {
matrix[x][y] = node;
} |
36efcbd2-e21d-4e6e-a637-e63744f5e22a | public int getWidth() {
return width;
} |
ed1e52ac-73e6-4985-ba09-aa946a7c6574 | public int getHeight() {
return height;
} |
540ef90c-a71f-47d7-8931-57d26d97436c | public SOMNode[][] getMatrix() {
return matrix;
} |
f3cdc5a4-c04b-4803-b560-c8f223c912eb | public SOMNode getWinner(SOMVector inputVector) {
SOMNode bmu = matrix[0][0];
double bestDist = inputVector.euclideanDist(bmu.getVector());
double curDist;
for (int x=0; x<width; x++) {
for (int y=0; y<height; y++) {
curDist = inputVector.euclideanDist(matrix[x][y].getVector());
if (curDist < best... |
a628b2bf-5ad3-47ff-8167-e69dd99e0028 | public BufferedImage use(BufferedImage src, Vector<SOMVector> inputVectors) {
BufferedImage result = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
SOMVector tempVec = null;
if (closestType) {
for (int i = 0; i < getWidth(); i++) {
for (int j = 0; j < getHeight(); j++) {... |
cbfa0950-68c8-44d1-9819-51e4e37d4421 | public static SOMVector closestVect(SOMVector vec, Vector<SOMVector> inputs) { // end
SOMVector best = inputs.get(0);
double bestDist = vec.euclideanDist(best);
double dist;
for (int i = 0; i < inputs.size(); i++) {
dist = vec.euclideanDist(inputs.get(i));
if (dist < bestDist) {
bestDist = dist;
... |
5468b61a-6596-44b1-8817-82e72f0a119b | private float scale(int val) {
return 1 - ((float)(255-val)/(float)255);
} |
184f74de-4834-4762-95f2-b1476d8f4a09 | private int unscale(double val) {
return (int)(255*val);
} |
47cda594-839b-4ade-923c-177f0a18b05b | public SOMVector() {} |
db4d67b0-2d70-4f3e-9aa2-8711a41b9a34 | public SOMVector(Float r, Float g, Float b) {
super();
addElement(r);
addElement(g);
addElement(b);
} |
18a9c6e0-1208-48f8-aaad-86f01fbacdeb | public SOMVector(Color c) {
super();
addElement(scale(c.getRed()));
addElement(scale(c.getGreen()));
addElement(scale(c.getBlue()));
} |
70f46e22-dda3-40a1-923d-99cb3bf8ebd3 | public double euclideanDist(SOMVector v2) { // euclidean dist ipt Vect - som vect
double summation = 0, temp;
for (int x=0; x<size(); x++) {
temp = elementAt(x).doubleValue() -
v2.elementAt(x).doubleValue();
temp *= temp;
summation += temp;
}
return summation;
} |
17e1cc29-2ace-410c-a5a6-e89142914f72 | public SOMVector minus(SOMVector vec) {
SOMVector result = new SOMVector();
result.addElement(get(0)-vec.get(0));
result.addElement(get(1)-vec.get(1));
result.addElement(get(2)-vec.get(2));
return result;
} |
66b1935f-0126-4b47-aaae-e209ab20a2f6 | @Override
public boolean equals(Object obj) {
SOMVector vec = (SOMVector)obj;
boolean thesame = true;
for (int i = 0; i < this.size(); i++) {
if (get(i).floatValue() != vec.get(i).floatValue()) {
thesame = false;
}
}
return thesame;
} |
be170a1f-5693-44d4-9b98-44c5457f0e67 | private static float scale(int val) {
return 1 - ((float)(255-val)/(float)255);
} |
697b52ec-539d-4964-bdc5-ac2419c09a6b | public SOMNode(int numWeights) {
weights = new SOMVector();
for (int x=0; x<numWeights; x++) {
weights.addElement(new Float(Math.random()*0.7));
}
this.furtherDeltaWeights = new SOMVector(0f, 0f, 0f);
} |
a7e82b97-a1b8-479b-9e6b-4ef4c3c08918 | public void setWeights(SOMVector weights) {
this.weights = weights;
} |
ceb3ece2-6050-4415-b967-028168709bbf | public void setX(int xpos) {
xp = xpos;
} |
f31e0a31-d957-49a3-9d1e-3eaaabcb0fc7 | public void setY(int ypos) {
yp = ypos;
} |
d03a7a72-7402-4f54-a18b-aafa402bfaee | public int getX() {
return xp;
} |
febe7523-1bb8-4bb7-ac43-3542c78a3c6e | public int getY() {
return yp;
} |
48e30486-0787-43db-83ac-853f8e0a9ebf | public double distanceTo(SOMNode n2) { // eucides distance som node - som node
int xleg, yleg;
xleg = getX() - n2.getX();
xleg *= xleg;
yleg = getY() - n2.getY();
yleg *= yleg;
return xleg + yleg;
} |
507c821e-aaff-4f2d-9502-1fb3860274b0 | public SOMVector getVector() {
return weights;
} |
910ef649-1a2d-48f4-82c0-974dee3f6788 | public void adjustWeights(SOMVector input, double learningRate, double distanceFalloff) {
SOMVector weightsTemp = (SOMVector)weights.clone();
double wt, vw;
for (int w=0; w<weights.size(); w++) {
wt = weights.elementAt(w).doubleValue();
vw = input.elementAt(w).doubleValue();
wt += distanceFalloff * le... |
66b4e4b8-b9ea-4ce3-8596-8d757f525058 | @Override
public boolean equals(Object obj) {
SOMNode elem = (SOMNode)obj;
return getVector().equals(elem.getVector());
} |
868a46f7-570c-4cee-a4cf-d616bd375841 | public boolean isNeighboor(SOMNode n2) {
double dist = this.distanceTo(n2);
return dist <= 2;
} |
663401f9-4ac1-4848-948e-cdb42539cce0 | public SOMTrainer() {
this.running = false;
} |
122f21e1-6e15-4084-a0be-72fa2d0778b6 | private double getNeighborhoodRadius(double iteration) {
return LATTICE_RADIUS_MAX * Math.pow((1/LATTICE_RADIUS_MAX), iteration/NUM_ITERATIONS);
} |
7896470d-03bb-4916-a7d5-eb466b4faa2e | private double getDistanceFalloff(double distSq, double radius) { // nbh fct
double radiusSq = radius * radius;
return Math.exp(-(distSq)/(2 * radiusSq));
} |
1caa14fe-a758-465c-9d3f-0d0959b1fa75 | public void setTraining(SOMLattice latToTrain, Vector<SOMVector> in) {
lattice = latToTrain;
inputs = in;
this.renderer = new LatticeRenderer(in);
this.renderer.getImage();
} |
62d77266-1eb2-4b1f-ae5b-c8142035995f | public void start() {
if (lattice != null) {
runner = new Thread(this);
runner.setPriority(Thread.MAX_PRIORITY);
running = true;
renderer.setVisible(true);
runner.start();
}
} |
ce11afb5-c6e8-48f7-8fe7-553a1a532f0c | @Override
public void run() {
int lw = lattice.getWidth();
int lh = lattice.getHeight();
int xstart, ystart, xend, yend;
double dist, dFalloff;
LATTICE_RADIUS_MAX = Math.max(lw, lh)/2;
int iteration = 0;
double nbhRadius;
SOMNode bmu = null, temp = null;
SOMVector curInput = null;
double lear... |
1d755107-a352-4408-9c2f-e56039e3d62c | public void stop() {
if (runner != null) {
running = false;
while (runner.isAlive()) {};
}
} |
9fd8015f-8640-4ed4-bf73-48551dce15d1 | public SOMLattice getLattice() {
return lattice;
} |
d7294f41-fedd-4bd1-a5fc-6b8b7a17a644 | public HashMap<String, List<String>> extractFeatures(
HashMap<String, List<String>> tagged, String outputfolder) throws IOException {
System.out.println();
System.out.println("EXTRACT RELEVANT FEATURES");
InputStream inputStreamStopWords = getClass().getResourceAsStream("/genericStopWords.list");
Buffe... |
a52bad27-8d28-4cb7-8374-4c7ca6e3e248 | public List<String> tokenize(String toTokenize) {
toTokenize = toTokenize.replace("'", " '");
// System.out.println(toTokenize);
List<String> tokens = new ArrayList<String>();
BreakIterator bi = BreakIterator.getWordInstance();
bi.setText(toTokenize);
int begin = bi.first();
int end;
for (end = bi.next(... |
e83bb2c0-d854-409a-af43-d189a9cd46b9 | public HashMap<String, List<String>> tokenizeDescriptions(
HashMap<String, List<String>> filesContent) {
System.out.println();
System.out.println("Begin tokenization");
HashMap<String, List<String>> tokenLists = new HashMap<String, List<String>>();
List<String> niod_tokens = new ArrayList<String>();
Lis... |
d47deebc-5514-40fa-b848-a9cef2b1244e | public HashMap<String, List<String>> annotatePOS(
HashMap<String, List<String>> tokens) throws IOException,
TreeTaggerException {
System.out.println();
System.out.println("BEGIN POS ANNOTATION");
HashMap<String, List<String>> annotated = new HashMap<String, List<String>>();
List<String> niod_pos = new Ar... |
199332a5-b020-46fe-bb42-7d7d1b645d4d | static List<String> removeDuplicates(List<String> arrayList) {
HashSet<String> set = new HashSet<String>(arrayList);
arrayList.clear();
arrayList.addAll(set);
return arrayList;
} |
8e4e9ca2-ccc6-4827-8595-809c0643ecf5 | static List<Integer> removeDuplicateIndexes(List<Integer> arrayList) {
HashSet<Integer> set = new HashSet<Integer>(arrayList);
arrayList.clear();
arrayList.addAll(set);
return arrayList;
} |
e834f3cc-dce6-418e-84b6-1e1c5116aba0 | static String listToString(List<String> arrayList) {
String string = "";
for (int i = 0; i < arrayList.size() - 1; i++) {
string = string + arrayList.get(i) + " ";
}
if (arrayList.size() > 0) {
string = string + arrayList.get(arrayList.size() - 1);
}
return string;
} |
0cc578c9-8b68-46c3-8aec-4864802e784d | static String listToString2(List<String> arrayList) {
String string = "";
for (int i = 0; i < arrayList.size() - 1; i++) {
string = string + arrayList.get(i) + " ";
}
if (arrayList.size() > 0) {
string = string + arrayList.get(arrayList.size() - 1);
}
return string;
} |
0f6fc423-5068-46f4-a0cd-49580286429e | public static HashMap<String, Double> sortByValue(HashMap<String, Double> map) {
List<Map.Entry<String, Double>> list = new LinkedList<Map.Entry<String, Double>>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {
public int compare(Map.Entry<Strin... |
b735695b-119f-4dbb-ba52-a6ed1b7d8f04 | public int compare(Map.Entry<String, Double> m1, Map.Entry<String, Double> m2) {
int out = 0;
if (m2.getValue() < m1.getValue()){
out = -1;
}
if (m2.getValue() > m1.getValue()){
out = 1;
}
if (m2.getValue(... |
b0edadef-cbfb-44db-b315-55c3d70d13e2 | public String substituteSynonym(String word) {
InputStream inputStreamSynonyms = getClass().getResourceAsStream(
"/synonyms.dic");
String feature;
// Create dictionary of synonyms
HashMap<String, String> dictionary = new HashMap<String, String>();
BufferedReader br = null;
String currentLine;
try {... |
1fc603a3-c47f-4324-a16c-a1b3ce6e36dc | public HashMap<String, List<String>> loadFiles4Model(String descriptionsFolder) {
File descriptions = new File(descriptionsFolder);
System.out.println("Loading files...");
List<String> niod_lines = new ArrayList<String>();
List<String> wl_lines = new ArrayList<String>();
List<String> yv_lines = new ArrayList<... |
f3ddf601-e635-4dd6-a6eb-fb053da27ea1 | public HashMap<String, HashMap<String, Double>> rankingTfIdf(
HashMap<String, List<String>> extractedFeats, String targetFolder)
throws IOException {
File featuresFile = new File("features.txt");
System.out.println();
System.out.println("Begin ranking of features");
// Read files features.txt and store t... |
10078714-f3df-4cc0-869a-e5106ebd8c57 | public String getTreeTaggerFolder() {
Properties prop = new Properties();
try {
prop.load(getClass().getResourceAsStream("/config.properties"));
} catch (IOException ex) {
ex.printStackTrace();
}
final String TREETAGGER_FOLDER = prop.getProperty("treetagger_folder");
return TREETAGGER_FOLDER;
} |
7898f60c-b34c-4081-9092-e35962d0f9ec | public static void main( String[] args ) throws IOException, TreeTaggerException
{
String descriptionsFolder = args[0];
String targetFolder = args[1];
//Load collection and file descriptions
LoadFiles upload = new LoadFiles();
HashMap<String, List<String>> uploaded = upload
.loadFil... |
e7e4c30d-ccf1-4317-9103-19cd390e39a9 | public List<String> annotatePOSpeech(List<String> tokenized)
throws IOException, TreeTaggerException {
// Point TT4J to the TreeTagger installation directory. The executable
// is expected
// in the "bin" subdirectory - in this example at
// "/opt/treetagger/bin/tree-tagger"
System.setProperty("treetagg... |
1b0fbe18-28e5-41e3-9a0e-1e89456e773e | public void token(String token, String pos, String lemma) {
outputTreeTagger.add(token + "\t" + pos + "\t" + lemma);
} |
a7b76523-06d6-4582-8005-20515ac326b8 | public AppTest( String testName )
{
super( testName );
} |
e339e2b0-abeb-4924-9f15-be6bfb152c83 | public static Test suite()
{
return new TestSuite( AppTest.class );
} |
6416777b-4b1c-47fa-9fb0-93ba2d091d38 | public void testApp()
{
assertTrue( true );
} |
dc9cc1c4-00a3-4771-9af6-81dc7fe00a40 | @Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
Config.init(event.getSuggestedConfigurationFile());
ItemsAndBlocks.init();
} |
92f254b2-9177-49e1-a62b-701728d3c781 | @Mod.EventHandler
public void init(FMLInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new EventHandler());
} |
696695ef-7ea8-4f34-9cb2-0cb188ad5d5c | @Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{} |
396fdae8-5628-45b1-a1ed-e16afa658c73 | public CreativeTabBB() {
super(CreativeTabs.getNextID(), "B&B");
} |
4f4581b5-64d8-4b71-bce5-1032350d9745 | @Override
public Item getTabIconItem() {
return Items.egg;
} |
48ce39a2-c122-4e7d-b5fd-daced003633a | @SideOnly(Side.CLIENT)
public String getTranslatedTabLabel()
{
return "Bits & Bobs";
} |
1af41321-baa7-4e57-b50d-f76b3a1cb854 | protected EnchantmentBB(int id) {
super(id == Ref.opulenceID ? Ref.opulenceID : Ref.earthbaneID, 0, EnumEnchantmentType.all);
this.setName(id == Ref.opulenceID ? "Opulence" : "Earthbane");
this.id = id;
} |
d548afc5-0b98-4d6d-87e4-e4e5ddd2e0b5 | @Override
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
} |
05c22d6e-1bce-4963-8d7e-a40f485e404e | @Override
public boolean isAllowedOnBooks()
{
return false;
} |
3fd32d39-906b-4770-8b4f-ef68693b1b49 | @Override
public boolean canApplyTogether(Enchantment enchantment)
{
if(id == Ref.opulenceID && (enchantment == Enchantment.fortune || enchantment == Enchantment.silkTouch || enchantment == Enchantment.looting))
{
return false;
}
else
{
return true;
}
} |
a44d97b3-e098-4877-b0b0-4f9cc14dbcd7 | public static void init()
{
initializeBlocks();
registerBlocks();
initializeItems();
registerItems();
registerSmelts();
registerRecipes();
registerOreDict();
} |
c227e713-4224-48e7-868c-de09e3738a40 | public static void initializeBlocks()
{
oreCrackedIron.setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName("oreCrackedIron").setBlockTextureName(TEXTURE + "oreCrackedIron");
oreCrackedGold.setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName("ore... |
f5c6b0fc-be59-4bc8-afcb-6d3b16e3b6e3 | public static void registerBlocks()
{
GameRegistry.registerBlock(oreCrackedIron, "oreCrackedIron");
GameRegistry.registerBlock(oreCrackedGold, "oreCrackedGold");
} |
5a3dec22-28f7-4391-8001-02893b95d02e | public static void initializeItems()
{
diamondTP.setUnlocalizedName("thickPickaxeDiamond").setTextureName(TEXTURE + "thickPickaxeDiamond");
diamondTS.setUnlocalizedName("thickShovelDiamond").setTextureName(TEXTURE + "thickShovelDiamond");
diamondTA.setUnlocalizedName("thickAxeDiamond").setTextureName(TEXTURE + "... |
ed955f6b-7664-423b-b5fb-872da4105f77 | public static void registerItems()
{
GameRegistry.registerItem(diamondTP, "thickPickaxeDiamond");
GameRegistry.registerItem(diamondTS, "thickShovelDiamond");
GameRegistry.registerItem(diamondTA, "thickAxeDiamond");
GameRegistry.registerItem(ironTP, "thickPickaxeIron");
GameRegistry.registerItem(ironTS, "thic... |
4999bf63-625e-4534-904f-1d70c12bbadc | public static void registerSmelts()
{
GameRegistry.addSmelting(oreCrackedIron, new ItemStack(Items.iron_ingot), 3.0F);
GameRegistry.addSmelting(oreCrackedGold, new ItemStack(Items.gold_ingot), 3.0F);
} |
7c14e7a3-771c-4c1d-9739-2031c2a8c73a | public static void registerRecipes()
{
GameRegistry.addShapedRecipe(new ItemStack(diamondTP), new Object[]{"DDD", " P ", " H ", 'D', new ItemStack(diamondPlate), 'P', new ItemStack(Items.diamond_pickaxe), 'H', new ItemStack(toolHandle)});
GameRegistry.addShapedRecipe(new ItemStack(diamondTS), new Object[]{"D", "S"... |
2b7407bb-3f31-4324-8cdd-9776b1b8fbb5 | public static void registerOreDict()
{} |
25cc6c89-809c-4baf-9ed0-da36e3d68c53 | public static void init(File file)
{
Configuration config = new Configuration(file);
config.load();
Ref.opulenceID = config.get("Settings", "Opulence Enchantment ID", 60).getInt();
Ref.earthbaneID = config.get("Settings", "Earthbane Enchantment ID", 63).getInt();
config.save();
} |
67de8eee-378d-4621-873d-0cca55ffb7d2 | public ItemEBPick(ToolMaterial material)
{
super(material);
} |
4aa96ff1-238a-4715-835f-80fdf627680c | @Override
public boolean onBlockDestroyed(ItemStack tool, World world, Block block, int x, int y, int z, EntityLivingBase user)
{
if(user instanceof EntityPlayer && canMine(block) && !world.isRemote)
{
EntityPlayer player = (EntityPlayer)user;
int lvlE = tool.stackTagCompound.getInteger("lvl");
boole... |
e423b40f-e2df-448f-9564-19102ccc3a01 | private boolean canMine(Block block)
{
return block == Blocks.stone ? true : block == Blocks.netherrack ? true : block == Blocks.end_stone ? true : block == Blocks.obsidian ? true : false;
} |
5c225d79-fef9-48e2-a83c-3acbd3bc3c17 | @Override
public void onCreated(ItemStack item, World world, EntityPlayer player)
{
item.stackTagCompound = new NBTTagCompound();
item.stackTagCompound.setInteger("lvl", 1);
item.stackTagCompound.setBoolean("drops", true);
} |
ab32c368-9af3-441b-bd6d-b7628620ae6d | @Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player)
{
if(player.isSneaking())
{
ItemStack result = item;
Boolean drops = result.stackTagCompound.getBoolean("drops");
result.stackTagCompound.setBoolean("drops", drops == true ? false : true);
return resu... |
0c430667-5c01-40ea-839a-4445b7e1dfd4 | public ItemThickShovel(ToolMaterial material)
{
super(EnumHelper.addToolMaterial("thick" + material.name(), material.getHarvestLevel(), material.getMaxUses()*4, material.getEfficiencyOnProperMaterial(), material.getDamageVsEntity(), material.getEnchantability()));
this.setCreativeTab(Ref.tab);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.