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 InventoryDescription { | |
protected final Int2ObjectMap<SlotDescription> slots = new Int2ObjectRBTreeMap<>(); | |
protected final Int2ObjectMap<BiPredicate<@Nullable Direction, ItemStack>> insertionRules = new Int2ObjectRBTreeMap<>(); | |
protected final Int2ObjectMap<BiPredicate<@Nullable Direction, ItemStack>> extractionRules = new Int2ObjectRBTreeMap<>(); | |
public SlotDescription describeSlot(int index, @Nullable Predicate<ItemStack> inputFilter, @Nullable Predicate<ItemStack> outputFilter) { | |
Preconditions.checkArgument(index >= 0, "Slot indices must be non-negative"); | |
Preconditions.checkArgument(!slots.containsKey(index), "Slot with index %d already exists", index); | |
final Predicate<ItemStack> normalizedInputFilter = inputFilter == null ? Predicates.alwaysTrue() : inputFilter; | |
final Predicate<ItemStack> normalizedOutputFilter = outputFilter == null ? Predicates.alwaysTrue() : outputFilter; |
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
<?php | |
$divider_flags = [ | |
3 => "three", | |
5 => "five", | |
7 => "hello" | |
]; | |
# Order of this array is preserved | |
$flag_correspondences = [ |
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
document.querySelectorAll(".image-vertical").forEach(canvas => canvas.toBlob(blob => console.log(URL.createObjectURL(blob)))) |
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
local function pointerAdd(state) | |
state.pointer = state.pointer + 1 | |
end | |
local function pointerSub(state) | |
state.pointer = state.pointer - 1 | |
end | |
local function dataAdd(state) | |
state.data[state.pointer] = (state.data[state.pointer] or 0) + 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
public final SimpleSingleVariantStorage<FluidVariant> fluidStorage = SimpleSingleVariantStorageBuilder.fluid() | |
.supportsExtraction(false) | |
.build(fluidVariant -> FluidConstants.BUCKET, () -> markDirty()); |
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
/** | |
* <h2>USAGE EXAMPLE</h2> | |
* | |
* <p>In your ModInitializer: | |
* <pre>{@code | |
* AutoRegistry.create(MODID) | |
* .run(Registries.BLOCK, MyBlocks.class) | |
* .run(Registries.ITEM, MyItems.class); | |
* }</pre> | |
* |
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 AdvancementUtil { | |
protected String namespace = "all"; | |
protected String path = "all"; | |
protected final ServerPlayerEntity player; | |
protected final ServerAdvancementLoader advancementLoader; | |
protected final PlayerAdvancementTracker advancementTracker; | |
protected AdvancementUtil(ServerPlayerEntity player) { | |
this.player = player; | |
advancementLoader = player.getServer().getAdvancementLoader(); |
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 Commands { | |
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess registryAccess, CommandManager.RegistrationEnvironment environment) { | |
var revelationaryNode = CommandManager | |
.literal("revelationary") | |
.requires(source -> source.hasPermissionLevel(4)) | |
.build(); | |
dispatcher.getRoot().addChild(revelationaryNode); | |
var advancementNode = CommandManager.literal("advancement").build(); | |
revelationaryNode.addChild(advancementNode); |
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 render(MagicCauldronBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { | |
matrices.push(); | |
var entry = matrices.peek(); | |
var positionMatrix = entry.getPositionMatrix(); | |
var normalMatrix = entry.getNormalMatrix(); | |
var bufferBuilder = vertexConsumers.getBuffer(RenderLayer.getEntitySolid(LAVA_TEX)); | |
bufferBuilder.vertex(positionMatrix,0, 1, 0).color(255, 255, 255,255).texture(0, 0).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(normalMatrix,0, 1, 0).next(); |
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
const MODRINTH_API = 'https://staging-api.modrinth.com/v2'; | |
const MODRINTH_DESTINATION = 'https://staging.modrinth.com'; | |
addEventListener("fetch", (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); |
NewerOlder