CRT integration "full" function explanation

This tutorial is set by the author to use the CC By-NC-SA protocol.

First of all, all the interpretation rights of this tutorial are owned by the author. The reason for the birth of this tutorial is that the sword brother wants it).

The following titles are called this module, please correspond to it by yourself

Baules integration (jewelry)

This module part depends on the existence of COT

Player Expansion (Player Extension)

Method: BaouthSinventory

Return to this player's ibautSinventory;

Method: IsbaultEquipped (IITEMSTACK BAUBLE)

Return to the slot number of the jewelry, if it is not found, return -1

IbaultSinventory (Jewelry Bar Backpack)

Guide bag

 Import Mods.ctintegration.bautEs.ibaultInventory; 

Method: ISITEMVALIDFORSLOT (Int Slot, IItemstack item, IENTITYLIVINGBASE LIVING)

Back to Boolean value, the role is to detect whether a certain groove of a certain entity is a jewelry

Method: ISITEMVALID (Int Slot, IItemstack item)

Back to Boolean value, the role is whether a certain slot is a jewelry

Method: getslotcount ()

Return to int, the role is to obtain the number of slots (7 adds 7 jewelry columns. If other modules are added, the number of obtained will change)

Method: getstackinslot (int Slot)

Return to IITEMSTACK, the role is to obtain a jewelry of a slot

Creating a Bautem (custom jewelry)

Need COT

BarableItemRepRangation has extended itemRepRestation, so all methods that can be used for constructing ContentTweaker items can also be used for it.

The following methods are provided:

The representation of the method name function describes String BaubleType. It must be "amulet" amulet, "Ring" ring, "Belt" belt, "Trinket" any, "Head" head, "Body" body, and "Charm" pendant.If it is not set, the default is TrinketBaultEventhandler.CanequiP CANEQUIPFUNCTION (IItemstack Baging, IentityLivingBase Wearer) determining whether the jewel EQUIPFUNCTION (IITEMSTACK BAUBLE, IntiTylivingBase Wearer) determine whether the jewelry cannot be equipped Base wearer) When wearing jewelry, call each t every t

BarableEventhandler.Onequipped OnequippedFunction (IItemstack Bauble, IentityLivingBase Wearer) Call (note only once!) ONUNEQUIPDFUNCTION (IItemstack Baaring, IENTITYLIVINGBASE Wearer) When the jewelry is not equipped (that is, get off from the jewelry bar) (Note that it will only trigger it once!) BautEventhandler.Willautosync WillautosyncFunction (IItemstack BaUBLE, IentityLivingBase) PE Getbautypefunction (IItemstack BaUBLE) Note: This is preferred to the BaubleType attribute. If this attribute is set, BagingType will be ignored!(Nothing to use for short) Case)

In fact, it is no different from the item, after all, the jewelry is also the item

#loader contenttweaker

Import Mods.ContentTweaker.Vanillafactory;

Import Mods.ctintegrating.baultS.ibaubleInventory;

import crafttweaker.player.iplayer;

var bautest = vanillaFactory.createbautem ("test_baut");

barableTest.rarity = "Rare"; // Set the item cherish

baubleTest.onwork = Function (bauble, weerr) {// When wearing jewelry

Ifer Instanceof iPlayer) {

Var Player as iPlayer = Wearer;

Player.xp+1;

}

};

baabletest.onunequipped = Function (bauble, weerr) {// When the jewelry is not equipped, call (that is, take it off from the jewelry bar)

Ifer Instanceof iPlayer) {

Var Player as iPlayer = Wearer;

Player.xp-1;

If (Player.baultSinventory.getstackinslot (5) .definition.id == "asasasa: lalalala") {//

Player.xp+5; // can make two specific accessories wearing two specific accessories to get stronger results

}

}

};

baubleTest.onequipped = Function (barable, weerr) {// When the jewelry equipment is called

Ifer Instanceof iPlayer) {

Var Player as iPlayer = Wearer;

Player.xp+1;

}

};

