Skip to content

Instantly share code, notes, and snippets.

@Cazzar
Cazzar / -
Created November 18, 2014 15:32
package net.cazzar.itech2100.assign2.dialogues;
import assignment2.Property;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
/**
* @author Cayde
@Cazzar
Cazzar / example_block.json
Last active August 29, 2015 14:11
goes into /assets/domain/models/block/ 2nd in /assets/domain/models/item
{
"parent": "block/cube_all",
"textures": {
"all": "domain:blocks/texture"
}
}
public void missingMappings(FMLMissingMappingsEvent e) {
for (FMLMissingMappingsEvent.MissingMapping mapping : e.getAll()) {
if ("ukeboxreloaded:blockJukebox".equals(mapping.name)) { //You know, because FML has a small mapping issue.
mapping.remap(proxy.jukeBox);
}
}
}
@Cazzar
Cazzar / scratch
Last active August 29, 2015 14:11
import com.google.common.base.Predicate
import net.minecraft.block.Block
import net.minecraft.block.material.Material
import net.minecraft.block.properties.PropertyDirection
import net.minecraft.block.state.{BlockState, IBlockState}
import net.minecraft.util.EnumFacing
object BlockExample extends {
val FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL.asInstanceOf[Predicate[EnumFacing]])
} with Block(Material.wood) {
scala> import net.minecraft.tileentity.TileEntity
import net.minecraft.util.BlockPos
import net.minecraft.world.IBlockAccess
def getTile[T <: TileEntity](world: IBlockAccess, pos: BlockPos): T = world.getTileEntity(pos) match {
case t: T => t
case _ => null
}
import net.minecraft.tileentity.TileEntity
package net.cazzar.mods.jukeboxreloaded.network.message
import io.netty.buffer.ByteBuf
import net.cazzar.mods.jukeboxreloaded.JukeboxReloaded
import net.cazzar.mods.jukeboxreloaded.Util._
import net.minecraft.item.{Item, ItemStack}
import net.minecraft.util.BlockPos
import net.minecraftforge.fml.common.network.simpleimpl.{MessageContext, IMessageHandler, IMessage}
class ClientPlayMessage(var item: Item, var pos: BlockPos) extends IMessage {
implicit class RichByteBuf(buf: ByteBuf) {
def writeString(str: String) = ByteBufUtils.writeUTF8String(buf, String)
def readString() = ByteBufUtils.readUTF8String(buf)
def writeItemStack(is: ItemStack) = ByteBufUtils.writeItemStack(buf, is)
def readItemStack() = ByteBufUtils.readItemStack(buf)
def writePos(pos: BlockPos): Unit = {
buf.writeInt(pos.getX)
buf.writeInt(pos.getY)
package net.cazzar.mods.jukeboxreloaded
import io.netty.buffer.ByteBuf
import net.minecraft.block.Block
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.{Item, ItemStack}
import net.minecraft.tileentity.TileEntity
import net.minecraft.util.{BlockPos, ChatComponentText}
import net.minecraft.world.World
import net.minecraftforge.fml.common.network.ByteBufUtils
#include <stdio.h>
int main()
{
int ae1 = 0xDEADBEEF;
printf("%d", ae1);
*(&ae1) = NULL;
printf("%d", ae1);
return 0;
}
@Cazzar
Cazzar / javap
Last active August 29, 2015 14:12
Compiled from "test.java"
class test {
public java.util.List<java.lang.String> strings;
test();
}