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
var util = require('./util.js'); | |
exports.CreateGeneration = function (args) { | |
var rpcData = args.rpcData; | |
var publicKey = args.publicKey; | |
var extraNoncePlaceholder = args.extraNoncePlaceholder; | |
var rewardType = args.rewardType; | |
var txMessages = args.txMessages; |
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 struct PlayerLives { | |
public static readonly PlayerLives Infinite = new PlayerLives(-1); | |
private readonly int _lives; | |
public readonly bool IsInfinite; | |
public PlayerLives(int lives) { | |
_lives = lives; |
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
/* | |
* This file is licensed under the MIT License (MIT). | |
* | |
* Copyright (c) JCThePants (github.com/JCThePants) | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
/* | |
* This file is licensed under the MIT License (MIT). | |
* | |
* Copyright (c) JCThePants (www.jcwhatever.com) | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
var hasMoved = true, | |
hasNotMoved = false; | |
// check ideal values | |
assert(0, 45, hasNotMoved); | |
assert(0, 91, hasMoved); | |
assert(0, -91, hasMoved); | |
assert(90, clamp(181), hasMoved); | |
assert(90, 180, hasNotMoved); |
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
var slotWidth = 100; // The width of the container | |
var slotHeight = 100;// The height of the container | |
var imgWidth = 200; // The width of the image to draw inside the container | |
var imgHeight = 200; // The height of the image to draw inside the container | |
var offsetTop = 0; // The offset of the image from the top of the container | |
var offsetLeft = 0; // The offset of the image from the left of the container | |
var width = imgWidth; // the new image draw width | |
var height = imgHeight; // the new image draw height |
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
function selectAllText(elem) {; | |
var range = document.createRange(); | |
range.setStart(elem, 0); | |
var i = 0; | |
while (i < 999999) { // could have used 'true', but I don't like the infinite loop | |
try { | |
range.setEnd(elem, i++); | |
} catch (err) { | |
break; | |
} |
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
args = { ... } | |
-- hasModem hasEnderChest size depth [startDepth] | |
-- Used to denote the current direction relative to the direction the | |
-- turtle was facing when the program starts. The start direction is FORWARD. | |
direction = {} | |
direction.FORWARD = 0 | |
direction.RIGHT = 1 | |
direction.BACKWARD = 2 | |
direction.LEFT = 3 |
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 com.jcwhatever.nucleus.messaging.ChatPaginator; | |
import com.jcwhatever.nucleus.messaging.IMessenger; | |
import org.bukkit.Bukkit; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.UUID; |
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
16 chunk sections in a chunk. A chunk is 16x256x16 (x y z) blocks. A chunk section is 16x16x16 blocks. | |
-------------------------------------------------- | |
Chunk: | |
Section: | |
Block Data: 2 bytes per block. 8192 bytes. format: blockId << 4 | meta | |
Emitted Light: 4 bits per block (1/2 byte). 2048 bytes | |
Skylight: 4 bits per block (1/2 byte). 2048 bytes (only included in overworld) | |
Biome: 1 byte per block column. 256 bytes. (only included if all sections are in chunk) | |
-------------------------------------------------- |