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
val decodedPayload = decodePayload() | |
val params = decodedPayload.split('&') | |
var returnUrl = params.find(_.startsWith("return_sso_url=")) | |
.getOrElse(throw new RuntimeException("sso payload missing return url")) | |
returnUrl = returnUrl.substring(returnUrl.indexOf('=') + 1) | |
var nonce = params.find(_.startsWith("nonce=")).getOrElse(throw new RuntimeException("sso payload missing nonce")) | |
nonce = nonce.substring(nonce.indexOf('=') + 1) |
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.spongepowered.windy.test; | |
import static org.spongepowered.api.command.args.GenericArguments.onlyOne; | |
import static org.spongepowered.api.command.args.GenericArguments.player; | |
import org.slf4j.Logger; | |
import org.spongepowered.api.Game; | |
import org.spongepowered.api.GameRegistry; | |
import org.spongepowered.api.block.BlockTypes; | |
import org.spongepowered.api.command.CommandManager; |
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 SomeClass { | |
private final Map<Integer, Anon> map = new HashMap<>(); | |
class Anon { | |
final int 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
{ | |
chance=39 | |
rewards=[ | |
{ | |
item { | |
ContentVersion=1 | |
Count=64 | |
ItemType="minecraft:apple" | |
} | |
}, |
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
{ | |
chance=39 | |
rewards=[ | |
{ | |
cmd="/say {player.name} got nothing." | |
} | |
] | |
} |
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
Direction direction = this.location.getBlock().get(Keys.DIRECTION).get(); | |
Location<World> barrierLocation = this.location.getBlockRelative(direction.getOpposite()) | |
.getBlockRelative(Direction.UP); | |
barrierLocation.setBlockType(BlockTypes.BARRIER, Cause.source(this.plugin.self).owner(player).build()); | |
Location<World> frameLocation = this.location.getBlockRelative(Direction.UP); | |
this.plugin.log.info(frameLocation.toString()); | |
World world = this.location.getExtent(); | |
Entity entity = world.createEntity(EntityTypes.ITEM_FRAME, new Vector3i( | |
frameLocation.getX(), frameLocation.getY(), frameLocation.getZ())); |
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
ItemFrame itemFrame = (ItemFrame) entity; | |
//itemFrame.setRawData(itemFrame.toContainer().set(DataQuery.of("Facing"), 0)); | |
this.plugin.log.info("" + itemFrame.supports(DirectionalData.class)); // false | |
//DirectionalData directionData = itemFrame.getOrCreate(DirectionalData.class).get(); | |
//directionData.set(directionData.direction().set(direction)); | |
//itemFrame.offer(directionData); | |
this.plugin.log.info(itemFrame.direction().get().toString()); // NONE | |
//itemFrame.offer(Keys.REPRESENTED_ITEM, ItemStack.of(ItemTypes.APPLE, 1).createSnapshot()); | |
world.spawnEntity(itemFrame, Cause.of(NamedCause.owner(player))); // ERROR |
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 se.walkercrou.crates; | |
import com.google.common.base.Objects; | |
import ninja.leaping.configurate.objectmapping.Setting; | |
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; | |
import org.spongepowered.api.data.key.Keys; | |
import org.spongepowered.api.data.meta.ItemEnchantment; | |
import org.spongepowered.api.item.Enchantments; | |
import org.spongepowered.api.item.ItemTypes; | |
import org.spongepowered.api.item.inventory.ItemStack; |
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
crates { | |
default { | |
name { | |
bold=true | |
color="blue" | |
text="Default Crate" | |
} | |
buyable=true | |
cost=0.5 |
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 se.walkercrou.crates; | |
import com.google.common.base.Objects; | |
import ninja.leaping.configurate.objectmapping.Setting; | |
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; | |
import org.spongepowered.api.item.inventory.ItemStackSnapshot; | |
import org.spongepowered.api.text.Text; | |
import org.spongepowered.api.text.TextTemplate; | |
@ConfigSerializable |