Skip to content

Instantly share code, notes, and snippets.

/**
* Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ
*/
public EntityFX doSpawnParticle(String par1Str, double par2, double par4,
double par6, double par8, double par10, double par12) {
if (this.mc != null && this.mc.renderViewEntity != null
&& this.mc.effectRenderer != null) {
int i = this.mc.gameSettings.particleSetting;
if (i == 1 && this.theWorld.rand.nextInt(3) == 0) {
@ft975
ft975 / gist:5702877
Last active December 18, 2015 01:19
/* Initiate the blocks */
try {
Method m = NewModBlock.class.getDeclaredMethod("init",
new Class[] { FMLInitializationEvent.class });
m.setAccessible(true);
m.invoke(null, (Object) evnt);
} catch (IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException
| SecurityException e) {
e.printStackTrace();
@ft975
ft975 / gist:5733264
Created June 8, 2013 00:11
Weird minecraft code
public boolean renderBlockByRenderType(Block par1Block, int par2, int par3,
int par4) {
int l = par1Block.getRenderType();
if (l == -1) {
return false;
} else {
par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3,
par4);
this.setRenderBoundsFromBlock(par1Block);
public enum MachineSide {
FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM;
public ForgeDirection toDirection(ForgeDirection facing) { //This method must return a result of type ForgeDirection. Note that a problem regarding missing 'default:' on 'switch' has been suppressed, which is perhaps related to this problem
switch (this) {
case BACK:
return facing.getOpposite();
case BOTTOM:
return ForgeDirection.DOWN;
case FRONT:
object MovingRegistry {
case class Key(world: World, pos: WorldPos){
private lazy val hash = world.getWorldInfo.getDimension + pos.x * pos.y * pos.z
override def hashCode(): Int = {
hash
}
override def equals(obj: Any): Boolean = {
obj match {
case obj:Key => obj.world == world && obj.pos == pos
java.lang.NoClassDefFoundError: scala/Math$
at mods.ft975.util.BlockHelper$$anonfun$dropItemStack$1.apply(BlockHelper.scala:23)
at mods.ft975.util.BlockHelper$$anonfun$dropItemStack$1.apply(BlockHelper.scala:13)
at scala.collection.immutable.List.foreach(List.scala:309)
at mods.ft975.util.BlockHelper$.dropItemStack(BlockHelper.scala:13)
at mods.ft975.lighting.BlockLamp.breakBlock(BlockLamp.scala:63)
at net.minecraft.world.chunk.Chunk.setBlockIDWithMetadata(Chunk.java:715)
at net.minecraft.world.World.setBlock(World.java:558)
at net.minecraft.world.World.setBlockToAir(World.java:687)
at net.minecraft.block.Block.removeBlockByPlayer(Block.java:1640)
def splitIntoNibbles(x: Short): Array[Byte] = {
val byteArray = new Array[Byte](4)
byteArray(0) = ((x & 0x000F) >> 0).toByte
byteArray(1) = ((x & 0x00F0) >> 2).toByte
byteArray(2) = ((x & 0x0F00) >> 4).toByte
byteArray(3) = ((x & 0xF000) >> 6).toByte
byteArray
}
(3:55:35 PM) LexManos: For note, the install system of FML/Forge will be changing durastically soon
(3:55:53 PM) tpw_rules: lol adblock thinks i meant fun.com
(3:56:21 PM) AbrarSyed: great, il have to redo it for 1.6 won't i.. -_-
(3:56:44 PM) fry: Lex, how, if I may ask? :P
(3:57:01 PM) davboecki is now known as davboecki|out
(3:57:34 PM) LexManos: Nolonger nessasary to decompile minecraft. Thats how
(3:58:19 PM) AbrarSyed: o_O
(3:58:41 PM) AbrarSyed: they are releasing the code? wut? or are we simply deobfuscating and building us a library to compile against?
(3:58:44 PM) fry: Will mcp setup still be supported?
(3:58:54 PM) tpw_rules: fry: installing, thx
java.lang.NoClassDefFoundError: scala/reflect/ClassManifest
at mods.ft975.lighting.LightingMod$$anonfun$setupBlocks$1$$anonfun$apply$2.apply(LightingMod.scala:61)
at mods.ft975.lighting.LightingMod$$anonfun$setupBlocks$1$$anonfun$apply$2.apply(LightingMod.scala:60)
at scala.collection.immutable.List.foreach(List.scala:309)
at mods.ft975.lighting.LightingMod$$anonfun$setupBlocks$1.apply(LightingMod.scala:60)
at mods.ft975.lighting.LightingMod$$anonfun$setupBlocks$1.apply(LightingMod.scala:59)
at scala.collection.immutable.List.foreach(List.scala:309)
at mods.ft975.lighting.LightingMod$.setupBlocks(LightingMod.scala:59)
at mods.ft975.lighting.LightingMod$.init(LightingMod.scala:33)
at mods.ft975.lighting.LightingMod.init(LightingMod.scala)
def setupBlocks() {
blockLamp = new BlockLamp(blockID)
blockLamp.setLightOpacity(0)
GameRegistry.registerBlock(blockLamp, classOf[ItemLamp], "BlockLamp", ModInfo.modID)
blockLamp.setCreativeTab(CreativeTabs.tabBlock)
for (col: Colors <- Colors.vals;
sha: Shapes <- Shapes.vals) {
val iS = ItemLamp.buildStack(1, col, sha, true)
LanguageRegistry.addName(iS, col.name + " " + sha.name)
DebugOnly {