Jump to content

[PLUGIN RESOURCE] TekkitItem - Tekkit items and materialsin one class


NonameSL

Recommended Posts

TekkitItem -  Tekkit items and materials in one class |WIP - Expanding|

I created this class when I was 1) extremely bored and sick 2) noticed that there is no class for the tekkit items like Material.java

This started off as a tekkit version of Material.java in org.bukkit, but then I noticed that I have to include durabilities, because there are a lot of blocks with the same ids, so I changed it to TekkitItem.

 

This is an enum containing the tekkit classic items, but:

  • Block ID 136 is not included, as it is not only all microblocks (which are like 15 pages), but also wires, insulated wires, cables, bundled cables, pipes, bluewires, and much more, and nobody is that bored to add it.
  • I did not include all colors of lamp as the durabilities are obvious because the colors are same as in wool.

Source code:

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public enum TekkitItem {
	ENERGY_COLLECTOR(126),
	ENERGY_COLLECTOR_MK2(126, (short)1),
	ENERGY_COLLECTOR_MK3(126, (short)2),
	DM_FURNACE(126, (short)3),
	RM_FURNACE(126, (short)4),
	ANTI_MATTER_RELAY(126, (short)5),
	ANTI_MATTER_RELAY_MK2(126, (short)6),
	ANTI_MATTER_RELAY_MK3(126, (short)7),
	DM_BLOCK(126, (short)8),
	RM_BLOCK(126, (short)9),
	NOVA_CATALYST(126, (short)10),
	NOVA_CATACLYSM(126, (short)11),
	DM_PEDESTAL(127),
	ALCHEMICAL_CHEST(128),
	ENERGY_CONDENSER(128, (short)1),
	INTERDICTION_TORCH(129),
	TRANSMUTATION_TABLET(130),
	
	BACKPLANE(133),
	EIGHT_K_RAM_MODULE(133, (short)1),
	MONITOR_REDPOWER(134),
	CENTRAL_PROCCESSING_UNIT(134, (short)1),
	DISK_DRIVE_REDPOWER(134, (short)2),
	
	NETHER_COAL(135),
	NETHER_DIAMOND(135, (short)1),
	NETHER_GOLD_ORE(135, (short)2),
	NETHER_IRON_ORE(135, (short)3),
	NETHER_LAPIS_LAZULI(135, (short)3),
	NETHER_REDSTONE_ORE(135, (short)4),
	NETHER_COPPER_ORE(135, (short)5),
	NETHER_TIN_ORE(135, (short)6),
	
	/**
	 * 136:
	 * 0-56 - Covers
	 * 256 - Red alloy wire
	 * 512-527 - Insulated wire
	 * 768-784 - Bundled cable
	 * 1280 - Blue alloy wire
	 * 1792 - Fluid pipe
	 * 
	 */
	
	ALLOY_FURNACE(137),
	BLULECTRIC_FURNACE(137, (short)1),
	BUFFER(137, (short)2),
	PROJECT_TABLE(137, (short)3),
	BLULECTRIC_ALLOY_FURNACE(137, (short)4),
	
	TIMER(138),
	SEQUENCER(138, (short)1),
	STATE_CELL(138, (short)2),
	RS_LATCH(138, (short)256),
	NOR_GATE(138, (short)257),
	OR_GATE(138, (short)258),
	NAND_GATE(138, (short)259),
	AND_GATE(138, (short)260),
	XNOR_GATE(138, (short)261),
	XOR_GATE(138, (short)262),
	PULSE_FORMER(138, (short)263),
	TOGGLE_LATCH(138, (short)264),
	NOT_GATE(138, (short)265),
	BUFFER_GATE(138, (short)266),
	MULTIPLEXER(138, (short)267),
	REPEATER(138, (short)268),
	SYNCHRONIZER(138, (short)269),
	RANDOMIZER(138, (short)270),
	TRANSPARENT_LATCH(138, (short)271),
	LIGHT_SENSOR(138, (short)272),
	NULL_CELL(138, (short)512),
	INVERT_CELL(138, (short)513),
	NON_INVERT_CELL(138, (short)514),
	COUNTER(138, (short)768),
	BUS_TRANSCIEVER(138, (short)1024),

	INDIGO_FLOWER(139),
	RUBBER_SAPLING_REDPOWER2(139, (short)1),
	RUBY_ORE(140),
	EMERALD_ORE(140, (short)1),
	SAPPHIRE_ORE(140, (short)2),
	SILVER_ORE(140, (short)3),
	TIN_ORE(140, (short)4),
	COPPER_ORE(140, (short)5),
	TUNGSTEN_ORE(140, (short)6),
	NIKOLITE_ORE(140, (short)7),
	
	LEAVES(141),
	MARBLE(142),
	BASALT(142,(short)1),
	MARBLE_BRICK(142, (short)2),
	BASALT_COBBLESTONE(142, (short)3),
	BASALT_BRICK(142, (short)4),
	RUBBERWOOD(143),
	
	RUBY_BLOCK(145),
	EMERALD_BLOCK(145, (short)1),
	SAPPHIRE_BLOCK(145, (short)2),
	
	LAMP(147),
	
	IO_EXPANDER(148),
	DEPLOYER(150),
	BLOCK_BREAKER(150, (short)1),
	TRANSPOSER(150, (short)2),
	FILTER(150, (short)3),
	ITEM_DETECTOR(150, (short)4),
	SORTING_MACHINE(150, (short)5),
	BATTERY_BOX(150, (short)6),
	FRAME_MOTOR(150, (short)7),
	RETRIEVER(150, (short)8),
	REGULATOR(150, (short)10),
	THERMOPILE(150, (short)11),
	IGNITER(150, (short)12),
	ASSEMBLER(150, (short)13),
	EJECTOR(150, (short)14),
	RELAY(150, (short)15),
	
	SOLAR_PANEL_REDPOWER(151),
	PUMP_REDPOWER(151, (short)1),
	ACCELERATOR(151, (short)2),
	GRATE(151, (short)3),
	SUPPORT_FRAME(152),
	QUARRY(153),
	LAND_MARK(154),
	FILLER(155),
	BUILDER(157),
	TEMPLATE_DRAWING_TABLE(158),
	FRAME(160),
	
	REDSTONE_ENGINE(161),
	STEAM_ENGINE(161, (short)1),
	COMBUSTION_ENGINE(161, (short)2),
	
	OIL_1(162),
	OIL_2(163),
	
	PUMP_BUILDCRAFT(164),
	TANK(165),
	REFINERY(167),
	
	AUTOMATIC_CRAFTING_TABLE(169),
	MINING_PIPE(171),
	MINING_WELL(174),
	
	WIRELESS_RECIEVER(177),
	WIRELESS_TRANSMITTER(177, (short)256),
	WIRELESS_JAMMER(177, (short)512),
	
	ENDER_CHEST(178),
	
	;
	private int id;
	private short dur;
	private TekkitItem(int id){
		this(id, (short)0);
	}
	private TekkitItem(int id, short dur){
		this.id=id;
		this.dur=dur;
	}
	public short getDurability(){
		return dur;
	}
	public int getId(){
		return id;
	}
	public boolean compare(Object obj){
		if(obj instanceof TekkitItem){
			return ((TekkitItem)obj).id==id;
		}else if(obj instanceof Material){
			return ((Material)obj).getId()==id&&dur==0;
		}else if(obj instanceof ItemStack){
			ItemStack is = (ItemStack)obj;
			return is.getTypeId()==id&&is.getDurability()==dur;
		}
		return false;
	}
}

This code is not complete! Please help and contribute to the code by adding more items to the list.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...