This file contains hidden or 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 string | |
primes = [] | |
first100primes = [] | |
START_VALS = range(0,3) | |
SIZE_VALS = range(1,4) | |
class XY: | |
def __init__(self, x, y): | |
self.x = x |
This file contains hidden or 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
/** | |
* Helper class that we use to register things | |
*/ | |
public class Registrator<T extends IForgeRegistryEntry<T>> | |
{ | |
public IForgeRegistry<T> registry; | |
public Registrator(IForgeRegistry<T> registry) | |
{ | |
this.registry = registry; |
This file contains hidden or 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
/** | |
WHAT ARE WE WORKING WITH | |
--Dimension, DimensionType, ServerWorld | |
-- There exists a 1:1:1 relationship between each of these, e.g. there will be one DimensionType instance | |
and one Dimension instance for a given ServerWorld, and those DimensionType and Dimension instances will only be | |
used on that worldserver | |
--ServerWorld | |
-- The server-specific version of the World, which holds all the block and chunk data, entities, tile entities, etc.\ | |
for a given dimension. You won't be making these yourself or extending the class, but you'll need to find and use the | |
ServerWorld for your Dimension to teleport the player there. |
This file contains hidden or 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
``` | |
EFFECTS OF TAGGING A FLUID AS WATER IN VANILLA MINECRAFT + FORGE CODE | |
This list is not intended to be exhaustive, up-to-date, or accurate | |
- Sponges can absorb WATER | |
- Walking while fully submerged in WATER is exhausting and counts as walking underwater for stats-tracking | |
- Allows things to pathfind through it if necessary (things won't pathfind through any fluid that isn't WATER) | |
- Decrements your air supply | |
- Allows the worldcarver to carve through the floor beneath WATER | |
- Affects reactions between your fluid and LAVA | |
- Prevents other WATER from displacing your fluid |
This file contains hidden or 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
/** TLDR | |
* Update Tag -> sent when client loads the chunk the TE is in | |
* Update Packet -> sent when you call world.notifyBlockUpdate | |
**/ | |
public class YourTileEntity extends TileEntity | |
{ | |
public YourTileEntity() |
This file contains hidden or 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
/** | |
The MIT License (MIT) | |
Copyright (c) Joseph "Commoble" Bettendorff 2020 | |
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 hidden or 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
/** | |
AbstractBlock::getShape(BlockState, IBlockReader, BlockPos, ISelectionContext) | |
The primary shape for "selection" raytraces, like clicking a block. | |
Defaults to a full cube. Delegated to by AbstractBlockState::getShape(IBlockReader, BlockPos, ISelectionContext) | |
Most of the other shape getters either default to this or default to empty, | |
so just overriding this shape getter is sufficient if finer variations aren't needed. | |
AbstractBlock::getCollisionShape(BlockState, IBlockReader, BlockPos, ISelectionContext) | |
The primary shape for collision raytraces. | |
Delegated to by AbstractBlockState::getCollisionShape(IBlockReader, BlockPos, ISelectionContext) |
This file contains hidden or 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
how does furnace logic flow? | |
if burning, decrement burn time | |
rest of tick is on server worlds only | |
if burning, or if can start burning fuel and has a smeltable input | |
if not burning but can start cooking | |
set burn time based on fuel input |
This file contains hidden or 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 final Direction D = Direction.DOWN; | |
public static final Direction U = Direction.UP; | |
public static final Direction N = Direction.NORTH; | |
public static final Direction S = Direction.SOUTH; | |
public static final Direction W = Direction.WEST; | |
public static final Direction E = Direction.EAST; | |
public static final Direction[] SAMES ={D,U,N,S,W,E}; | |
public static final Direction[] OPPOSITES = {U,D,S,N,E,W}; | |
public static final Direction[] ROTATE_X_DNUS = {N,S,U,D,W,E}; |
This file contains hidden or 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
/** | |
* Returns an array of numbers [a0, a1, a2 ... a(n-1)] | |
* Where each number aX is unique, | |
* n is given by permutationSize, | |
* and the different possible numbers returnable are in the range [0, possibilities). | |
* | |
* Implements the algorithms given here | |
* https://stackoverflow.com/questions/158716/how-do-you-efficiently-generate-a-list-of-k-non-repeating-integers-between-0-and-n | |
* https://www.geeksforgeeks.org/generate-a-random-permutation-of-1-to-n/ | |
* |
OlderNewer