baubleTest.brationype = "Trinket"; // Type

baabletest.register ();

FTBMONEY Integration (FTBQ task)

Player Expansion (Player Extension)

Get the return type settings setting parameter description FTBMONEYLONGFTBMONEYLONG to get the player's FTB currency

case

 Print (player.ftbmoney); // Print the number of currencies, I believe it is well understood 

Bloodmagic Integration (Blood Magic 2)

Soul Network (Will Network/Soul Network)

Use Soulnetwork to adjust it on the iPlayer

Methods to describe Public Void ADD (int amount, int maximum) increase will (in hell soulstone) Public Void ADD (ItextComponent Description, INT AMOUNT, INT MAXIMUM) increase will (in hell soul stone) Publ IC Void Syphon (ITEXTCOMPOMPONENT Description, int AMOUNT, @Optional Boolean Skipevent) The will of the will (iPlayer Player, Float Syphon) does not understand Public iPlayer GetCachedplayer () Aspiration

Get the return type settings setting parameter description ORBTIERINTONTORINT without CurrentessencentCurrentessenceIntlp

case

 Player.soulnetwork.currentessence-= 5; // Player's LP minus 5

player.soulnetwork.clear ()-= 5; // All the players' will zero

Project Integration (equivalent exchange)

Guide bag

 Import Mods.ctintegrating.project.emcmanager; 

Methods

Method description Static Void Mapemc () Project is usually mapping EMC values ​​when the server starts, which is much later than Crafttweaker registering its formula.If you want to get an EMC value outside the event, you must first call this method to force Project to map the EMC value.Otherwise, each item will get 0 emc.Make sure not to use it many times, because mapping EMC takes a long time, especially on a large module bag.Static Long Getemc (IITEMSTACK Item) obtained EMC for items.If you want to use it outside the event, you must first call the maPemc.Static Long GetemCSellValue (IITEMSTACK Item) The EMC sold for items depends on the Project configuration.The same as above, please call Mapemc first.Static Boolean IsemcSet (IItemstack item) If the EMC value of the item is set, return True, opposite the FalSestatic Void Setemc (IITEMSTACK Item, Long Value) setting of the EMC.Note: If the value is obtained after setting the EMC value of the same item, the old value will still be obtained, unless you call the mapmc () again after you set the EMC of the item and get it before getting.STATIC VOID SETEMC (INGREDIENT INGREDIENT, Long Value) set EMC

IItemstack Expansion

Methods Return the type settings setting parameter description how much EMCSCSELLVALUELONG-how much does emclongemclong buy

Player Expansion (Player Extension)

Get the return type settings setting parameter description Personalemclongpersonalemclong to get and set the player's EMC

case

1. 1.

 Print ("emc:"+ .emc); // Print 0

.emc = 6666;

Print ("EMC:"+ .emc); // Print 0, but it will set EMC to 6666

when entering the world when entering the world.

2.

 emcmanager.mapemc ();

Print ("EMC:"+ .emc); // Print 2048, because it was originally 2048 2048

.emc = 6666;

Print ("EMC:"+ .emc); // Print 2048, but it will set EMC to 6666

when entering the world.

3..

 emcmanager.mapemc ();

Print ("EMC:"+ .emc); // Print 2048, because it was originally 2048 2048

.emc = 6666;

Emcmanager.mapemc (); // Remember not to use too much!IntersectionIntersection

Print ("EMC:"+ .emc); // Print 6666

Scalinghealth Integration

Guide bag

 Import Mods.ctintegration.Scalingheadhth.diffultyManager; 

Methods

