public class StructureLibAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
HINT_BLOCK_META_AIR |
static int |
HINT_BLOCK_META_DEFAULT |
static int |
HINT_BLOCK_META_ERROR |
static int |
HINT_BLOCK_META_GENERIC_0 |
static int |
HINT_BLOCK_META_GENERIC_1 |
static int |
HINT_BLOCK_META_GENERIC_10 |
static int |
HINT_BLOCK_META_GENERIC_11 |
static int |
HINT_BLOCK_META_GENERIC_2 |
static int |
HINT_BLOCK_META_GENERIC_3 |
static int |
HINT_BLOCK_META_GENERIC_4 |
static int |
HINT_BLOCK_META_GENERIC_5 |
static int |
HINT_BLOCK_META_GENERIC_6 |
static int |
HINT_BLOCK_META_GENERIC_7 |
static int |
HINT_BLOCK_META_GENERIC_8 |
static int |
HINT_BLOCK_META_GENERIC_9 |
static int |
HINT_BLOCK_META_NOT_AIR |
static String |
MOD_ID |
| Constructor and Description |
|---|
StructureLibAPI() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addThrottledChat(Object throttleKey,
EntityPlayer player,
IChatComponent text,
short intervalRequired)
Send chat to player, but throttled.
|
static void |
addThrottledChat(Object throttleKey,
EntityPlayer player,
IChatComponent text,
short intervalRequired,
boolean forceUpdateLastSend)
Send chat to player, but throttled.
|
static void |
disableInstrument()
Stop instrumenting.
|
static void |
enableInstrument(Object identifier)
Start instrumenting for the current thread only.
|
static void |
endHinting(World w)
End current batch of hinting.
|
static Block |
getBlockHint()
Get the Block for StructureLib supplied hint block.
|
static Item |
getDefaultHologramItem()
Get the hologram item.
|
static Item |
getItemBlockHint()
Get the ItemBlock for StructureLib supplied hint block.
|
static void |
hintParticle(World w,
int x,
int y,
int z,
Block block,
int meta)
Generate a new hint particle on client side at given location using textures from given block.
|
static void |
hintParticle(World w,
int x,
int y,
int z,
IIcon[] icons)
Generate a new hint particle on client side at given location using given textures.
|
static void |
hintParticleTinted(World w,
int x,
int y,
int z,
Block block,
int meta,
short[] RGBa)
Generate a new hint particle on client side at given location using textures from given block with a tint.
|
static void |
hintParticleTinted(World w,
int x,
int y,
int z,
IIcon[] icons,
short[] RGBa)
Generate a new hint particle on client side at given location using given textures with a tint.
|
static boolean |
isBlockTriviallyReplaceable(World w,
int x,
int y,
int z,
EntityPlayer actor)
Determines if given block can be replaced without much effort.
|
static boolean |
isBlockTriviallyReplaceable(World w,
int x,
int y,
int z,
EntityPlayerMP actor)
Deprecated.
|
static boolean |
isDebugEnabled()
Check if structure debug mode is on.
|
static boolean |
isInstrumentEnabled()
Check if instrumenting is enabled.
|
static boolean |
markHintParticleError(EntityPlayer player,
World w,
int x,
int y,
int z)
Update the tint of given hint particle.
|
static void |
queryAlignment(IAlignmentProvider provider)
Query the ExtendedFacing of this tile entity from client side.
|
static void |
sendAlignment(IAlignmentProvider provider)
Send the ExtendedFacing of this Tile Entity to all players.
|
static void |
sendAlignment(IAlignmentProvider provider,
EntityPlayerMP player)
Send the ExtendedFacing of this Tile Entity to given player.
|
static void |
sendAlignment(IAlignmentProvider provider,
NetworkRegistry.TargetPoint targetPoint)
Send the ExtendedFacing of this Tile Entity to all players around target point.
|
static void |
sendAlignment(IAlignmentProvider provider,
World dimension)
Send the ExtendedFacing of this Tile Entity to all players in that dimension.
|
static void |
setDebugEnabled(boolean enabled) |
static void |
startHinting(World w)
Start a batch of hinting.
|
static boolean |
updateHintParticleTint(EntityPlayer player,
World w,
int x,
int y,
int z,
short[] RGBa)
Update the tint of given hint particle.
|
public static final String MOD_ID
public static final int HINT_BLOCK_META_GENERIC_0
public static final int HINT_BLOCK_META_GENERIC_1
public static final int HINT_BLOCK_META_GENERIC_2
public static final int HINT_BLOCK_META_GENERIC_3
public static final int HINT_BLOCK_META_GENERIC_4
public static final int HINT_BLOCK_META_GENERIC_5
public static final int HINT_BLOCK_META_GENERIC_6
public static final int HINT_BLOCK_META_GENERIC_7
public static final int HINT_BLOCK_META_GENERIC_8
public static final int HINT_BLOCK_META_GENERIC_9
public static final int HINT_BLOCK_META_GENERIC_10
public static final int HINT_BLOCK_META_GENERIC_11
public static final int HINT_BLOCK_META_DEFAULT
public static final int HINT_BLOCK_META_AIR
public static final int HINT_BLOCK_META_NOT_AIR
public static final int HINT_BLOCK_META_ERROR
public static void enableInstrument(Object identifier)
IStructureDefinition's builtin iteration methods will send StructureEvent and its subclasses when
appropriate. Otherwise, these events will not be sent at all, regardless of whether a listener for these events
are registered.
Identifiers are required to be value-comparable, i.e. overrides Object.equals(Object). Suggested
identifier includes
ModContainerIConstructable and its friends, if you are
triggering structure check via this interface.ResourceLocation
It's an API abuse for normal IStructureDefinition users to depend on this feature. They have full control
and full knowledge of the IStructureDefinition they are using. Using events to instrument the structure
check/autoplace is completely unnecessary and does nothing but add overhead.
Instruments are required to call disableInstrument() whenever it is done with its business, as there can
be only one instrument for any given thread.
identifier - an identifier sent along the actual event.IllegalStateException - if instrument has already been enabled.public static void disableInstrument()
IllegalStateException - if instrumenting hasn't been enabled.public static boolean isInstrumentEnabled()
public static void startHinting(World w)
You don't need to call this unless your constructable tool didn't call
ConstructableUtility.handle(ItemStack, EntityPlayer, World, int, int, int, int)
public static void endHinting(World w)
You don't need to call this unless your constructable tool didn't call
ConstructableUtility.handle(ItemStack, EntityPlayer, World, int, int, int, int)
public static void hintParticleTinted(World w, int x, int y, int z, IIcon[] icons, short[] RGBa)
w - World to spawn. Usually the client world.x - x coordy - y coordz - z coordicons - 6 texture. in forge direction order.RGBa - a 4 short array. tint in rgba form. currently alpha channel is ignored, but we might change this
later on.public static void hintParticleTinted(World w, int x, int y, int z, Block block, int meta, short[] RGBa)
w - World to spawn. Usually the client world.x - x coordy - y coordz - z coordblock - block to take texture frommeta - the meta of block to take texture fromRGBa - a 4 short array. tint in rgba form. currently alpha channel is ignored, but we might change this
later on.public static void hintParticle(World w, int x, int y, int z, IIcon[] icons)
w - World to spawn. Usually the client world.x - x coordy - y coordz - z coordicons - 6 texture. in forge direction order.public static void hintParticle(World w, int x, int y, int z, Block block, int meta)
w - World to spawn. Usually the client world.x - x coordy - y coordz - z coordblock - block to take texture frommeta - the meta of block to take texture frompublic static boolean markHintParticleError(EntityPlayer player, World w, int x, int y, int z)
Can be called on either client side or server side. Server side will schedule a network message to update it for this player only. Will do nothing if no hint particle is found at given location.
public static boolean updateHintParticleTint(EntityPlayer player, World w, int x, int y, int z, short[] RGBa)
public static void queryAlignment(IAlignmentProvider provider)
IAlignment.setExtendedFacing(ExtendedFacing) upon arrival of
server reply.
The server side will query the ExtendedFacing of this provider using
IAlignment.getExtendedFacing()
IllegalArgumentException - if is not tile entity or provided a null alignmentpublic static void sendAlignment(IAlignmentProvider provider)
The receiving tile entity will receive the ExtendedFacing via its
IAlignment.setExtendedFacing(ExtendedFacing) method.
IllegalArgumentException - if is not tile entity or provided a null alignmentpublic static void sendAlignment(IAlignmentProvider provider, EntityPlayerMP player)
The receiving tile entity will receive the ExtendedFacing via its
IAlignment.setExtendedFacing(ExtendedFacing) method.
IllegalArgumentException - if is not tile entity or provided a null alignmentpublic static void sendAlignment(IAlignmentProvider provider, NetworkRegistry.TargetPoint targetPoint)
The receiving tile entity will receive the ExtendedFacing via its
IAlignment.setExtendedFacing(ExtendedFacing) method.
IllegalArgumentException - if is not tile entity or provided a null alignmentpublic static void sendAlignment(IAlignmentProvider provider, World dimension)
The receiving tile entity will receive the ExtendedFacing via its
IAlignment.setExtendedFacing(ExtendedFacing) method.
IllegalArgumentException - if is not tile entity or provided a null alignmentpublic static Block getBlockHint()
public static Item getItemBlockHint()
public static Item getDefaultHologramItem()
public static boolean isDebugEnabled()
public static void setDebugEnabled(boolean enabled)
@Deprecated public static boolean isBlockTriviallyReplaceable(World w, int x, int y, int z, EntityPlayerMP actor)
Use this in your
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)
public static boolean isBlockTriviallyReplaceable(World w, int x, int y, int z, EntityPlayer actor)
Use this in your
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment)
public static void addThrottledChat(Object throttleKey, EntityPlayer player, IChatComponent text, short intervalRequired)
throttleKey - throttle key. Must properly implement Object.hashCode() and
Object.equals(Object) to handle value equality.player - player to send chat totext - chat to sendintervalRequired - interval required before last recorded time to actually send the message. unit in
millisecond. we purposefully chose to not use a bigger data type to limit how long this
interval can bepublic static void addThrottledChat(Object throttleKey, EntityPlayer player, IChatComponent text, short intervalRequired, boolean forceUpdateLastSend)
throttleKey - throttle key. Must properly implement Object.hashCode() and
Object.equals(Object) to handle value equality.player - player to send chat totext - chat to sendintervalRequired - interval required before last recorded time to actually send the message. unit in
millisecond. we purposefully chose to not use a bigger data type to limit how long
this interval can beforceUpdateLastSend - if true, always update the last send time, even if the message isn't actually sent.