本文整理汇总了Java中ic2.api.item.IC2Items类的典型用法代码示例。如果您正苦于以下问题:Java IC2Items类的具体用法?Java IC2Items怎么用?Java IC2Items使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IC2Items类属于ic2.api.item包,在下文中一共展示了IC2Items类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public void init(FMLInitializationEvent event) {
Register.addShapedRecipie(new ItemStack(steelBlock), new Object[] { "sss", "sss", "sss", 's', "ingotSteel" });
for (int id = 0; id < ((BlockBaseMeta) testingWall).getMetaSize(); id++) {
ItemStack dye = new ItemStack(Items.dye, 1, 15 - id);
ItemStack currentBlock = new ItemStack(testingWall, 1, id);
Register.addShapedRecipie(currentBlock, new Object[] { " i ", "idi", " i ", 'i', "ingotSteel", 'd', dye });
Register.addShapelessRecipie(currentBlock, new Object[] { "testingWall", dye, dye, dye });
}
Register.addShapedRecipie(new ItemStack(upgradeTable), new Object[] { "sss", "ici", "iti", 's', "plateSteel", 'i', "ingotIron", 'c', "cpu", 't', Blocks.crafting_table });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 0), new Object[] { " l ", "lbl", " l ", 'b', "testingWall", 'l', new ItemStack(Items.dye, 1, 4) });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 1), new Object[] { " d ", " b ", " ", 'b', "bluePrint", 'd', new ItemStack(Items.dye, 1, 15) });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 2), new Object[] { " d", " b ", " ", 'b', "bluePrint", 'd', new ItemStack(Items.dye, 1, 15) });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 3), new Object[] { " ", " bd", " ", 'b', "bluePrint", 'd', new ItemStack(Items.dye, 1, 15) });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 4), new Object[] { " ", " b ", " d", 'b', "bluePrint", 'd', new ItemStack(Items.dye, 1, 15) });
Register.addShapedRecipie(new ItemStack(bluePrint, 1, 0), new Object[] { "d ", " b ", " ", 'b', "bluePrint", 'd', new ItemStack(Items.dye, 1, 15) });
Register.addShapelessRecipie(new ItemStack(poweredChest), new Object[] { Blocks.chest, Items.redstone, Blocks.tripwire_hook });
Register.addShapedRecipie(new ItemStack(renamer), new Object[] { " n ", "gmg", "csc", 'n', Items.name_tag, 'g', "blockGlass", 'm', IC2Items.getItem("machine"), 'c', IC2Items.getItem("coil"), 's', "plateSteel" });
Register.addShapedRecipie(new ItemStack(solderBlock), new Object[] { "sss", "sss", "sss", 's', "ingotSolder" });
}
示例2: parse
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public Ingredient parse(JsonContext context, JsonObject json)
{
String name = JsonUtils.getString(json, "name");
ItemStack stack = null;
// If item with variant.
if (name.contains("#")) {
String[] parts = name.split("#");
stack = IC2Items.getItem(parts[0], parts[1]);
} else {
stack = IC2Items.getItem(name);
}
if (stack == null)
throw new JsonSyntaxException("IC2 item with name " + name + " could not be found");
return Ingredient.fromStacks(stack);
}
示例3: init
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void init(){
tesla = new ItemTeslaUpgrade();
radar = new ItemRadarUpgrade();
scanner = new ItemScanner();
nr = new ItemNRUpgrade();
wrench = li.cil.oc.api.Items.get("wrench").item();
if(Loader.isModLoaded("IC2"))
uranCell = IC2Items.getItem("reactorUraniumSimple").getItem();
if(Config.registerTeslaUpgrade)
GameRegistry.registerItem(tesla, "ot_teslaUpgrade");
if(Config.registerRadarUpgrade)
GameRegistry.registerItem(radar, "ot_radarUpgrade");
if(Config.registerScanner)
GameRegistry.registerItem(scanner, "ot_scanner");
if(Config.registerNR && Loader.isModLoaded("IC2"))
GameRegistry.registerItem(nr, "ot_nrUpgrade");
}
示例4: onRightClick
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public ActionResult<ItemStack> onRightClick(ItemStack itemStack, EntityPlayer entityPlayer, EnumHand hand) {
ItemStack target = IC2Items.getItem("nuclear", "uranium_238");
if (itemStack.isItemEqual(target)) {
if (PLConfig.instance.throwableUran238) {
if (!entityPlayer.capabilities.isCreativeMode) {
--itemStack.stackSize;
}
entityPlayer.world.playSound(entityPlayer, entityPlayer.getPosition(),
SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS,
0.5F, 0.4F / (new Random().nextFloat() * 0.4F + 0.8F));
if (!entityPlayer.world.isRemote) {
entityPlayer.world.spawnEntity(new EntityThrownItem(entityPlayer.world, entityPlayer, itemStack));
}
}
return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack);
}
return ActionResult.newResult(EnumActionResult.PASS, itemStack);
}
示例5: registerRecipes
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void registerRecipes()
{
GameRegistry.addShapedRecipe(new ItemStack(LvWaterTurbine),
"WWW", "WTW", "WWW",
'W', IC2Items.getItem("waterMill"),
'T', IC2Items.getItem("lvTransformer"));
GameRegistry.addShapedRecipe(new ItemStack(MvWaterTurbine),
"WWW", "WTW", "WWW",
'W', new ItemStack(LvWaterTurbine),
'T', IC2Items.getItem("mvTransformer"));
GameRegistry.addShapedRecipe(new ItemStack(HvWaterTurbine),
"WWW", "WTW", "WWW",
'W', new ItemStack(MvWaterTurbine),
'T', IC2Items.getItem("hvTransformer"));
GameRegistry.addShapedRecipe(new ItemStack(EvWaterTurbine),
"WWW", "WTW", "WWW",
'W', new ItemStack(HvWaterTurbine),
'T', IC2Items.getItem("evTransformer"));
}
示例6: addRecipesToRegistry
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void addRecipesToRegistry(){
//AE Kit
Recipes.advRecipes.addRecipe(new ItemStack(CrossAppeng.kitAppeng), new Object[]{
"IT", "PD",
'I', AEApi.instance().definitions().materials().fluixCrystal().maybeStack(1).get(),
'T', IC2Items.getItem("frequencyTransmitter"),
'P', Items.paper,
'D', "dyePurple"});
//AE Monitor
Recipes.advRecipes.addRecipe(new ItemStack(CrossAppeng.networklink), new Object[]{
"BRB", "YCY", "BRB",
'B', "ingotIron",
'R', AEApi.instance().definitions().materials().calcProcessor().maybeStack(1).get(),
'Y', AEApi.instance().definitions().parts().cableGlass().item(AEColor.Purple),
'C', Items.comparator});
}
示例7: addGregtechRecipes
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void addGregtechRecipes(){
//AE Kit
Recipes.advRecipes.addRecipe(new ItemStack(CrossAppeng.kitAppeng), new Object[]{
"IT", "PD",
'I', AEApi.instance().definitions().materials().fluixCrystal().maybeStack(1).get(),
'T', IC2Items.getItem("frequencyTransmitter"),
'P', Items.paper,
'D', "dyePurple"});
//AE Monitor
Recipes.advRecipes.addRecipe(new ItemStack(CrossAppeng.networklink), new Object[]{
"BRB", "YCY", "BRB",
'B', "plateIron",
'R', AEApi.instance().definitions().materials().calcProcessor().maybeStack(1).get(),
'Y', AEApi.instance().definitions().parts().cableGlass().item(AEColor.Transparent),
'C', Items.comparator});
}
示例8: initVanilla
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void initVanilla(){
inventoryCard = new ItemCardInventoryScanner().setUnlocalizedName("ItemInventoryScannerCard");
vanillaKit = new ItemVanillaKit().setUnlocalizedName("ItemVanilliaKit");
machineCard = new ItemVanillaMachineCard().setUnlocalizedName("ItemVanillaMachineCard");
GameRegistry.registerItem(inventoryCard, "ItemInventoryScannerCard");
GameRegistry.registerItem(vanillaKit, "ItemVanilliaKit");
GameRegistry.registerItem(machineCard, "ItemVanillaMachineCard");
Recipes.advRecipes.addRecipe(new ItemStack(vanillaKit), new Object[] {
"PL ",
"FC ",
'P', Items.paper,
'C', "circuitBasic",
'F', IC2Items.getItem("frequencyTransmitter"),
'L', Blocks.lever
});
}
示例9: isItemValid
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public boolean isItemValid(int slotIndex, ItemStack itemstack) {
switch (slotIndex) {
case SLOT_CHARGER:
if (Item.getIdFromItem(itemstack.getItem()) == Item.getIdFromItem(IC2Items.getItem("suBattery").getItem()))
return true;
if (itemstack.getItem() instanceof IElectricItem) {
IElectricItem item = (IElectricItem) itemstack.getItem();
if (item.canProvideEnergy(itemstack) && item.getTier(itemstack) <= tier) {
return true;
}
}
return false;
case SLOT_CARD:
return itemstack.getItem() instanceof ItemCardReactorSensorLocation
|| itemstack.getItem() instanceof ItemCard55Reactor;
default:
return itemstack.isItemEqual(IC2Items.getItem("transformerUpgrade"))
|| itemstack.isItemEqual(IC2Items.getItem("energyStorageUpgrade"))
|| (itemstack.getItem() instanceof ItemUpgrade && itemstack.getItemDamage() == ItemUpgrade.DAMAGE_RANGE);
}
}
示例10: init
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public void init() {
glassFibreCable = IC2Items.getItem("cable", "type:glass");
overclockerUpgrade = IC2Items.getItem("upgrade", "overclocker");
transformerUpgrade = IC2Items.getItem("upgrade", "transformer");
energyStorageUpgrade = IC2Items.getItem("upgrade", "energy_storage");
}
示例11: getInputs
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public List<ItemStack> getInputs() {
List<ItemStack> ret = new ArrayList<ItemStack>();
for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
}
ret.add(IC2Items.getItem("fluid_cell", fluid.getName()));
return ret;
}
示例12: postInit
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void postInit(FMLPostInitializationEvent event) {
addStack(IC2Items.getItem("rubber"), 32);
addStack(IC2Items.getItem("carbonPlate"), 256);
addStack(Ic2Items.energyCrystal, 32896 / 9);
addStack(Ic2Items.chargingEnergyCrystal, 32896 / 9);
addStack(IC2Items.getItem("refinedIronIngot"), 512);
addStack(Ic2Items.plateadviron, 512);
addStack(Ic2Items.reBattery, 608);
addStack(Ic2Items.chargedReBattery, 608);
addIC2Handlers();
}
示例13: init
import ic2.api.item.IC2Items; //导入依赖的package包/类
@Override
public void init()
{
Modifier.addType( new ElectricModifier() );
ModifierRecipes.add( "electric", 1, ListUtils.asList( IC2Items.getItem( "reBattery" ) ) );
ModifierRecipes.add( "electric", 1, ListUtils.asList( IC2Items.getItem( "advBattery" ) ) );
ModifierRecipes.add( "electric", 1, ListUtils.asList( IC2Items.getItem( "energyCrystal" ) ) );
ModifierRecipes.add( "electric", 1, ListUtils.asList( IC2Items.getItem( "lapotronCrystal" ) ) );
}
示例14: onEntityThrowableImpact
import ic2.api.item.IC2Items; //导入依赖的package包/类
@SubscribeEvent
public void onEntityThrowableImpact(EntityThrowableImpactEvent event) {
Optional<ItemStack> optItemStack = event.entityThrownItem.getThrowItem();
if (!optItemStack.isPresent()) {
return;
}
ItemStack stack = optItemStack.get();
if (stack.getItem().equals(PLItems.packagedSalt)) {
for (int i = 0; i < 8; ++i) {
float fmod = (float) (1.2 - (Math.random() * 2.4));
float f1mod = (float) (0.5 - (Math.random() * 1.0));
float f2mod = (float) (1.2 - (Math.random() * 2.4));
event.entityThrownItem.world.spawnParticle(EnumParticleTypes.ITEM_CRACK,
event.entityThrownItem.posX + fmod, event.entityThrownItem.posY + f1mod,
event.entityThrownItem.posZ + f2mod, 0.1D, 0.1D, 0.1D, Item.getIdFromItem(PLItems.salt));
if (!event.entityThrownItem.world.isRemote) {
EntityItem entityItem = new EntityItem(event.entityThrownItem.world,
event.entityThrownItem.posX + fmod, event.entityThrownItem.posY + f1mod,
event.entityThrownItem.posZ + f2mod, new ItemStack(PLItems.salt));
event.entityThrownItem.world.spawnEntity(entityItem);
}
}
this.onImpact(event.entityThrownItem, event.movingObjectPosition, new PotionEffect(PLPotion.salty, 0, 3));
} else if (stack.isItemEqual(IC2Items.getItem("Uran238"))) {
this.onImpact(event.entityThrownItem, event.movingObjectPosition, new PotionEffect(IC2Potion.radiation, 200, 0));
} else {
this.onImpact(event.entityThrownItem, event.movingObjectPosition, null);
}
}
示例15: addRecipes
import ic2.api.item.IC2Items; //导入依赖的package包/类
public static void addRecipes(){
//TODO BR doesn't have any GT recipes
Recipes.advRecipes.addRecipe(new ItemStack(CrossBigReactors.kitRFsensor), new Object[]{
"IT", "PD",
'I', "ingotYellorium",
'T', IC2Items.getItem("frequencyTransmitter"),
'P', Items.paper,
'D', "dyeRed"});
Recipes.advRecipes.addRecipe(new ItemStack(CrossBigReactors.ReactorInfoFetch), new Object[]{
"BRB", "YCY", "BRB",
'B', "reactorCasing",
'R', "dustRedstone",
'Y', "ingotYellorium",
'C', Items.comparator});
}