Skip to content
meta1203 edited this page Aug 21, 2011 · 17 revisions

How to hook into ProofOfConcept:

In your JavaPlugin class, import these classes:
import meta1203.ProofOfConcept.ProofOfConcept;

import meta1203.ProofOfConcept.BlockVar;

In that same class, create these global variables: public ProofOfConcept proof;

BlockVar newBlock = new BlockVar(101,net.minecraft.server.Material.STONE);

//replace newBlock with a good block Variable Name, replace 101 with a unique block ID, and STONE with the correct Material type

In the "onEnable" method, add this:

Plugin plug = pm.getPlugin("ProofOfConcept");

proof = (ProofOfConcept)plug;

proof.newBlock(101, 1F, 1F, 8, 4, 22, "BlockName");

// Replace newBlock with the BlockVar variable from earlier.

// Replace 101 with the unique block ID,

// the first 1F with the hardness,

// the second 1F with the resistance,

// the 8 with the corresponding stepSound integer,

// the 4 with the texture tile ID,

// the 22 with the corresponding materialType integer,

// and the BlockName with the custom name of the block.

Your block will then be sent to the client.


materialType integers:

case 0: mat = Material.builtSnow; break;

case 1: mat = Material.cactus; break;

case 2: mat = Material.cakeMaterial; break;

case 3: mat = Material.circuits; break;

case 4: mat = Material.clay; break;

case 5: mat = Material.cloth; break;

case 6: mat = Material.fire; break;

case 7: mat = Material.glass; break;

case 8: mat = Material.grassMaterial; break;

case 9: mat = Material.ground; break;

case 10: mat = Material.ice; break;

case 11: mat = Material.lava; break;

case 12: mat = Material.leaves; break;

case 13: mat = Material.plants; break;

case 14: mat = Material.portal; break;

case 15: mat = Material.pumpkin; break;

case 16: mat = Material.rock; break;

case 17: mat = Material.sand; break;

case 18: mat = Material.snow; break;

case 19: mat = Material.sponge; break;

case 20: mat = Material.tnt; break;

case 21: mat = Material.water; break;

case 22: mat = Material.wood; break;

stepSound integers:

case 0: ss = Block.soundClothFootstep; break;

case 1: ss = Block.soundGlassFootstep; break;

case 2: ss = Block.soundGrassFootstep; break;

case 3: ss = Block.soundGravelFootstep; break;

case 4: ss = Block.soundMetalFootstep; break;

case 5: ss = Block.soundPowderFootstep; break;

case 6: ss = Block.soundSandFootstep; break;

case 7: ss = Block.soundStoneFootstep; break;

case 8: ss = Block.soundWoodFootstep; break;

Clone this wiki locally