Methods describe Static Void SetDifficulty (iPlayer Player, Double Value) to set the difficulty for players. FFICulty (iPlayer Player, Double Value, BOOLEAN AFFFECTWORLDDIFFICULTY) to set the difficultyDetermine whether it affects the world's difficulty Static Double GetDifficulty (iPlayer Player) to get the player's difficulty Static DoubledDIFFIFFIFIFIFICULTY (IWORLD World) to obtain the world's difficulty Static Void Setworkdificult (IWORLD World, Double Value) Set the world's difficulty Static Void AddWorldDiffical (IWORLD World, Double Value) to increase the world to increase the worldDifficulties Static IDLASTTIMEPLAYED (iPlayer Player) Get the player date Static Float Getmaxhealth (iPlayer Player) Get the player's largest life Static Void Setmaxhealth (iPlayer Player, FL, OAT VALUE) Set the greatest life Static Void Addmaxhealth (iPlayer Player, Float Value) to increase the maximum life of player lifeStatic Doubles GetareAdiffical (iPlayer Player) obtain block difficulty Static Double GetareAdificulty (IWORLD World, IBLOCKPOS POS) to obtain block difficulty

Player Expansion (Player Extension)

Get the return type settings setting parameter description ScalingHealthmaxhealthdoubleScalingHealthmaxhealth to obtain or sets the maximum life of player DifficalDoubleFicultydouble iFFICULTYDOUBLE-The difficulty of getting the block where the player is located.

IWorld Expansion (World Extension)

Get the return type settings setting parameter description WorlddifficaldoubleWorldDifFicultydouble

Energy Storage (energy storage)

This interface allows you to operate the items stored in energy (Fe or RF).You can obtain its instance by calling IItemstack#Energy.Before performing this operation, be sure to check whether it is energy storage!

Method description int Receivenergy (int MaxReceive, @optional Boolean Simulating) adds energy to storage items.The amount of energy returned to the increase (for example, if you add 100RF to the item A, it will return 100).INT EXTRACTENERGY (int Maxextract, @optional Boolean Simulating) reduces energy from the storage items.The amount of energy that has been removed (for example, if you reduce 10086RF for the item B, it will return 10086).Int getenergystored () returns the amount of energy of the currently stored items.Okay.EssenceEssenceInt GetMaxnerGyStored () returns the maximum energy of the currently stored items.Boolean Canxtract () If the items that are stored can extract energy, they return to True. Conversely, Falseboolean CanReceive () If the storage items can receive energy, return True, opposite Falsevanilla EXPANSION (original extension)

Player Expansion (Player Extension)

Methods to describe Void Addexperine (int amount) to increase experience points instead of grade Void Removeexperine (int amount) Remove the experience point INT GETTTOTALXP () Return to the total experimental value of the player's Void PlaySound (String S OUNDRESORCELOCATION, FLOAT VOLUME, Float Pitch) Note:The client and server player have different behaviors.For details, see how Forge does the sound event.Check whether the world is the server to determine where it is played.SendplaySoundPacket (String SoundResourceLocation, String SoundCategory, Positive3F POS, Float Volume, Float Pitch) Makes players play a sound on its client Boolean IsPlayermp (). If the internal object of the iPlayer is an instance of EntityPlayermp, returns True.IADVANCEMENTPROGress GetAdvancementProgress (IADVANCEMENT Advancement) to get the upgrade.Please note that players must be an instance of EntityPlayermp, otherwise they will return NULL.

Entityplayermp guarantee! World.remote

IWorld Expansion (World Extension)

Methods to describe Void SetorCreategamerule (String Key, String Value) about more game rules, please install Crafttweaker Utils. This is just the lack of functions. Ring Soundcategory, Position3f Location, Float Volume, Float Pitch, @Optional BooleanDistancedlay) Playing sound

IItemstack Expansion (item expansion)

Methods describing Itemstack (IITEMSTACK Itemstack) (Also A ZenCaster) (Also A ZenCaster) into its NBT form. itemstack) If items can store energy, return True

Get the return type description ENERGYINERGYSTRAGE to obtain the IEnergyStorage instance from the project stack.If the item is not an energy container, an error will occur.

ISERVER Expansion (server extension)

Get the return type description PlayersipLayer [] Back to the server PlayerCountint, the number of players on the server

postscript