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
# Copyright (c) 2020 Wyatt Childers. | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
if (Test-Path "llvm-project") { | |
Push-Location "llvm-project" | |
git pull | |
Pop-Location | |
} else { | |
git clone --branch feature/metaprogramming https://github.com/lock3/meta.git llvm-project | |
} | |
if (!(Test-Path "build")) { | |
New-Item -ItemType Directory -Name "build" |
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 findKey(searchObject, scopeVariableName) { | |
for (var objectKey in searchObject) { | |
if (objectKey === scopeVariableName) { | |
return searchObject; | |
} else if (objectKey === '$parent' && searchObject[objectKey] instanceof Object) { | |
if (searchObject.hasOwnProperty(objectKey)) { | |
var result = findKey(searchObject[objectKey], scopeVariableName); | |
if (result) { | |
return result; | |
} |
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
git checkout master && git branch --merged | grep -v master | xargs git branch -d |
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 class SpongeBlockRegistry implements BlockRegistry<BlockSnapshot> { | |
private Map<BlockType, Integer> blockTypeMapping = new HashMap<>(); | |
private List<List<Set<BlockTrait<?>>>> typeVariants = new ArrayList<>(); | |
private List<BlockType> blockTypes = new ArrayList<>(); | |
@Override | |
public BaseBlock getType(BlockSnapshot nativeType) { | |
BlockType targetType = nativeType.getState().getType(); | |
Set<BlockTrait<?>> traitSet = new HashSet<>(nativeType.getState().getTraits()); |
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 char loonyCharacter() { | |
switch (ChanceUtil.getRandom(7)) { | |
case 7: | |
return '?'; | |
case 6: | |
return '&'; | |
case 5: | |
return '!'; | |
case 4: |
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 void paste(String newMirage) throws IOException, DataException, CommandException { | |
File file = getFile(newMirage); | |
if (!file.exists()) { | |
throw new FileNotFoundException(); | |
} | |
EditSession editor = new EditSession(new BukkitWorld(world), -1); | |
// editor.setFastMode(true); Don't do this unless you plan to resend chunks later | |
CuboidClipboard clipboard = SchematicFormat.MCEDIT.load(file); | |
int maxX = clipboard.getWidth(); |
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.sk89q.commandbook.CommandBook; | |
import com.skelril.aurora.util.ChatUtil; | |
import com.skelril.aurora.util.LocationUtil; | |
import com.zachsthings.libcomponents.ComponentInformation; | |
import com.zachsthings.libcomponents.bukkit.BukkitComponent; | |
import com.zachsthings.libcomponents.config.ConfigurationBase; | |
import com.zachsthings.libcomponents.config.Setting; | |
import org.bukkit.Location; | |
import org.bukkit.Server; | |
import org.bukkit.entity.Player; |
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 com.skelril.aurora.util.item.itemstack; | |
import org.bukkit.Color; | |
import org.bukkit.configuration.serialization.ConfigurationSerialization; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.ItemMeta; | |
import org.bukkit.potion.PotionEffect; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; |
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
// $Id$ | |
/* | |
* WorldEdit | |
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* |